From 15445cf1c8deba2903e393b665bedb73b73de7ba Mon Sep 17 00:00:00 2001 From: David Welch Date: Mon, 19 Feb 2001 15:04:51 +0000 Subject: [PATCH] Corrected va_arg bugs Don't require c++ for compilation Make sure the various stddef.h headers are kept seperate svn path=/trunk/; revision=1644 --- reactos/apps/tests/gditest/gditest.c | 2 +- reactos/apps/tests/gditest/makefile | 2 +- reactos/include/crtdll/stddef.h | 36 +++++++++---------- reactos/include/msvcrt/stddef.h | 36 +++++++++---------- .../lib/crtdll/misc/{setnew.cc => setnew.c} | 6 ++-- reactos/lib/crtdll/stdio/vfprintf.c | 8 ++--- reactos/lib/crtdll/stdio/vfwprint.c | 8 ++--- reactos/lib/msvcrt/stdio/vfprintf.c | 8 ++--- reactos/lib/msvcrt/stdio/vfwprint.c | 8 ++--- reactos/lib/ntdll/stdio/sprintf.c | 12 ++++--- reactos/lib/ntdll/stdio/swprintf.c | 11 +++--- reactos/lib/user32/graphics/icon.c | 14 ++++---- reactos/lib/user32/misc/sprintf.c | 10 +++--- reactos/ntoskrnl/rtl/sprintf.c | 12 ++++--- reactos/ntoskrnl/rtl/stdlib.c | 4 +-- reactos/ntoskrnl/rtl/swprintf.c | 10 +++--- reactos/ntoskrnl/se/sid.c | 3 +- reactos/rules.mak | 6 ++-- reactos/subsys/system/shell/makefile | 7 ++-- 19 files changed, 106 insertions(+), 97 deletions(-) rename reactos/lib/crtdll/misc/{setnew.cc => setnew.c} (70%) diff --git a/reactos/apps/tests/gditest/gditest.c b/reactos/apps/tests/gditest/gditest.c index 3e3a5efea59..d52a61dd634 100644 --- a/reactos/apps/tests/gditest/gditest.c +++ b/reactos/apps/tests/gditest/gditest.c @@ -4,7 +4,7 @@ #include -extern BOOL STDCALL GdiDllInitialize(PVOID hInstance, ULONG Event, PVOID Reserved); +extern BOOL STDCALL GdiDllInitialize(HANDLE hInstance, DWORD Event, LPVOID Reserved); int main (void) { diff --git a/reactos/apps/tests/gditest/makefile b/reactos/apps/tests/gditest/makefile index 09b2c0af4a5..c8b107a9e97 100644 --- a/reactos/apps/tests/gditest/makefile +++ b/reactos/apps/tests/gditest/makefile @@ -33,7 +33,7 @@ $(PROGS:%=../../$(DIST_DIR)/apps/%.exe): ../../$(DIST_DIR)/apps/%.exe: %.exe $(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe gditest.exe: gditest.c - $(CC) gditest.c $(LIBS) -lgcc -o gditest.exe + $(CC) $(CFLAGS) gditest.c $(LIBS) -o gditest.exe $(NM) --numeric-sort gditest.exe > gditest.sym include ../../rules.mak diff --git a/reactos/include/crtdll/stddef.h b/reactos/include/crtdll/stddef.h index d1d41a5b37d..380b63bb848 100644 --- a/reactos/include/crtdll/stddef.h +++ b/reactos/include/crtdll/stddef.h @@ -28,14 +28,14 @@ * DISCLAMED. This includes but is not limited to warranties of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * $Revision: 1.3 $ - * $Author: ariadne $ - * $Date: 1999/04/02 21:42:06 $ + * $Revision: 1.4 $ + * $Author: dwelch $ + * $Date: 2001/02/19 15:04:50 $ * */ -#ifndef _STDDEF_H_ +#ifndef __CRTDLL_STDDEF_H_ /* * Any one of these symbols __need_* means that a standard header file @@ -45,7 +45,7 @@ #if (!defined(__need_wchar_t) && !defined(__need_wint_t) \ && !defined(__need_size_t) && !defined(__need_ptrdiff_t) \ && !defined(__need_NULL)) -#define _STDDEF_H_ +#define __CRTDLL_STDDEF_H_ #endif /* @@ -64,7 +64,7 @@ /* Define this type if we are doing the whole job, or if we want this type * in particular. */ -#if defined (_STDDEF_H_) || defined (__need_ptrdiff_t) +#if defined (__CRTDLL_STDDEF_H_) || defined (__need_ptrdiff_t) #ifndef _PTRDIFF_T_ #define _PTRDIFF_T_ @@ -77,7 +77,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; /* If this symbol has done its job, get rid of it. */ #undef __need_ptrdiff_t -#endif /* _STDDEF_H_ or __need_ptrdiff_t. */ +#endif /* __CRTDLL_STDDEF_H_ or __need_ptrdiff_t. */ /* * Unsigned type of `sizeof' something. @@ -86,7 +86,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; /* Define this type if we are doing the whole job, * or if we want this type in particular. */ -#if defined (_STDDEF_H_) || defined (__need_size_t) +#if defined (__CRTDLL_STDDEF_H_) || defined (__need_size_t) #ifndef _SIZE_T_ #define _SIZE_T_ @@ -100,7 +100,7 @@ typedef __SIZE_TYPE__ size_t; #undef __need_size_t -#endif /* _STDDEF_H_ or __need_size_t. */ +#endif /* __CRTDLL_STDDEF_H_ or __need_size_t. */ /* Wide character type. Locale-writers should change this as necessary to @@ -109,7 +109,7 @@ typedef __SIZE_TYPE__ size_t; /* Define this type if we are doing the whole job, or if we want this type in particular. */ -#if defined (_STDDEF_H_) || defined (__need_wchar_t) +#if defined (__CRTDLL_STDDEF_H_) || defined (__need_wchar_t) #ifndef _WCHAR_T_ #define _WCHAR_T_ @@ -124,12 +124,12 @@ typedef __WCHAR_TYPE__ wchar_t; #undef __need_wchar_t -#endif /* _STDDEF_H_ or __need_wchar_t. */ +#endif /* __CRTDLL_STDDEF_H_ or __need_wchar_t. */ /* * wint_t, the equivalent of int in wchar ctype functions. */ -#if defined (_STDDEF_H_) || defined (__need_wint_t) +#if defined (__CRTDLL_STDDEF_H_) || defined (__need_wint_t) #ifndef _WINT_T_ #define _WINT_T_ @@ -143,18 +143,18 @@ typedef __WINT_TYPE__ wint_t; #undef __need_wint_t -#endif /* _STDDEF_H_ or __need_wint_t. */ +#endif /* __CRTDLL_STDDEF_H_ or __need_wint_t. */ /* * A null pointer constant. */ -#if defined (_STDDEF_H_) || defined (__need_NULL) +#if defined (__CRTDLL_STDDEF_H_) || defined (__need_NULL) #undef NULL #define NULL (0) -#endif /* _STDDEF_H_ or __need_NULL */ +#endif /* __CRTDLL_STDDEF_H_ or __need_NULL */ #undef __need_NULL @@ -165,9 +165,9 @@ typedef __WINT_TYPE__ wint_t; * zero. */ -#if defined (_STDDEF_H_) +#if defined (__CRTDLL_STDDEF_H_) #define offsetof(TYPE, MEMBER) ((size_t) &( ((TYPE *) 0)->MEMBER )) -#endif /* _STDDEF_H_ */ +#endif /* __CRTDLL_STDDEF_H_ */ -#endif /* not _STDDEF_H_ */ +#endif /* not __CRTDLL__CRTDLL_STDDEF_H_ */ diff --git a/reactos/include/msvcrt/stddef.h b/reactos/include/msvcrt/stddef.h index 9ee77343ed3..b22918aedc7 100644 --- a/reactos/include/msvcrt/stddef.h +++ b/reactos/include/msvcrt/stddef.h @@ -28,14 +28,14 @@ * DISCLAMED. This includes but is not limited to warranties of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * $Revision: 1.1 $ - * $Author: ekohl $ - * $Date: 2000/12/03 17:49:21 $ + * $Revision: 1.2 $ + * $Author: dwelch $ + * $Date: 2001/02/19 15:04:50 $ * */ -#ifndef _STDDEF_H_ +#ifndef __MSVCRT_STDDEF_H_ /* * Any one of these symbols __need_* means that a standard header file @@ -45,7 +45,7 @@ #if (!defined(__need_wchar_t) && !defined(__need_wint_t) \ && !defined(__need_size_t) && !defined(__need_ptrdiff_t) \ && !defined(__need_NULL)) -#define _STDDEF_H_ +#define __MSVCRT_STDDEF_H_ #endif /* @@ -64,7 +64,7 @@ /* Define this type if we are doing the whole job, or if we want this type * in particular. */ -#if defined (_STDDEF_H_) || defined (__need_ptrdiff_t) +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_ptrdiff_t) #ifndef _PTRDIFF_T_ #define _PTRDIFF_T_ @@ -77,7 +77,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; /* If this symbol has done its job, get rid of it. */ #undef __need_ptrdiff_t -#endif /* _STDDEF_H_ or __need_ptrdiff_t. */ +#endif /* __MSVCRT_STDDEF_H_ or __need_ptrdiff_t. */ /* * Unsigned type of `sizeof' something. @@ -86,7 +86,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; /* Define this type if we are doing the whole job, * or if we want this type in particular. */ -#if defined (_STDDEF_H_) || defined (__need_size_t) +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_size_t) #ifndef _SIZE_T_ #define _SIZE_T_ @@ -100,7 +100,7 @@ typedef __SIZE_TYPE__ size_t; #undef __need_size_t -#endif /* _STDDEF_H_ or __need_size_t. */ +#endif /* __MSVCRT_STDDEF_H_ or __need_size_t. */ /* Wide character type. Locale-writers should change this as necessary to @@ -109,7 +109,7 @@ typedef __SIZE_TYPE__ size_t; /* Define this type if we are doing the whole job, or if we want this type in particular. */ -#if defined (_STDDEF_H_) || defined (__need_wchar_t) +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_wchar_t) #ifndef _WCHAR_T_ #define _WCHAR_T_ @@ -125,12 +125,12 @@ typedef __WCHAR_TYPE__ wchar_t; #undef __need_wchar_t -#endif /* _STDDEF_H_ or __need_wchar_t. */ +#endif /* __MSVCRT_STDDEF_H_ or __need_wchar_t. */ /* * wint_t, the equivalent of int in wchar ctype functions. */ -#if defined (_STDDEF_H_) || defined (__need_wint_t) +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_wint_t) #ifndef _WINT_T_ #define _WINT_T_ @@ -144,18 +144,18 @@ typedef __WINT_TYPE__ wint_t; #undef __need_wint_t -#endif /* _STDDEF_H_ or __need_wint_t. */ +#endif /* __MSVCRT_STDDEF_H_ or __need_wint_t. */ /* * A null pointer constant. */ -#if defined (_STDDEF_H_) || defined (__need_NULL) +#if defined (__MSVCRT_STDDEF_H_) || defined (__need_NULL) #undef NULL #define NULL (0) -#endif /* _STDDEF_H_ or __need_NULL */ +#endif /* __MSVCRT_STDDEF_H_ or __need_NULL */ #undef __need_NULL @@ -166,9 +166,9 @@ typedef __WINT_TYPE__ wint_t; * zero. */ -#if defined (_STDDEF_H_) +#if defined (__MSVCRT_STDDEF_H_) #define offsetof(TYPE, MEMBER) ((size_t) &( ((TYPE *) 0)->MEMBER )) -#endif /* _STDDEF_H_ */ +#endif /* __MSVCRT_STDDEF_H_ */ -#endif /* not _STDDEF_H_ */ +#endif /* not __MSVCRT_STDDEF_H_ */ diff --git a/reactos/lib/crtdll/misc/setnew.cc b/reactos/lib/crtdll/misc/setnew.c similarity index 70% rename from reactos/lib/crtdll/misc/setnew.cc rename to reactos/lib/crtdll/misc/setnew.c index 78715bc7b8b..885bd3b9fe0 100644 --- a/reactos/lib/crtdll/misc/setnew.cc +++ b/reactos/lib/crtdll/misc/setnew.c @@ -6,7 +6,7 @@ typedef int (* new_handler_t)( size_t ); new_handler_t new_handler; #undef _set_new_handler -new_handler_t _set_new_handler(new_handler_t hnd) +new_handler_t _set_new_handler__FPFUi_i(new_handler_t hnd) { new_handler_t old = new_handler; @@ -16,14 +16,14 @@ new_handler_t _set_new_handler(new_handler_t hnd) } #undef delete -void operator delete(void* m) +void __builtin_delete (void* m) { if ( m != NULL ) free( m ); } #undef new -void * operator new( unsigned int s ) +void * __builtin_new (unsigned int s ) { return malloc( s ); } diff --git a/reactos/lib/crtdll/stdio/vfprintf.c b/reactos/lib/crtdll/stdio/vfprintf.c index b2f7365a820..e69ff17bd6c 100644 --- a/reactos/lib/crtdll/stdio/vfprintf.c +++ b/reactos/lib/crtdll/stdio/vfprintf.c @@ -598,7 +598,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args) while (--field_width > 0) putc(' ', f); if (qualifier == 'l' || qualifier == 'w') - putc((unsigned char) va_arg(args, wchar_t), f); + putc((unsigned char)(wchar_t) va_arg(args, int), f); else putc((unsigned char) va_arg(args, int), f); while (--field_width > 0) @@ -612,7 +612,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args) if (qualifier == 'h') putc((unsigned char) va_arg(args, int), f); else - putc((unsigned char) va_arg(args, wchar_t), f); + putc((unsigned char)(wchar_t) va_arg(args, int), f); while (--field_width > 0) putc(' ', f); continue; @@ -846,9 +846,9 @@ int __vfprintf(FILE *f, const char *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == 'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else if (flags & SIGN) num = va_arg(args, int); diff --git a/reactos/lib/crtdll/stdio/vfwprint.c b/reactos/lib/crtdll/stdio/vfwprint.c index d362fb580f5..e928f4f2e26 100644 --- a/reactos/lib/crtdll/stdio/vfwprint.c +++ b/reactos/lib/crtdll/stdio/vfwprint.c @@ -602,7 +602,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args) if (qualifier == L'h') putwc((wchar_t) va_arg(args, int), f); else - putwc((wchar_t) va_arg(args, wchar_t), f); + putwc((wchar_t) va_arg(args, int), f); while (--field_width > 0) putwc(L' ', f); continue; @@ -612,7 +612,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args) while (--field_width > 0) putwc(L' ', f); if (qualifier == L'l' || qualifier == L'w') - putwc((unsigned char) va_arg(args, wchar_t), f); + putwc((unsigned char)(wchar_t) va_arg(args, int), f); else putwc((unsigned char) va_arg(args, int), f); while (--field_width > 0) @@ -848,9 +848,9 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == L'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else if (flags & SIGN) num = va_arg(args, int); diff --git a/reactos/lib/msvcrt/stdio/vfprintf.c b/reactos/lib/msvcrt/stdio/vfprintf.c index b2f7365a820..e69ff17bd6c 100644 --- a/reactos/lib/msvcrt/stdio/vfprintf.c +++ b/reactos/lib/msvcrt/stdio/vfprintf.c @@ -598,7 +598,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args) while (--field_width > 0) putc(' ', f); if (qualifier == 'l' || qualifier == 'w') - putc((unsigned char) va_arg(args, wchar_t), f); + putc((unsigned char)(wchar_t) va_arg(args, int), f); else putc((unsigned char) va_arg(args, int), f); while (--field_width > 0) @@ -612,7 +612,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args) if (qualifier == 'h') putc((unsigned char) va_arg(args, int), f); else - putc((unsigned char) va_arg(args, wchar_t), f); + putc((unsigned char)(wchar_t) va_arg(args, int), f); while (--field_width > 0) putc(' ', f); continue; @@ -846,9 +846,9 @@ int __vfprintf(FILE *f, const char *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == 'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else if (flags & SIGN) num = va_arg(args, int); diff --git a/reactos/lib/msvcrt/stdio/vfwprint.c b/reactos/lib/msvcrt/stdio/vfwprint.c index d362fb580f5..37396285430 100644 --- a/reactos/lib/msvcrt/stdio/vfwprint.c +++ b/reactos/lib/msvcrt/stdio/vfwprint.c @@ -602,7 +602,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args) if (qualifier == L'h') putwc((wchar_t) va_arg(args, int), f); else - putwc((wchar_t) va_arg(args, wchar_t), f); + putwc((wchar_t) va_arg(args, int), f); while (--field_width > 0) putwc(L' ', f); continue; @@ -612,7 +612,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args) while (--field_width > 0) putwc(L' ', f); if (qualifier == L'l' || qualifier == L'w') - putwc((unsigned char) va_arg(args, wchar_t), f); + putwc((unsigned char) va_arg(args, int), f); else putwc((unsigned char) va_arg(args, int), f); while (--field_width > 0) @@ -848,9 +848,9 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == L'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else if (flags & SIGN) num = va_arg(args, int); diff --git a/reactos/lib/ntdll/stdio/sprintf.c b/reactos/lib/ntdll/stdio/sprintf.c index 445abfd18e4..4ce225e1b21 100644 --- a/reactos/lib/ntdll/stdio/sprintf.c +++ b/reactos/lib/ntdll/stdio/sprintf.c @@ -1,4 +1,4 @@ -/* $Id: sprintf.c,v 1.3 2000/02/27 15:43:58 ekohl Exp $ +/* $Id: sprintf.c,v 1.4 2001/02/19 15:04:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -213,7 +213,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) while (--field_width > 0) *str++ = ' '; if (qualifier == 'l' || qualifier == 'w') - *str++ = (unsigned char) va_arg(args, wchar_t); + *str++ = + (unsigned char)(wchar_t) va_arg(args, int); else *str++ = (unsigned char) va_arg(args, int); while (--field_width > 0) @@ -227,7 +228,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) if (qualifier == 'h') *str++ = (unsigned char) va_arg(args, int); else - *str++ = (unsigned char) va_arg(args, wchar_t); + *str++ = + (unsigned char)(wchar_t) va_arg(args, int); while (--field_width > 0) *str++ = ' '; continue; @@ -391,9 +393,9 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == 'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else { if (flags & SIGN) diff --git a/reactos/lib/ntdll/stdio/swprintf.c b/reactos/lib/ntdll/stdio/swprintf.c index 75cb70c9d83..ea19278647d 100644 --- a/reactos/lib/ntdll/stdio/swprintf.c +++ b/reactos/lib/ntdll/stdio/swprintf.c @@ -1,4 +1,4 @@ -/* $Id: swprintf.c,v 1.5 2000/02/27 15:43:58 ekohl Exp $ +/* $Id: swprintf.c,v 1.6 2001/02/19 15:04:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -228,7 +228,8 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) if (qualifier == 'h') *str++ = (wchar_t) va_arg(args, int); else - *str++ = (wchar_t) va_arg(args, wchar_t); + *str++ = + (wchar_t) va_arg(args, int); while (--field_width > 0) *str++ = L' '; continue; @@ -238,7 +239,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) while (--field_width > 0) *str++ = L' '; if (qualifier == 'l' || qualifier == 'w') - *str++ = (wchar_t) va_arg(args, wchar_t); + *str++ = (wchar_t) va_arg(args, int); else *str++ = (wchar_t) va_arg(args, int); while (--field_width > 0) @@ -404,9 +405,9 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == 'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else { if (flags & SIGN) diff --git a/reactos/lib/user32/graphics/icon.c b/reactos/lib/user32/graphics/icon.c index a66eeb16a2a..9f2cda55bea 100644 --- a/reactos/lib/user32/graphics/icon.c +++ b/reactos/lib/user32/graphics/icon.c @@ -146,28 +146,28 @@ HICON LoadStandardIcon(UINT IconId) HMODULE hModule = LoadLibraryA("user32.dll"); switch (IconId ) { - case IDI_APPLICATION: + case (UINT)IDI_APPLICATION: IconId = 100; return LoadIconW(hModule,(LPWSTR)IconId); break; - case IDI_ASTERISK: + case (UINT)IDI_ASTERISK: // IconId = 103; return LoadIconW(hModule,(LPWSTR)IconId); break; - case IDI_EXCLAMATION: + case (UINT)IDI_EXCLAMATION: IconId = 101; return LoadIconW(hModule,(LPWSTR)IconId); break; - case IDI_HAND: + case (UINT)IDI_HAND: // return LoadIconW(hModule,(LPWSTR)MAKEINTRESOURCE(104)); break; - case IDI_QUESTION: + case (UINT)IDI_QUESTION: IconId = 102; return LoadIconW(hModule,(LPWSTR)IconId); break; - case IDI_WINLOGO: + case (UINT)IDI_WINLOGO: IconId = 105; return LoadIconW(hModule,(LPWSTR)IconId); break; @@ -205,4 +205,4 @@ DrawFocusRect( CONST RECT * lprc) { return FALSE; -} \ No newline at end of file +} diff --git a/reactos/lib/user32/misc/sprintf.c b/reactos/lib/user32/misc/sprintf.c index 5ba5919de82..d0b830e0408 100644 --- a/reactos/lib/user32/misc/sprintf.c +++ b/reactos/lib/user32/misc/sprintf.c @@ -1,4 +1,4 @@ -/* $Id: sprintf.c,v 1.3 2000/04/12 22:40:42 ariadne Exp $ +/* $Id: sprintf.c,v 1.4 2001/02/19 15:04:51 dwelch Exp $ * * user32.dll * @@ -393,7 +393,7 @@ wvsnprintfA( switch (format.type) { case WPR_WCHAR: - if ((*p = (CHAR) va_arg( args, WCHAR ))) + if ((*p = (CHAR) (WCHAR) va_arg( args, int))) { p++; } @@ -408,7 +408,7 @@ wvsnprintfA( break; case WPR_CHAR: - if ((*p = va_arg( args, CHAR ))) + if ((*p = (CHAR) va_arg( args, int ))) { p++; } @@ -764,7 +764,7 @@ wvsnprintfW( switch (format.type) { case WPR_WCHAR: - if ((*p = va_arg( args, WCHAR ))) + if ((*p = (WCHAR) va_arg( args, int))) { p++; } @@ -779,7 +779,7 @@ wvsnprintfW( break; case WPR_CHAR: - if ((*p = (WCHAR) va_arg( args, CHAR ))) + if ((*p = (WCHAR)(CHAR) va_arg( args, int ))) { p++; } diff --git a/reactos/ntoskrnl/rtl/sprintf.c b/reactos/ntoskrnl/rtl/sprintf.c index cee03aa3614..b620f2d745b 100644 --- a/reactos/ntoskrnl/rtl/sprintf.c +++ b/reactos/ntoskrnl/rtl/sprintf.c @@ -1,4 +1,4 @@ -/* $Id: sprintf.c,v 1.3 2000/02/27 15:43:10 ekohl Exp $ +/* $Id: sprintf.c,v 1.4 2001/02/19 15:04:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -212,7 +212,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) while (--field_width > 0) *str++ = ' '; if (qualifier == 'l' || qualifier == 'w') - *str++ = (unsigned char) va_arg(args, wchar_t); + *str++ + = (unsigned char)(wchar_t) va_arg(args, int); else *str++ = (unsigned char) va_arg(args, int); while (--field_width > 0) @@ -226,7 +227,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) if (qualifier == 'h') *str++ = (unsigned char) va_arg(args, int); else - *str++ = (unsigned char) va_arg(args, wchar_t); + *str++ + = (unsigned char)(wchar_t) va_arg(args, int); while (--field_width > 0) *str++ = ' '; continue; @@ -390,9 +392,9 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == 'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else { if (flags & SIGN) diff --git a/reactos/ntoskrnl/rtl/stdlib.c b/reactos/ntoskrnl/rtl/stdlib.c index 752511404a9..6d47234a4d2 100644 --- a/reactos/ntoskrnl/rtl/stdlib.c +++ b/reactos/ntoskrnl/rtl/stdlib.c @@ -1,4 +1,4 @@ -/* $Id: stdlib.c,v 1.4 1999/12/30 14:37:54 ekohl Exp $ +/* $Id: stdlib.c,v 1.5 2001/02/19 15:04:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -256,4 +256,4 @@ size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count) return (size_t)Size; } -/* EOF */ \ No newline at end of file +/* EOF */ diff --git a/reactos/ntoskrnl/rtl/swprintf.c b/reactos/ntoskrnl/rtl/swprintf.c index 46e86085643..d4d12aead93 100644 --- a/reactos/ntoskrnl/rtl/swprintf.c +++ b/reactos/ntoskrnl/rtl/swprintf.c @@ -1,4 +1,4 @@ -/* $Id: swprintf.c,v 1.3 2000/02/27 15:43:10 ekohl Exp $ +/* $Id: swprintf.c,v 1.4 2001/02/19 15:04:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -228,7 +228,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) if (qualifier == 'h') *str++ = (wchar_t) va_arg(args, int); else - *str++ = (wchar_t) va_arg(args, wchar_t); + *str++ = (wchar_t) va_arg(args, int); while (--field_width > 0) *str++ = L' '; continue; @@ -238,7 +238,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) while (--field_width > 0) *str++ = L' '; if (qualifier == 'l' || qualifier == 'w') - *str++ = (wchar_t) va_arg(args, wchar_t); + *str++ = (wchar_t) va_arg(args, int); else *str++ = (wchar_t) va_arg(args, int); while (--field_width > 0) @@ -404,9 +404,9 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args) num = va_arg(args, unsigned long); else if (qualifier == 'h') { if (flags & SIGN) - num = va_arg(args, short); + num = va_arg(args, int); else - num = va_arg(args, unsigned short); + num = va_arg(args, unsigned int); } else { if (flags & SIGN) diff --git a/reactos/ntoskrnl/se/sid.c b/reactos/ntoskrnl/se/sid.c index a38fde00eb8..3d84bce1435 100644 --- a/reactos/ntoskrnl/se/sid.c +++ b/reactos/ntoskrnl/se/sid.c @@ -1,4 +1,4 @@ -/* $Id: sid.c,v 1.6 2000/10/08 19:12:01 ekohl Exp $ +/* $Id: sid.c,v 1.7 2001/02/19 15:04:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,6 +12,7 @@ /* INCLUDES *****************************************************************/ #include +#include #include diff --git a/reactos/rules.mak b/reactos/rules.mak index 67d7c94660e..a486b2d6f36 100644 --- a/reactos/rules.mak +++ b/reactos/rules.mak @@ -18,7 +18,7 @@ endif ifeq ($(HOST),mingw32-linux) NASM_FORMAT = win32 PREFIX = /usr/mingw32-cvs-000216/bin/mingw32-pc- -CPREFIX = i586-mingw32- +#PREFIX = i586-mingw32- #PREFIX = /usr/mingw32-cvs-000207/bin/mingw32-cvs-000207- EXE_POSTFIX = EXE_PREFIX = ./ @@ -49,8 +49,8 @@ FLOPPY_DIR = A: DIST_DIR = dist endif -CC = $(CPREFIX)gcc -CXX = $(CPREFIX)g++ +CC = $(PREFIX)gcc +CXX = $(PREFIX)g++ HOST_CC = gcc HOST_NM = nm CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe diff --git a/reactos/subsys/system/shell/makefile b/reactos/subsys/system/shell/makefile index ebd30d466b1..2364e4c2fd1 100644 --- a/reactos/subsys/system/shell/makefile +++ b/reactos/subsys/system/shell/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.2 2001/02/12 03:50:00 phreak Exp $ +# $Id: makefile,v 1.3 2001/02/19 15:04:50 dwelch Exp $ # # Shell: Simple shell application # @@ -18,7 +18,7 @@ BASE_CFLAGS = -I../../../include all: shell.exe shell.exe: $(OBJECTS) $(LIBS) - $(CC) $(OBJECTS) $(LIBS) -lgcc -o shell.exe + $(CC) $(OBJECTS) $(LIBS) -o shell.exe $(NM) --numeric-sort shell.exe > shell.sym clean: $(CLEAN_FILES:%=%_clean) @@ -40,3 +40,6 @@ $(PROGS:%=../../../$(DIST_DIR)/apps/%): ../../../$(DIST_DIR)/apps/%: % include $(PATH_TO_TOP)/rules.mak + + +