diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c index e52c49dc51b..6ed6086877f 100644 --- a/dlls/msvcrt/errno.c +++ b/dlls/msvcrt/errno.c @@ -122,7 +122,7 @@ unsigned int MSVCRT__sys_nerr = sizeof(MSVCRT__sys_errlist)/sizeof(MSVCRT__sys_e void msvcrt_set_errno(int err) { int *errno = MSVCRT__errno(); - unsigned long *doserrno = MSVCRT___doserrno(); + MSVCRT_ulong *doserrno = MSVCRT___doserrno(); *doserrno = err; @@ -189,7 +189,7 @@ int* CDECL MSVCRT__errno(void) /********************************************************************* * __doserrno (MSVCRT.@) */ -unsigned long* CDECL MSVCRT___doserrno(void) +MSVCRT_ulong* CDECL MSVCRT___doserrno(void) { return &msvcrt_get_thread_data()->thread_doserrno; } diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index c1418439795..2da5e2655e3 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -924,7 +924,7 @@ int CDECL MSVCRT__locking(int fd, int mode, LONG nbytes) /********************************************************************* * fseek (MSVCRT.@) */ -int CDECL MSVCRT_fseek(MSVCRT_FILE* file, long offset, int whence) +int CDECL MSVCRT_fseek(MSVCRT_FILE* file, MSVCRT_long offset, int whence) { /* Flush output if needed */ if(file->_flag & MSVCRT__IOWRT) @@ -956,13 +956,13 @@ int CDECL MSVCRT_fseek(MSVCRT_FILE* file, long offset, int whence) /********************************************************************* * _chsize (MSVCRT.@) */ -int CDECL _chsize(int fd, long size) +int CDECL _chsize(int fd, MSVCRT_long size) { LONG cur, pos; HANDLE handle; BOOL ret = FALSE; - TRACE("(fd=%d, size=%ld)\n", fd, size); + TRACE("(fd=%d, size=%d)\n", fd, size); LOCK_FILES(); @@ -1895,9 +1895,9 @@ int CDECL MSVCRT_stat64(const char* path, struct MSVCRT__stat64 * buf) buf->st_atime = dw; RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); buf->st_mtime = buf->st_ctime = dw; - TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, - (long)(buf->st_size >> 32),(long)buf->st_size, - (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); + TRACE("%d %d 0x%08x%08x %d %d %d\n", buf->st_mode,buf->st_nlink, + (int)(buf->st_size >> 32),(int)buf->st_size, + (int)buf->st_atime,(int)buf->st_mtime,(int)buf->st_ctime); return 0; } @@ -1984,9 +1984,9 @@ int CDECL MSVCRT__wstat64(const MSVCRT_wchar_t* path, struct MSVCRT__stat64 * bu buf->st_atime = dw; RtlTimeToSecondsSince1970((LARGE_INTEGER *)&hfi.ftLastWriteTime, &dw); buf->st_mtime = buf->st_ctime = dw; - TRACE("%d %d 0x%08lx%08lx %ld %ld %ld\n", buf->st_mode,buf->st_nlink, - (long)(buf->st_size >> 32),(long)buf->st_size, - (long)buf->st_atime,(long)buf->st_mtime,(long)buf->st_ctime); + TRACE("%d %d 0x%08x%08x %d %d %d\n", buf->st_mode,buf->st_nlink, + (int)(buf->st_size >> 32),(int)buf->st_size, + (int)buf->st_atime,(int)buf->st_mtime,(int)buf->st_ctime); return 0; } @@ -2020,7 +2020,7 @@ int CDECL MSVCRT__wstat(const MSVCRT_wchar_t* path, struct MSVCRT__stat * buf) /********************************************************************* * _tell (MSVCRT.@) */ -long CDECL _tell(int fd) +MSVCRT_long CDECL _tell(int fd) { return MSVCRT__lseek(fd, 0, SEEK_CUR); } @@ -2872,7 +2872,7 @@ LONG CDECL MSVCRT_ftell(MSVCRT_FILE* file) { /* TODO: just call fgetpos and return lower half of result */ int off=0; - long pos; + MSVCRT_long pos; pos = _tell(file->_file); if(pos == -1) return -1; if(file->_bufsiz) { diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 3b026a3d3a5..862d8d06a5a 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -436,7 +436,7 @@ double CDECL _logb(double num) /********************************************************************* * _lrotl (MSVCRT.@) */ -unsigned long CDECL _lrotl(unsigned long num, int shift) +MSVCRT_ulong CDECL _lrotl(MSVCRT_ulong num, int shift) { shift &= 0x1f; return (num << shift) | (num >> (32-shift)); @@ -445,7 +445,7 @@ unsigned long CDECL _lrotl(unsigned long num, int shift) /********************************************************************* * _lrotr (MSVCRT.@) */ -unsigned long CDECL _lrotr(unsigned long num, int shift) +MSVCRT_ulong CDECL _lrotr(MSVCRT_ulong num, int shift) { shift &= 0x1f; return (num >> shift) | (num << (32-shift)); @@ -463,7 +463,7 @@ unsigned int CDECL _rotr(unsigned int num, int shift) /********************************************************************* * _scalb (MSVCRT.@) */ -double CDECL _scalb(double num, long power) +double CDECL _scalb(double num, MSVCRT_long power) { /* Note - Can't forward directly as libc expects y as double */ double dblpower = (double)power; @@ -592,7 +592,7 @@ int * CDECL __fpecode(void) /********************************************************************* * ldexp (MSVCRT.@) */ -double CDECL MSVCRT_ldexp(double num, long exp) +double CDECL MSVCRT_ldexp(double num, MSVCRT_long exp) { double z = ldexp(num,exp); @@ -1007,10 +1007,10 @@ MSVCRT_div_t CDECL MSVCRT_div(int num, int denom) * [i386] Windows binary compatible - returns the struct in eax/edx. */ #ifdef __i386__ -unsigned __int64 CDECL MSVCRT_ldiv(long num, long denom) +unsigned __int64 CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom) { ldiv_t ldt = ldiv(num,denom); - return ((unsigned __int64)ldt.rem << 32) | (unsigned long)ldt.quot; + return ((unsigned __int64)ldt.rem << 32) | (MSVCRT_ulong)ldt.quot; } #else /********************************************************************* @@ -1018,7 +1018,7 @@ unsigned __int64 CDECL MSVCRT_ldiv(long num, long denom) * VERSION * [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility */ -MSVCRT_ldiv_t CDECL MSVCRT_ldiv(long num, long denom) +MSVCRT_ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom) { ldiv_t result = ldiv(num,denom); diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index cba6aa8ea0f..3d3c03b9de5 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -63,9 +63,9 @@ int CDECL MSVCRT_rand(void) /********************************************************************* * _sleep (MSVCRT.@) */ -void CDECL MSVCRT__sleep(unsigned long timeout) +void CDECL MSVCRT__sleep(MSVCRT_ulong timeout) { - TRACE("_sleep for %ld milliseconds\n",timeout); + TRACE("_sleep for %d milliseconds\n",timeout); Sleep((timeout)?timeout:1); } diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index d982e8f491f..7edcd6d427c 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -46,6 +46,8 @@ typedef unsigned short MSVCRT_wint_t; typedef unsigned short MSVCRT_wctype_t; typedef unsigned short MSVCRT__ino_t; typedef unsigned int MSVCRT__fsize_t; +typedef int MSVCRT_long; +typedef unsigned int MSVCRT_ulong; #ifdef _WIN64 typedef unsigned __int64 MSVCRT_size_t; typedef __int64 MSVCRT_intptr_t; @@ -56,8 +58,8 @@ typedef long MSVCRT_intptr_t; typedef unsigned long MSVCRT_uintptr_t; #endif typedef unsigned int MSVCRT__dev_t; -typedef int MSVCRT__off_t; -typedef long MSVCRT_clock_t; +typedef int MSVCRT__off_t; +typedef int MSVCRT_clock_t; typedef int MSVCRT___time32_t; typedef __int64 MSVCRT___time64_t; typedef __int64 MSVCRT_fpos_t; @@ -91,7 +93,7 @@ extern DWORD msvcrt_tls_index; struct __thread_data { int thread_errno; - unsigned long thread_doserrno; + MSVCRT_ulong thread_doserrno; unsigned int random_seed; /* seed for rand() */ char *strtok_next; /* next ptr for strtok() */ unsigned char *mbstok_next; /* next ptr for mbstok() */ @@ -263,8 +265,8 @@ typedef struct MSVCRT__div_t { } MSVCRT_div_t; typedef struct MSVCRT__ldiv_t { - long quot; /* quotient */ - long rem; /* remainder */ + MSVCRT_long quot; /* quotient */ + MSVCRT_long rem; /* remainder */ } MSVCRT_ldiv_t; struct MSVCRT__heapinfo { @@ -715,7 +717,7 @@ MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*); MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*); void __cdecl MSVCRT__exit(int); void __cdecl MSVCRT_abort(void); -unsigned long* __cdecl MSVCRT___doserrno(void); +MSVCRT_ulong* __cdecl MSVCRT___doserrno(void); int* __cdecl MSVCRT__errno(void); char* __cdecl MSVCRT_getenv(const char*); char* __cdecl MSVCRT_setlocale(int,const char*); diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index 33661489ab5..0b1eb01d272 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -185,7 +185,7 @@ static MSVCRT_intptr_t msvcrt_spawn(int flags, const MSVCRT_wchar_t* exe, MSVCRT static MSVCRT_wchar_t* msvcrt_argvtos(const MSVCRT_wchar_t* const* arg, MSVCRT_wchar_t delim) { const MSVCRT_wchar_t* const* a; - long size; + int size; MSVCRT_wchar_t* p; MSVCRT_wchar_t* ret; @@ -230,7 +230,7 @@ static MSVCRT_wchar_t* msvcrt_argvtos(const MSVCRT_wchar_t* const* arg, MSVCRT_w static MSVCRT_wchar_t *msvcrt_argvtos_aw(const char * const *arg, MSVCRT_wchar_t delim) { const char * const *a; - unsigned long len; + unsigned int len; MSVCRT_wchar_t *p, *ret; if (!arg) diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index edc0799e6b3..d4056563c62 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -179,7 +179,7 @@ static void test_readmode( BOOL ascii_mode ) const int *ip; int i, j, m, ao, pl; unsigned int fp; - long l; + LONG l; fd = open ("fdopen.tst", O_WRONLY | O_CREAT | O_BINARY, _S_IREAD |_S_IWRITE); /* an internal buffer of BUFSIZ is maintained, so make a file big @@ -212,7 +212,7 @@ static void test_readmode( BOOL ascii_mode ) ok(fgets(buffer,2*BUFSIZ+256,file) !=0,"padding line fgets failed unexpected in %s\n", IOMODE); l = ftell(file); pl = 2*BUFSIZ-2; - ok(l == pl,"padding line ftell got %ld should be %d in %s\n", l, pl, IOMODE); + ok(l == pl,"padding line ftell got %d should be %d in %s\n", l, pl, IOMODE); ok(lstrlenA(buffer) == pl+ao,"padding line fgets got size %d should be %d in %s\n", lstrlenA(buffer), pl+ao, IOMODE); for (fp=0; fpcurrent >= 'A' && *sym->current <= 'P') { - long ret = 0; + int ret = 0; while (*sym->current >= 'A' && *sym->current <= 'P') { @@ -329,7 +329,7 @@ static const char* get_number(struct parsed_symbol* sym) if (*sym->current != '@') return NULL; ptr = und_alloc(sym, 17); - sprintf(ptr, "%s%ld", sgn ? "-" : "", ret); + sprintf(ptr, "%s%d", sgn ? "-" : "", ret); sym->current++; } else return NULL;