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
This commit is contained in:
David Welch 2001-02-19 15:04:51 +00:00
parent ac82b90278
commit 15445cf1c8
19 changed files with 106 additions and 97 deletions

View file

@ -4,7 +4,7 @@
#include <windows.h> #include <windows.h>
extern BOOL STDCALL GdiDllInitialize(PVOID hInstance, ULONG Event, PVOID Reserved); extern BOOL STDCALL GdiDllInitialize(HANDLE hInstance, DWORD Event, LPVOID Reserved);
int main (void) int main (void)
{ {

View file

@ -33,7 +33,7 @@ $(PROGS:%=../../$(DIST_DIR)/apps/%.exe): ../../$(DIST_DIR)/apps/%.exe: %.exe
$(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe $(CP) $*.exe ../../$(DIST_DIR)/apps/$*.exe
gditest.exe: gditest.c 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 $(NM) --numeric-sort gditest.exe > gditest.sym
include ../../rules.mak include ../../rules.mak

View file

@ -28,14 +28,14 @@
* DISCLAMED. This includes but is not limited to warranties of * DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Author: ariadne $ * $Author: dwelch $
* $Date: 1999/04/02 21:42:06 $ * $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 * 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) \ #if (!defined(__need_wchar_t) && !defined(__need_wint_t) \
&& !defined(__need_size_t) && !defined(__need_ptrdiff_t) \ && !defined(__need_size_t) && !defined(__need_ptrdiff_t) \
&& !defined(__need_NULL)) && !defined(__need_NULL))
#define _STDDEF_H_ #define __CRTDLL_STDDEF_H_
#endif #endif
/* /*
@ -64,7 +64,7 @@
/* Define this type if we are doing the whole job, or if we want this type /* Define this type if we are doing the whole job, or if we want this type
* in particular. */ * in particular. */
#if defined (_STDDEF_H_) || defined (__need_ptrdiff_t) #if defined (__CRTDLL_STDDEF_H_) || defined (__need_ptrdiff_t)
#ifndef _PTRDIFF_T_ #ifndef _PTRDIFF_T_
#define _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. */ /* If this symbol has done its job, get rid of it. */
#undef __need_ptrdiff_t #undef __need_ptrdiff_t
#endif /* _STDDEF_H_ or __need_ptrdiff_t. */ #endif /* __CRTDLL_STDDEF_H_ or __need_ptrdiff_t. */
/* /*
* Unsigned type of `sizeof' something. * Unsigned type of `sizeof' something.
@ -86,7 +86,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
/* Define this type if we are doing the whole job, /* Define this type if we are doing the whole job,
* or if we want this type in particular. */ * 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_ #ifndef _SIZE_T_
#define _SIZE_T_ #define _SIZE_T_
@ -100,7 +100,7 @@ typedef __SIZE_TYPE__ size_t;
#undef __need_size_t #undef __need_size_t
#endif /* _STDDEF_H_ or __need_size_t. */ #endif /* __CRTDLL_STDDEF_H_ or __need_size_t. */
/* Wide character type. /* Wide character type.
Locale-writers should change this as necessary to 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, /* Define this type if we are doing the whole job,
or if we want this type in particular. */ 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_ #ifndef _WCHAR_T_
#define _WCHAR_T_ #define _WCHAR_T_
@ -124,12 +124,12 @@ typedef __WCHAR_TYPE__ wchar_t;
#undef __need_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. * 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_ #ifndef _WINT_T_
#define _WINT_T_ #define _WINT_T_
@ -143,18 +143,18 @@ typedef __WINT_TYPE__ wint_t;
#undef __need_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. * A null pointer constant.
*/ */
#if defined (_STDDEF_H_) || defined (__need_NULL) #if defined (__CRTDLL_STDDEF_H_) || defined (__need_NULL)
#undef NULL #undef NULL
#define NULL (0) #define NULL (0)
#endif /* _STDDEF_H_ or __need_NULL */ #endif /* __CRTDLL_STDDEF_H_ or __need_NULL */
#undef __need_NULL #undef __need_NULL
@ -165,9 +165,9 @@ typedef __WINT_TYPE__ wint_t;
* zero. * zero.
*/ */
#if defined (_STDDEF_H_) #if defined (__CRTDLL_STDDEF_H_)
#define offsetof(TYPE, MEMBER) ((size_t) &( ((TYPE *) 0)->MEMBER )) #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_ */

View file

