Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e56b4cf

Browse files
committed
Jack Jansen: A few new types needed by new API calls.
1 parent 1d8fcda commit e56b4cf

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Tools/bgen/bgen/macsupport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ScriptCode = Type("ScriptCode", "h")
1616
Size = Type("Size", "l")
1717
Style = Type("Style", "b")
18-
StyleParameter = Type("Style", "h")
18+
StyleParameter = Type("StyleParameter", "h")
1919
CharParameter = Type("CharParameter", "h")
2020
TextEncoding = Type("TextEncoding", "l")
2121

@@ -31,7 +31,8 @@
3131
Str255 = OpaqueArrayType("Str255", "PyMac_BuildStr255", "PyMac_GetStr255")
3232

3333
# File System Specifications
34-
FSSpec = FSSpec_ptr = OpaqueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
34+
FSSpec_ptr = OpaqueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
35+
FSSpec = OpaqueByValueType("FSSpec", "PyMac_BuildFSSpec", "PyMac_GetFSSpec")
3536

3637
# OSType and ResType: 4-byte character strings
3738
def OSTypeType(typename):
@@ -85,6 +86,7 @@ def errorCheck(self, name):
8586
# Various buffer types
8687

8788
InBuffer = VarInputBufferType('char', 'long', 'l') # (buf, len)
89+
OptionalInBuffer = OptionalVarInputBufferType('char', 'long', 'l') # (buf, len)
8890

8991
InOutBuffer = HeapInputOutputBufferType('char', 'long', 'l') # (inbuf, outbuf, len)
9092
VarInOutBuffer = VarHeapInputOutputBufferType('char', 'long', 'l') # (inbuf, outbuf, &len)
@@ -151,9 +153,9 @@ def errorCheck(self, name):
151153
# This requires that the OSErr type (defined above) has a non-trivial
152154
# errorCheck method.
153155
class OSErrMixIn:
154-
"Mix-in class to treat OSErr return values special"
156+
"Mix-in class to treat OSErr/OSStatus return values special"
155157
def makereturnvar(self):
156-
if self.returntype is OSErr:
158+
if self.returntype.__class__ == OSErrType:
157159
return Variable(self.returntype, "_err", ErrorMode)
158160
else:
159161
return Variable(self.returntype, "_rv", OutMode)

0 commit comments

Comments
 (0)