fix -Wmaybe-uninitialized warning (initialize pointers to NULL)

This commit is contained in:
Alexander Alekhin
2014-06-10 18:12:38 +04:00
parent 1f4ddbe5b6
commit 4d0848b3e8

View File

@@ -153,6 +153,8 @@ def gen(name, args, ty, flags):
ctype = remap.get(a.ty, a.ty) ctype = remap.get(a.ty, a.ty)
if a.init: if a.init:
init = " = %s" % a.init init = " = %s" % a.init
elif ctype[-1] == '*':
init = ' = NULL'
else: else:
init = '' init = ''
yield " %s %s%s;" % (ctype, a.nm, init) yield " %s %s%s;" % (ctype, a.nm, init)