X-Git-Url: http://git.tdb.fi/?p=gldbg.git;a=blobdiff_plain;f=genwrap.py;h=1ee97cef332853da9e6c8ffb0d5033e7ae980b7f;hp=e614ab71ac34f2c237ad4f1571572490577ba602;hb=3c32a221de1435ae7af8d96182560e8b28f1a4c0;hpb=7c57338619688bc07f394ad82f75471aefbecc59 diff --git a/genwrap.py b/genwrap.py index e614ab7..1ee97ce 100755 --- a/genwrap.py +++ b/genwrap.py @@ -125,11 +125,11 @@ class Function: if self.kind=="value": if self.base_ctype.startswith("const "): self.base_ctype = self.base_ctype[6:] - self.io = iomap[self.base_ctype] else: if self.direction=="in": self.ctype = "const "+self.ctype self.ctype = self.ctype+" *" + self.io = iomap[self.base_ctype] def derive_csize(self): if self.kind=="array" and self.size is not None: @@ -138,6 +138,8 @@ class Function: self.csize = "%d*sizeof(%s)"%(self.size, self.base_ctype) elif self.size.startswith("COMPSIZE("): self.csize = self.func.compsize(self.size[9:-1], self.base_ctype) + elif self.size=="pname": + self.csize = "paramsize(pname)*sizeof(%s)"%self.base_ctype else: s = self.func.get_param(self.size.split('*')[0]) if (s.type=="SizeI" or s.type.endswith("Int32") or s.type.startswith("BufferSize")) and s.kind=="value": @@ -185,7 +187,7 @@ class Function: have_type = True elif cn.endswith("Format"): res += "formatsize(%s)"%param.name - elif cn.endswith(("Parameter", "ParameterPName", "ParameterName")) or cn=="GetPName": + elif param.name=="pname" or cn.endswith("Parameter"): res += "paramsize(%s)"%param.name elif cn=="MapTarget": res += "mapsize(%s)"%param.name