Skip to content

Commit 97a107e

Browse files
authored
Merge pull request swig#1619 from emminizer/fix-msvc2019-python
Fix error in generated code for Python in MSVC 2019.
2 parents 4c86ed4 + 9fc57f4 commit 97a107e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Lib/python/std_map.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
%#endif
102102
res = traits_asptr_stdseq<map_type, std::pair<K, T> >::asptr(items, val);
103103
} else {
104-
map_type *p;
104+
map_type *p = 0;
105105
swig_type_info *descriptor = swig::type_info<map_type>();
106106
res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
107107
if (SWIG_IsOK(res) && val) *val = p;

Lib/python/std_multimap.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
%#endif
3030
res = traits_asptr_stdseq<std::multimap<K,T>, std::pair<K, T> >::asptr(items, val);
3131
} else {
32-
multimap_type *p;
32+
multimap_type *p = 0;
3333
swig_type_info *descriptor = swig::type_info<multimap_type>();
3434
res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
3535
if (SWIG_IsOK(res) && val) *val = p;

Lib/python/std_pair.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
res = get_pair(first, second, val);
4848
}
4949
} else {
50-
value_type *p;
50+
value_type *p = 0;
5151
swig_type_info *descriptor = swig::type_info<value_type>();
5252
res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
5353
if (SWIG_IsOK(res) && val) *val = *p;
@@ -104,7 +104,7 @@
104104
res = get_pair(first, second, val);
105105
}
106106
} else {
107-
value_type *p;
107+
value_type *p = 0;
108108
swig_type_info *descriptor = swig::type_info<value_type>();
109109
res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
110110
if (SWIG_IsOK(res) && val) *val = p;

Lib/python/std_unordered_map.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
%#endif
8888
res = traits_asptr_stdseq<std::unordered_map<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
8989
} else {
90-
unordered_map_type *p;
90+
unordered_map_type *p = 0;
9191
swig_type_info *descriptor = swig::type_info<unordered_map_type>();
9292
res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
9393
if (SWIG_IsOK(res) && val) *val = p;

Lib/python/std_unordered_multimap.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
%#endif
3737
res = traits_asptr_stdseq<std::unordered_multimap<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
3838
} else {
39-
unordered_multimap_type *p;
39+
unordered_multimap_type *p = 0;
4040
swig_type_info *descriptor = swig::type_info<unordered_multimap_type>();
4141
res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
4242
if (SWIG_IsOK(res) && val) *val = p;

0 commit comments

Comments
 (0)