Only output the buffer size error label if it is used.

Shuts up another couple of gcc warnings.
This commit is contained in:
Jack Jansen 2001-09-05 10:27:53 +00:00
parent 703ad705c3
commit 5a1516bce5
2 changed files with 7 additions and 3 deletions

View File

@ -36,6 +36,7 @@ class FixedInputOutputBufferType(InputOnlyType):
self.datatype = datatype
self.sizetype = sizetype
self.sizeformat = sizeformat or type2format[sizetype]
self.label_needed = 0
def declare(self, name):
self.declareBuffer(name)
@ -67,6 +68,7 @@ class FixedInputOutputBufferType(InputOnlyType):
Output('PyErr_SetString(PyExc_TypeError, "buffer length should be %s");',
self.size)
Output("goto %s__error__;", name)
self.label_needed = 1
OutRbrace()
self.transferSize(name)
@ -83,6 +85,7 @@ class FixedInputOutputBufferType(InputOnlyType):
return "%s__out__, (int)%s" % (name, self.size)
def cleanup(self, name):
if self.label_needed:
DedentLevel()
Output(" %s__error__: ;", name)
IndentLevel()

View File

@ -24,6 +24,7 @@ class HeapInputOutputBufferType(FixedInputOutputBufferType):
OutLbrace()
Output('PyErr_NoMemory();')
Output("goto %s__error__;", name)
self.label_needed = 1
OutRbrace()
Output("%s__len__ = %s__in_len__;", name, name)