[pypy-svn] r61908 - pypy/trunk/pypy/rlib

afa at codespeak.net afa at codespeak.net
Sun Feb 15 01:20:30 CET 2009


Author: afa
Date: Sun Feb 15 01:20:30 2009
New Revision: 61908

Modified:
   pypy/trunk/pypy/rlib/rmmap.py
   pypy/trunk/pypy/rlib/rwin32.py
Log:
Replace LPCTSTR with LPCSTR: the additional 'T' refers to a type
that resolves to wchar_t* instead of char* when "#ifdef UNICODE",
and this makes little sense with pypy.


Modified: pypy/trunk/pypy/rlib/rmmap.py
==============================================================================
--- pypy/trunk/pypy/rlib/rmmap.py	(original)
+++ pypy/trunk/pypy/rlib/rmmap.py	Sun Feb 15 01:20:30 2009
@@ -71,7 +71,7 @@
 
     from pypy.rlib.rwin32 import HANDLE, LPHANDLE
     from pypy.rlib.rwin32 import DWORD, WORD, DWORD_PTR, LPDWORD
-    from pypy.rlib.rwin32 import BOOL, LPVOID, LPCVOID, LPCTSTR, SIZE_T
+    from pypy.rlib.rwin32 import BOOL, LPVOID, LPCVOID, LPCSTR, SIZE_T
     from pypy.rlib.rwin32 import INT, LONG, PLONG
 
 # export the constants inside and outside. see __init__.py
@@ -165,8 +165,8 @@
     GetFileSize = winexternal('GetFileSize', [HANDLE, LPDWORD], DWORD)
     GetCurrentProcess = winexternal('GetCurrentProcess', [], HANDLE)
     DuplicateHandle = winexternal('DuplicateHandle', [HANDLE, HANDLE, HANDLE, LPHANDLE, DWORD, BOOL, DWORD], BOOL)
-    CreateFileMapping = winexternal('CreateFileMappingA', [HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCTSTR], HANDLE)
-    MapViewOfFile = winexternal('MapViewOfFile', [HANDLE, DWORD, DWORD, DWORD, SIZE_T], LPCTSTR)##!!LPVOID)
+    CreateFileMapping = winexternal('CreateFileMappingA', [HANDLE, LPSECURITY_ATTRIBUTES, DWORD, DWORD, DWORD, LPCSTR], HANDLE)
+    MapViewOfFile = winexternal('MapViewOfFile', [HANDLE, DWORD, DWORD, DWORD, SIZE_T], LPCSTR)##!!LPVOID)
     CloseHandle = winexternal('CloseHandle', [HANDLE], BOOL)
     UnmapViewOfFile = winexternal('UnmapViewOfFile', [LPCVOID], BOOL)
     FlushViewOfFile = winexternal('FlushViewOfFile', [LPCVOID, SIZE_T], BOOL)
@@ -514,7 +514,7 @@
                                      0, 0, 0)
                 if data:
                     # XXX we should have a real LPVOID which must always be casted
-                    charp = rffi.cast(LPCTSTR, data)
+                    charp = rffi.cast(LPCSTR, data)
                     self.setdata(charp, newsize)
                     return
                 else:
@@ -725,7 +725,7 @@
                                 0, 0, 0)
             if res:
                 # XXX we should have a real LPVOID which must always be casted
-                charp = rffi.cast(LPCTSTR, res)
+                charp = rffi.cast(LPCSTR, res)
                 m.setdata(charp, map_size)
                 return m
             else:

Modified: pypy/trunk/pypy/rlib/rwin32.py
==============================================================================
--- pypy/trunk/pypy/rlib/rwin32.py	(original)
+++ pypy/trunk/pypy/rlib/rwin32.py	Sun Feb 15 01:20:30 2009
@@ -32,7 +32,6 @@
         PLONG = rffi_platform.SimpleType("PLONG", rffi.LONGP)
         LPVOID = rffi_platform.SimpleType("LPVOID", rffi.INTP)
         LPCVOID = rffi_platform.SimpleType("LPCVOID", rffi.VOIDP)
-        LPCTSTR = rffi_platform.SimpleType("LPCTSTR", rffi.CCHARP)
         LPCSTR = rffi_platform.SimpleType("LPCSTR", rffi.CCHARP)
         LPDWORD = rffi_platform.SimpleType("LPDWORD", rffi.INTP)
         SIZE_T = rffi_platform.SimpleType("SIZE_T", rffi.SIZE_T)



More information about the Pypy-commit mailing list