@ -28,14 +28,14 @@
* DISCLAMED. This includes but is not limited to warranties of * DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: ekohl $ * $Author: dwelch $
* $Date: 2000/12/03 17:49:21 $ * $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 * 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) \ #if (!defined(__need_wchar_t) && !defined(__need_wint_t) \
&& !defined(__need_size_t) && !defined(__need_ptrdiff_t) \ && !defined(__need_size_t) && !defined(__need_ptrdiff_t) \
&& !defined(__need_NULL)) && !defined(__need_NULL))
#define _STDDEF_H_ #define __MSVCRT_STDDEF_H_
#endif #endif
/* /*
@ -64,7 +64,7 @@
/* Define this type if we are doing the whole job, or if we want this type /* Define this type if we are doing the whole job, or if we want this type
* in particular. */ * in particular. */
#if defined (_STDDEF_H_) || defined (__need_ptrdiff_t) #if defined (__MSVCRT_STDDEF_H_) || defined (__need_ptrdiff_t)
#ifndef _PTRDIFF_T_ #ifndef _PTRDIFF_T_
#define _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. */ /* If this symbol has done its job, get rid of it. */
#undef __need_ptrdiff_t #undef __need_ptrdiff_t
#endif /* _STDDEF_H_ or __need_ptrdiff_t. */ #endif /* __MSVCRT_STDDEF_H_ or __need_ptrdiff_t. */
/* /*
* Unsigned type of `sizeof' something. * Unsigned type of `sizeof' something.
@ -86,7 +86,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
/* Define this type if we are doing the whole job, /* Define this type if we are doing the whole job,
* or if we want this type in particular. */ * 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_ #ifndef _SIZE_T_
#define _SIZE_T_ #define _SIZE_T_
@ -100,7 +100,7 @@ typedef __SIZE_TYPE__ size_t;
#undef __need_size_t #undef __need_size_t
#endif /* _STDDEF_H_ or __need_size_t. */ #endif /* __MSVCRT_STDDEF_H_ or __need_size_t. */
/* Wide character type. /* Wide character type.
Locale-writers should change this as necessary to 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, /* Define this type if we are doing the whole job,
or if we want this type in particular. */ 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_ #ifndef _WCHAR_T_
#define _WCHAR_T_ #define _WCHAR_T_
@ -125,12 +125,12 @@ typedef __WCHAR_TYPE__ wchar_t;
#undef __need_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. * 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_ #ifndef _WINT_T_
#define _WINT_T_ #define _WINT_T_
@ -144,18 +144,18 @@ typedef __WINT_TYPE__ wint_t;
#undef __need_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. * A null pointer constant.
*/ */
#if defined (_STDDEF_H_) || defined (__need_NULL) #if defined (__MSVCRT_STDDEF_H_) || defined (__need_NULL)
#undef NULL #undef NULL
#define NULL (0) #define NULL (0)
#endif /* _STDDEF_H_ or __need_NULL */ #endif /* __MSVCRT_STDDEF_H_ or __need_NULL */
#undef __need_NULL #undef __need_NULL
@ -166,9 +166,9 @@ typedef __WINT_TYPE__ wint_t;
* zero. * zero.
*/ */
#if defined (_STDDEF_H_) #if defined (__MSVCRT_STDDEF_H_)
#define offsetof(TYPE, MEMBER) ((size_t) &( ((TYPE *) 0)->MEMBER )) #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_ */

View file

@ -6,7 +6,7 @@ typedef int (* new_handler_t)( size_t );
new_handler_t new_handler; new_handler_t new_handler;
#undef _set_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; new_handler_t old = new_handler;
@ -16,14 +16,14 @@ new_handler_t _set_new_handler(new_handler_t hnd)
} }
#undef delete #undef delete
void operator delete(void* m) void __builtin_delete (void* m)
{ {
if ( m != NULL ) if ( m != NULL )
free( m ); free( m );
} }
#undef new #undef new
void * operator new( unsigned int s ) void * __builtin_new (unsigned int s )
{ {
return malloc( s ); return malloc( s );
} }

View file

