Commits

anatoly techtonik committed 36d864d

Fix BYTE data type to be unsigned - see http://bugs.python.org/issue16376

Comments (0)

Files changed (1)

 # for calling ANSI functions of Windows API (end with A) TCHAR is
 # defined as single char, for Unicode ones (end witn W) it is WCHAR
 TCHAR = wintypes.CHAR
+BYTE = ctypes.c_ubyte   # http://bugs.python.org/issue16376
+
 
 class LOGFONT(ctypes.Structure):
   # EnumFontFamiliesEx examines only 3 fields:
       # character rotation in tenths of degrees
     ('lfWeight', wintypes.LONG),
       # 0 through 1000  400 is normal, 700 is bold, 0 is default
-    ('lfItalic', wintypes.BYTE),
-    ('lfUnderline', wintypes.BYTE),
-    ('lfStrikeOut', wintypes.BYTE),
-    ('lfCharSet',   wintypes.BYTE),
+    ('lfItalic', BYTE),
+    ('lfUnderline', BYTE),
+    ('lfStrikeOut', BYTE),
+    ('lfCharSet',   BYTE),
       # 0    ANSI_CHARSET
       # 186  BALTIC_CHARSET
       # 136  CHINESEBIG5_CHARSET
       # 2    SYMBOL_CHARSET
       # 162  TURKISH_CHARSET
       # 163  VIETNAMESE_CHARSET
-    ('lfOutPrecision',  wintypes.BYTE),
+    ('lfOutPrecision', BYTE),
       # many constants how the output must match height, width, pitch etc.
       # OUT_DEFAULT_PRECIS
       # [ ] TODO
-    ('lfClipPrecision', wintypes.BYTE),
+    ('lfClipPrecision', BYTE),
       # how to clip characters, no useful properties, leave default value
       # CLIP_DEFAULT_PRECIS
-    ('lfQuality', wintypes.BYTE),
+    ('lfQuality', BYTE),
       # ANTIALIASED_QUALITY
       # CLEARTYPE_QUALITY
       # DEFAULT_QUALITY 
       # DRAFT_QUALITY
       # NONANTIALIASED_QUALITY
       # PROOF_QUALITY
-    ('lfPitchAndFamily', wintypes.BYTE),
+    ('lfPitchAndFamily', BYTE),
       # DEFAULT_PITCH
       # FIXED_PITCH
       # VARIABLE_PITCH
     ('mLastChar', TCHAR),
     ('mDefaultChar', TCHAR),
     ('mBreakChar', TCHAR),
-    ('tmItalic', wintypes.BYTE),
-    ('tmUnderlined', wintypes.BYTE),
-    ('tmStruckOut', wintypes.BYTE),
-    ('tmPitchAndFamily', wintypes.BYTE),
-    ('tmCharSet', wintypes.BYTE),
+    ('tmItalic', BYTE),
+    ('tmUnderlined', BYTE),
+    ('tmStruckOut', BYTE),
+    ('tmPitchAndFamily', BYTE),
+    ('tmCharSet', BYTE),
     ('tmFlags', wintypes.DWORD),
     ('ntmSizeEM', wintypes.UINT),
     ('ntmCellHeight', wintypes.UINT),