ntdll: Improve the prototypes Win64 compatibility by replacing long with LONG.

Francois Gouget fgouget at free.fr
Mon Jun 11 06:13:32 CDT 2007


---

ntdll does not have public documentation or headers that one can use to 
check the exact prototypes of its functions. But it would be surprising 
if its 'long's were not of the usual 32bit variety on 64bit platforms. 
So I changed them to LONGs. Next will be msvcrt which has essentially 
the same functions (and more).


 dlls/ntdll/misc.c      |    2 +-
 dlls/ntdll/string.c    |   12 ++++++------
 dlls/ntdll/wcstring.c  |   10 +++++-----
 tools/winapi/win32.api |    2 --
 4 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c
index 2f63ebb..d5e8c1d 100644
--- a/dlls/ntdll/misc.c
+++ b/dlls/ntdll/misc.c
@@ -149,7 +149,7 @@ int CDECL NTDLL_abs( int i )
 /*********************************************************************
  *                  labs   (NTDLL.@)
  */
-long CDECL NTDLL_labs( long i )
+LONG CDECL NTDLL_labs( LONG i )
 {
     return labs( i );
 }
diff --git a/dlls/ntdll/string.c b/dlls/ntdll/string.c
index ae56aae..ebfa6fb 100644
--- a/dlls/ntdll/string.c
+++ b/dlls/ntdll/string.c
@@ -449,7 +449,7 @@ int __cdecl NTDLL_isxdigit( int c )
 /*********************************************************************
  *                  strtol   (NTDLL.@)
  */
-long __cdecl NTDLL_strtol( const char *nptr, char **endptr, int base )
+LONG __cdecl NTDLL_strtol( const char *nptr, char **endptr, int base )
 {
     return strtol( nptr, endptr, base );
 }
@@ -458,7 +458,7 @@ long __cdecl NTDLL_strtol( const char *nptr, char **endptr, int base )
 /*********************************************************************
  *                  strtoul   (NTDLL.@)
  */
-unsigned long __cdecl NTDLL_strtoul( const char *nptr, char **endptr, int base )
+ULONG __cdecl NTDLL_strtoul( const char *nptr, char **endptr, int base )
 {
     return strtoul( nptr, endptr, base );
 }
@@ -476,7 +476,7 @@ int __cdecl NTDLL_atoi( const char *nptr )
 /*********************************************************************
  *                  atol   (NTDLL.@)
  */
-long __cdecl NTDLL_atol( const char *nptr )
+LONG __cdecl NTDLL_atol( const char *nptr )
 {
     return atol( nptr );
 }
@@ -497,7 +497,7 @@ long __cdecl NTDLL_atol( const char *nptr )
  *  - If str is NULL it crashes, as the native function does.
  */
 char * __cdecl _ultoa(
-    unsigned long value, /* [I] Value to be converted */
+    ULONG value,         /* [I] Value to be converted */
     char *str,           /* [O] Destination for the converted value */
     int radix)           /* [I] Number base for conversion */
 {
@@ -539,11 +539,11 @@ char * __cdecl _ultoa(
  *  - If str is NULL it crashes, as the native function does.
  */
 char * __cdecl _ltoa(
-    long value, /* [I] Value to be converted */
+    LONG value, /* [I] Value to be converted */
     char *str,  /* [O] Destination for the converted value */
     int radix)  /* [I] Number base for conversion */
 {
-    unsigned long val;
+    ULONG val;
     int negative;
     char buffer[33];
     char *pos;
diff --git a/dlls/ntdll/wcstring.c b/dlls/ntdll/wcstring.c
index 23fc5e8..9d1dc4d 100644
--- a/dlls/ntdll/wcstring.c
+++ b/dlls/ntdll/wcstring.c
@@ -278,7 +278,7 @@ INT __cdecl NTDLL_mbstowcs( LPWSTR dst, LPCSTR src, INT n )
 /*********************************************************************
  *                  wcstol  (NTDLL.@)
  */
-long __cdecl NTDLL_wcstol(LPCWSTR s,LPWSTR *end,INT base)
+LONG __cdecl NTDLL_wcstol(LPCWSTR s, LPWSTR *end, INT base)
 {
     return strtolW( s, end, base );
 }
@@ -287,7 +287,7 @@ long __cdecl NTDLL_wcstol(LPCWSTR s,LPWSTR *end,INT base)
 /*********************************************************************
  *                  wcstoul  (NTDLL.@)
  */
-unsigned long __cdecl NTDLL_wcstoul(LPCWSTR s,LPWSTR *end,INT base)
+ULONG __cdecl NTDLL_wcstoul(LPCWSTR s, LPWSTR *end, INT base)
 {
     return strtoulW( s, end, base );
 }
@@ -392,7 +392,7 @@ INT __cdecl NTDLL_iswxdigit( WCHAR wc )
  *  If str is NULL it just returns NULL.
  */
 LPWSTR __cdecl _ultow(
-    unsigned long value, /* [I] Value to be converted */
+    ULONG value,         /* [I] Value to be converted */
     LPWSTR str,          /* [O] Destination for the converted value */
     INT radix)           /* [I] Number base for conversion */
 {
@@ -436,11 +436,11 @@ LPWSTR __cdecl _ultow(
  *  If str is NULL it just returns NULL.
  */
 LPWSTR __cdecl _ltow(
-    long value, /* [I] Value to be converted */
+    LONG value, /* [I] Value to be converted */
     LPWSTR str, /* [O] Destination for the converted value */
     INT radix)  /* [I] Number base for conversion */
 {
-    unsigned long val;
+    ULONG val;
     int negative;
     WCHAR buffer[33];
     PWCHAR pos;
diff --git a/tools/winapi/win32.api b/tools/winapi/win32.api
index f9762d3..9460244 100644
--- a/tools/winapi/win32.api
+++ b/tools/winapi/win32.api
@@ -2818,11 +2818,9 @@ ULONG
 WCHAR
 WORD
 int
-long
 obj_handle_t
 size_t
 unsigned int
-unsigned long
 
 %long --pointer
 
-- 
1.4.4.4




More information about the wine-patches mailing list