@ -598,7 +598,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
putc(' ', f); putc(' ', f);
if (qualifier == 'l' || qualifier == 'w') 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 else
putc((unsigned char) va_arg(args, int), f); putc((unsigned char) va_arg(args, int), f);
while (--field_width > 0) while (--field_width > 0)
@ -612,7 +612,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
if (qualifier == 'h') if (qualifier == 'h')
putc((unsigned char) va_arg(args, int), f); putc((unsigned char) va_arg(args, int), f);
else else
putc((unsigned char) va_arg(args, wchar_t), f); putc((unsigned char)(wchar_t) va_arg(args, int), f);
while (--field_width > 0) while (--field_width > 0)
putc(' ', f); putc(' ', f);
continue; continue;
@ -846,9 +846,9 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
num = va_arg(args, unsigned long); num = va_arg(args, unsigned long);
else if (qualifier == 'h') { else if (qualifier == 'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else if (flags & SIGN) else if (flags & SIGN)
num = va_arg(args, int); num = va_arg(args, int);

View file

@ -602,7 +602,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
if (qualifier == L'h') if (qualifier == L'h')
putwc((wchar_t) va_arg(args, int), f); putwc((wchar_t) va_arg(args, int), f);
else else
putwc((wchar_t) va_arg(args, wchar_t), f); putwc((wchar_t) va_arg(args, int), f);
while (--field_width > 0) while (--field_width > 0)
putwc(L' ', f); putwc(L' ', f);
continue; continue;
@ -612,7 +612,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
putwc(L' ', f); putwc(L' ', f);
if (qualifier == L'l' || qualifier == L'w') 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 else
putwc((unsigned char) va_arg(args, int), f); putwc((unsigned char) va_arg(args, int), f);
while (--field_width > 0) 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); num = va_arg(args, unsigned long);
else if (qualifier == L'h') { else if (qualifier == L'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else if (flags & SIGN) else if (flags & SIGN)
num = va_arg(args, int); num = va_arg(args, int);

View file

@ -598,7 +598,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
putc(' ', f); putc(' ', f);
if (qualifier == 'l' || qualifier == 'w') 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 else
putc((unsigned char) va_arg(args, int), f); putc((unsigned char) va_arg(args, int), f);
while (--field_width > 0) while (--field_width > 0)
@ -612,7 +612,7 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
if (qualifier == 'h') if (qualifier == 'h')
putc((unsigned char) va_arg(args, int), f); putc((unsigned char) va_arg(args, int), f);
else else
putc((unsigned char) va_arg(args, wchar_t), f); putc((unsigned char)(wchar_t) va_arg(args, int), f);
while (--field_width > 0) while (--field_width > 0)
putc(' ', f); putc(' ', f);
continue; continue;
@ -846,9 +846,9 @@ int __vfprintf(FILE *f, const char *fmt, va_list args)
num = va_arg(args, unsigned long); num = va_arg(args, unsigned long);
else if (qualifier == 'h') { else if (qualifier == 'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else if (flags & SIGN) else if (flags & SIGN)
num = va_arg(args, int); num = va_arg(args, int);

View file

@ -602,7 +602,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
if (qualifier == L'h') if (qualifier == L'h')
putwc((wchar_t) va_arg(args, int), f); putwc((wchar_t) va_arg(args, int), f);
else else
putwc((wchar_t) va_arg(args, wchar_t), f); putwc((wchar_t) va_arg(args, int), f);
while (--field_width > 0) while (--field_width > 0)
putwc(L' ', f); putwc(L' ', f);
continue; continue;
@ -612,7 +612,7 @@ int __vfwprintf(FILE *f, const wchar_t *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
putwc(L' ', f); putwc(L' ', f);
if (qualifier == L'l' || qualifier == L'w') 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 else
putwc((unsigned char) va_arg(args, int), f); putwc((unsigned char) va_arg(args, int), f);
while (--field_width > 0) 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); num = va_arg(args, unsigned long);
else if (qualifier == L'h') { else if (qualifier == L'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else if (flags & SIGN) else if (flags & SIGN)
num = va_arg(args, int); num = va_arg(args, int);

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -213,7 +213,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
*str++ = ' '; *str++ = ' ';
if (qualifier == 'l' || qualifier == 'w') if (qualifier == 'l' || qualifier == 'w')
*str++ = (unsigned char) va_arg(args, wchar_t); *str++ =
(unsigned char)(wchar_t) va_arg(args, int);
else else
*str++ = (unsigned char) va_arg(args, int); *str++ = (unsigned char) va_arg(args, int);
while (--field_width > 0) while (--field_width > 0)
@ -227,7 +228,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
if (qualifier == 'h') if (qualifier == 'h')
*str++ = (unsigned char) va_arg(args, int); *str++ = (unsigned char) va_arg(args, int);
else else
*str++ = (unsigned char) va_arg(args, wchar_t); *str++ =
(unsigned char)(wchar_t) va_arg(args, int);
while (--field_width > 0) while (--field_width > 0)
*str++ = ' '; *str++ = ' ';
continue; continue;
@ -391,9 +393,9 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
num = va_arg(args, unsigned long); num = va_arg(args, unsigned long);
else if (qualifier == 'h') { else if (qualifier == 'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else { else {
if (flags & SIGN) if (flags & SIGN)

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * 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') if (qualifier == 'h')
*str++ = (wchar_t) va_arg(args, int); *str++ = (wchar_t) va_arg(args, int);
else else
*str++ = (wchar_t) va_arg(args, wchar_t); *str++ =
(wchar_t) va_arg(args, int);
while (--field_width > 0) while (--field_width > 0)
*str++ = L' '; *str++ = L' ';
continue; continue;
@ -238,7 +239,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
*str++ = L' '; *str++ = L' ';
if (qualifier == 'l' || qualifier == 'w') if (qualifier == 'l' || qualifier == 'w')
*str++ = (wchar_t) va_arg(args, wchar_t); *str++ = (wchar_t) va_arg(args, int);
else else
*str++ = (wchar_t) va_arg(args, int); *str++ = (wchar_t) va_arg(args, int);
while (--field_width > 0) 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); num = va_arg(args, unsigned long);
else if (qualifier == 'h') { else if (qualifier == 'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else { else {
if (flags & SIGN) if (flags & SIGN)

View file

@ -146,28 +146,28 @@ HICON LoadStandardIcon(UINT IconId)
HMODULE hModule = LoadLibraryA("user32.dll"); HMODULE hModule = LoadLibraryA("user32.dll");
switch (IconId ) switch (IconId )
{ {
case IDI_APPLICATION: case (UINT)IDI_APPLICATION:
IconId = 100; IconId = 100;
return LoadIconW(hModule,(LPWSTR)IconId); return LoadIconW(hModule,(LPWSTR)IconId);
break; break;
case IDI_ASTERISK: case (UINT)IDI_ASTERISK:
// //
IconId = 103; IconId = 103;
return LoadIconW(hModule,(LPWSTR)IconId); return LoadIconW(hModule,(LPWSTR)IconId);
break; break;
case IDI_EXCLAMATION: case (UINT)IDI_EXCLAMATION:
IconId = 101; IconId = 101;
return LoadIconW(hModule,(LPWSTR)IconId); return LoadIconW(hModule,(LPWSTR)IconId);
break; break;
case IDI_HAND: case (UINT)IDI_HAND:
// //
return LoadIconW(hModule,(LPWSTR)MAKEINTRESOURCE(104)); return LoadIconW(hModule,(LPWSTR)MAKEINTRESOURCE(104));
break; break;
case IDI_QUESTION: case (UINT)IDI_QUESTION:
IconId = 102; IconId = 102;
return LoadIconW(hModule,(LPWSTR)IconId); return LoadIconW(hModule,(LPWSTR)IconId);
break; break;
case IDI_WINLOGO: case (UINT)IDI_WINLOGO:
IconId = 105; IconId = 105;
return LoadIconW(hModule,(LPWSTR)IconId); return LoadIconW(hModule,(LPWSTR)IconId);
break; break;

View file

@ -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 * user32.dll
* *
@ -393,7 +393,7 @@ wvsnprintfA(
switch (format.type) switch (format.type)
{ {
case WPR_WCHAR: case WPR_WCHAR:
if ((*p = (CHAR) va_arg( args, WCHAR ))) if ((*p = (CHAR) (WCHAR) va_arg( args, int)))
{ {
p++; p++;
} }
@ -408,7 +408,7 @@ wvsnprintfA(
break; break;
case WPR_CHAR: case WPR_CHAR:
if ((*p = va_arg( args, CHAR ))) if ((*p = (CHAR) va_arg( args, int )))
{ {
p++; p++;
} }
@ -764,7 +764,7 @@ wvsnprintfW(
switch (format.type) switch (format.type)
{ {
case WPR_WCHAR: case WPR_WCHAR:
if ((*p = va_arg( args, WCHAR ))) if ((*p = (WCHAR) va_arg( args, int)))
{ {
p++; p++;
} }
@ -779,7 +779,7 @@ wvsnprintfW(
break; break;
case WPR_CHAR: case WPR_CHAR:
if ((*p = (WCHAR) va_arg( args, CHAR ))) if ((*p = (WCHAR)(CHAR) va_arg( args, int )))
{ {
p++; p++;
} }

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -212,7 +212,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
*str++ = ' '; *str++ = ' ';
if (qualifier == 'l' || qualifier == 'w') if (qualifier == 'l' || qualifier == 'w')
*str++ = (unsigned char) va_arg(args, wchar_t); *str++
= (unsigned char)(wchar_t) va_arg(args, int);
else else
*str++ = (unsigned char) va_arg(args, int); *str++ = (unsigned char) va_arg(args, int);
while (--field_width > 0) while (--field_width > 0)
@ -226,7 +227,8 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
if (qualifier == 'h') if (qualifier == 'h')
*str++ = (unsigned char) va_arg(args, int); *str++ = (unsigned char) va_arg(args, int);
else else
*str++ = (unsigned char) va_arg(args, wchar_t); *str++
= (unsigned char)(wchar_t) va_arg(args, int);
while (--field_width > 0) while (--field_width > 0)
*str++ = ' '; *str++ = ' ';
continue; continue;
@ -390,9 +392,9 @@ int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
num = va_arg(args, unsigned long); num = va_arg(args, unsigned long);
else if (qualifier == 'h') { else if (qualifier == 'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else { else {
if (flags & SIGN) if (flags & SIGN)

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * 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') if (qualifier == 'h')
*str++ = (wchar_t) va_arg(args, int); *str++ = (wchar_t) va_arg(args, int);
else else
*str++ = (wchar_t) va_arg(args, wchar_t); *str++ = (wchar_t) va_arg(args, int);
while (--field_width > 0) while (--field_width > 0)
*str++ = L' '; *str++ = L' ';
continue; continue;
@ -238,7 +238,7 @@ int _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list args)
while (--field_width > 0) while (--field_width > 0)
*str++ = L' '; *str++ = L' ';
if (qualifier == 'l' || qualifier == 'w') if (qualifier == 'l' || qualifier == 'w')
*str++ = (wchar_t) va_arg(args, wchar_t); *str++ = (wchar_t) va_arg(args, int);
else else
*str++ = (wchar_t) va_arg(args, int); *str++ = (wchar_t) va_arg(args, int);
while (--field_width > 0) 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); num = va_arg(args, unsigned long);
else if (qualifier == 'h') { else if (qualifier == 'h') {
if (flags & SIGN) if (flags & SIGN)
num = va_arg(args, short); num = va_arg(args, int);
else else
num = va_arg(args, unsigned short); num = va_arg(args, unsigned int);
} }
else { else {
if (flags & SIGN) if (flags & SIGN)

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -12,6 +12,7 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <string.h>
#include <internal/debug.h> #include <internal/debug.h>

View file

@ -18,7 +18,7 @@ endif
ifeq ($(HOST),mingw32-linux) ifeq ($(HOST),mingw32-linux)
NASM_FORMAT = win32 NASM_FORMAT = win32
PREFIX = /usr/mingw32-cvs-000216/bin/mingw32-pc- PREFIX = /usr/mingw32-cvs-000216/bin/mingw32-pc-
CPREFIX = i586-mingw32- #PREFIX = i586-mingw32-
#PREFIX = /usr/mingw32-cvs-000207/bin/mingw32-cvs-000207- #PREFIX = /usr/mingw32-cvs-000207/bin/mingw32-cvs-000207-
EXE_POSTFIX = EXE_POSTFIX =
EXE_PREFIX = ./ EXE_PREFIX = ./
@ -49,8 +49,8 @@ FLOPPY_DIR = A:
DIST_DIR = dist DIST_DIR = dist
endif endif
CC = $(CPREFIX)gcc CC = $(PREFIX)gcc
CXX = $(CPREFIX)g++ CXX = $(PREFIX)g++
HOST_CC = gcc HOST_CC = gcc
HOST_NM = nm HOST_NM = nm
CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe CFLAGS := $(CFLAGS) -I$(PATH_TO_TOP)/include -pipe

View file

@ -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 # Shell: Simple shell application
# #
@ -18,7 +18,7 @@ BASE_CFLAGS = -I../../../include
all: shell.exe all: shell.exe
shell.exe: $(OBJECTS) $(LIBS) shell.exe: $(OBJECTS) $(LIBS)
$(CC) $(OBJECTS) $(LIBS) -lgcc -o shell.exe $(CC) $(OBJECTS) $(LIBS) -o shell.exe
$(NM) --numeric-sort shell.exe > shell.sym $(NM) --numeric-sort shell.exe > shell.sym
clean: $(CLEAN_FILES:%=%_clean) clean: $(CLEAN_FILES:%=%_clean)
@ -40,3 +40,6 @@ $(PROGS:%=../../../$(DIST_DIR)/apps/%): ../../../$(DIST_DIR)/apps/%: %
include $(PATH_TO_TOP)/rules.mak include $(PATH_TO_TOP)/rules.mak