Sprinkle cdecl declarations liberally all around to make a bunch of the base components compile (freeldr compiles but does not link yet). Some of these should really be NTAPI, working on that.

svn path=/trunk/; revision=69238
This commit is contained in:
Stefan Ginsberg 2015-09-15 10:35:49 +00:00
parent 823e30d4bc
commit 2d55091cc2
60 changed files with 139 additions and 88 deletions

View file

@ -80,7 +80,7 @@ int __cdecl mbtowc(wchar_t *wchar, const char *mbchar, size_t count)
} }
// The wctype table is 144 KB, too much for poor freeldr // The wctype table is 144 KB, too much for poor freeldr
int iswctype(wint_t wc, wctype_t wctypeFlags) int __cdecl iswctype(wint_t wc, wctype_t wctypeFlags)
{ {
return _isctype((char)wc, wctypeFlags); return _isctype((char)wc, wctypeFlags);
} }

View file

@ -16,7 +16,7 @@
#include <debug.h> #include <debug.h>
#include "apic.h" #include "apic.h"
void HackEoi(void); void __cdecl HackEoi(void);
#ifndef _M_AMD64 #ifndef _M_AMD64
#define APIC_LAZY_IRQL #define APIC_LAZY_IRQL

View file

@ -276,5 +276,5 @@ VOID
NTAPI NTAPI
ApicInitializeTimer(ULONG Cpu); ApicInitializeTimer(ULONG Cpu);
VOID ApicSpuriousService(VOID); VOID __cdecl ApicSpuriousService(VOID);

View file

@ -5,7 +5,7 @@
#ifndef __ASM__ #ifndef __ASM__
void TscCalibrationISR(void); void __cdecl TscCalibrationISR(void);
extern LARGE_INTEGER HalpCpuClockFrequency; extern LARGE_INTEGER HalpCpuClockFrequency;
VOID NTAPI HalpInitializeTsc(); VOID NTAPI HalpInitializeTsc();

View file

@ -14,7 +14,7 @@
#include <debug.h> #include <debug.h>
#include <setjmp.h> #include <setjmp.h>
void HalpTrap0D(); void __cdecl HalpTrap0D();
/* GLOBALS ********************************************************************/ /* GLOBALS ********************************************************************/

View file

@ -42,7 +42,7 @@ typedef struct _HAL_BIOS_FRAME
typedef typedef
VOID VOID
(*PHAL_SW_INTERRUPT_HANDLER)( (__cdecl *PHAL_SW_INTERRUPT_HANDLER)(
VOID VOID
); );
@ -501,6 +501,7 @@ HalpDismissIrq07Level(
); );
VOID VOID
__cdecl
HalpHardwareInterruptLevel( HalpHardwareInterruptLevel(
VOID VOID
); );
@ -575,9 +576,9 @@ HalpEnableInterruptHandler(IN UCHAR Flags,
/* pic.c */ /* pic.c */
VOID NTAPI HalpInitializePICs(IN BOOLEAN EnableInterrupts); VOID NTAPI HalpInitializePICs(IN BOOLEAN EnableInterrupts);
VOID HalpApcInterrupt(VOID); VOID __cdecl HalpApcInterrupt(VOID);
VOID HalpDispatchInterrupt(VOID); VOID __cdecl HalpDispatchInterrupt(VOID);
VOID HalpDispatchInterrupt2(VOID); VOID __cdecl HalpDispatchInterrupt2(VOID);
DECLSPEC_NORETURN VOID FASTCALL HalpApcInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame); DECLSPEC_NORETURN VOID FASTCALL HalpApcInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame);
DECLSPEC_NORETURN VOID FASTCALL HalpDispatchInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame); DECLSPEC_NORETURN VOID FASTCALL HalpDispatchInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame);
@ -586,8 +587,8 @@ extern BOOLEAN HalpProfilingStopped;
/* timer.c */ /* timer.c */
VOID NTAPI HalpInitializeClock(VOID); VOID NTAPI HalpInitializeClock(VOID);
VOID HalpClockInterrupt(VOID); VOID __cdecl HalpClockInterrupt(VOID);
VOID HalpProfileInterrupt(VOID); VOID __cdecl HalpProfileInterrupt(VOID);
VOID VOID
NTAPI NTAPI
@ -695,7 +696,7 @@ HalpExitToV86(
); );
VOID VOID
DECLSPEC_NORETURN __cdecl
HalpRealModeStart( HalpRealModeStart(
VOID VOID
); );

View file

@ -330,8 +330,9 @@ KIRQL SWInterruptLookUpTable[8] =
#if defined(__GNUC__) #if defined(__GNUC__)
#define HalpDelayedHardwareInterrupt(x) \ #define HalpDelayedHardwareInterrupt(x) \
VOID HalpHardwareInterrupt##x(VOID); \ VOID __cdecl HalpHardwareInterrupt##x(VOID); \
VOID \ VOID \
__cdecl \
HalpHardwareInterrupt##x(VOID) \ HalpHardwareInterrupt##x(VOID) \
{ \ { \
asm volatile ("int $%c0\n"::"i"(PRIMARY_VECTOR_BASE + x)); \ asm volatile ("int $%c0\n"::"i"(PRIMARY_VECTOR_BASE + x)); \
@ -340,8 +341,9 @@ KIRQL SWInterruptLookUpTable[8] =
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define HalpDelayedHardwareInterrupt(x) \ #define HalpDelayedHardwareInterrupt(x) \
VOID HalpHardwareInterrupt##x(VOID); \ VOID __cdecl HalpHardwareInterrupt##x(VOID); \
VOID \ VOID \
__cdecl \
HalpHardwareInterrupt##x(VOID) \ HalpHardwareInterrupt##x(VOID) \
{ \ { \
__asm \ __asm \
@ -375,10 +377,10 @@ HalpDelayedHardwareInterrupt(15);
/* Handlers for pending interrupts */ /* Handlers for pending interrupts */
PHAL_SW_INTERRUPT_HANDLER SWInterruptHandlerTable[20] = PHAL_SW_INTERRUPT_HANDLER SWInterruptHandlerTable[20] =
{ {
KiUnexpectedInterrupt, (PHAL_SW_INTERRUPT_HANDLER)KiUnexpectedInterrupt,
HalpApcInterrupt, HalpApcInterrupt,
HalpDispatchInterrupt2, HalpDispatchInterrupt2,
KiUnexpectedInterrupt, (PHAL_SW_INTERRUPT_HANDLER)KiUnexpectedInterrupt,
HalpHardwareInterrupt0, HalpHardwareInterrupt0,
HalpHardwareInterrupt1, HalpHardwareInterrupt1,
HalpHardwareInterrupt2, HalpHardwareInterrupt2,
@ -1067,6 +1069,7 @@ HalpDismissIrq07Level(IN KIRQL Irql,
} }
VOID VOID
__cdecl
HalpHardwareInterruptLevel(VOID) HalpHardwareInterruptLevel(VOID)
{ {
PKPCR Pcr = KeGetPcr(); PKPCR Pcr = KeGetPcr();
@ -1347,6 +1350,7 @@ HalpDispatchInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame)
} }
VOID VOID
__cdecl
HalpDispatchInterrupt2(VOID) HalpDispatchInterrupt2(VOID)
{ {
ULONG PendingIrqlMask, PendingIrql; ULONG PendingIrqlMask, PendingIrql;

View file

@ -299,7 +299,7 @@ void __fastfail(unsigned int Code)
#pragma intrinsic(__readcr3) #pragma intrinsic(__readcr3)
//#pragma intrinsic(__readcr4) //#pragma intrinsic(__readcr4)
// HACK: MSVC is broken // HACK: MSVC is broken
unsigned long ___readcr4(void); unsigned long __cdecl ___readcr4(void);
#define __readcr4 ___readcr4 #define __readcr4 ___readcr4
#pragma intrinsic(__readcr8) #pragma intrinsic(__readcr8)
#pragma intrinsic(__readdr) #pragma intrinsic(__readdr)

View file

@ -2450,6 +2450,7 @@ __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_T
_In_ size_t _N); _In_ size_t _N);
int int
__cdecl
wmemcmp( wmemcmp(
_In_reads_(_N) const wchar_t *_S1, _In_reads_(_N) const wchar_t *_S1,
_In_reads_(_N) const wchar_t *_S2, _In_reads_(_N) const wchar_t *_S2,

View file

@ -188,7 +188,9 @@ KiCoprocessorError(
VOID VOID
); );
DECLSPEC_NORETURN
VOID VOID
__cdecl
KiUnexpectedInterrupt( KiUnexpectedInterrupt(
VOID VOID
); );

View file

@ -9,24 +9,24 @@
#include "debug.c" #include "debug.c"
__MINGW_ATTRIB_MALLOC __MINGW_ATTRIB_MALLOC
void *malloc(size_t size) void * __cdecl malloc(size_t size)
{ {
return LocalAlloc(0, size); return LocalAlloc(0, size);
} }
void free(void *ptr) void __cdecl free(void *ptr)
{ {
LocalFree(ptr); LocalFree(ptr);
} }
void *realloc(void *ptr, size_t size) void * __cdecl realloc(void *ptr, size_t size)
{ {
if (ptr == NULL) return malloc(size); if (ptr == NULL) return malloc(size);
return LocalReAlloc(ptr, size, LMEM_MOVEABLE); return LocalReAlloc(ptr, size, LMEM_MOVEABLE);
} }
__MINGW_ATTRIB_MALLOC __MINGW_ATTRIB_MALLOC
char *_strdup(const char *str) char * __cdecl _strdup(const char *str)
{ {
char *newstr = malloc(strlen(str) + 1); char *newstr = malloc(strlen(str) + 1);
if (newstr) strcpy(newstr, str); if (newstr) strcpy(newstr, str);

View file

@ -26,7 +26,7 @@
/* /*
* @implemented * @implemented
*/ */
int _isnan(double __x) int CDECL _isnan(double __x)
{ {
union union
{ {
@ -40,7 +40,7 @@ int _isnan(double __x)
/* /*
* @implemented * @implemented
*/ */
int _finite(double __x) int CDECL _finite(double __x)
{ {
union union
{ {

View file

@ -9,6 +9,7 @@
* @implemented * @implemented
*/ */
int int
__cdecl
abs(int j) abs(int j)
{ {
return j<0 ? -j : j; return j<0 ? -j : j;

View file

@ -5,6 +5,7 @@
* @implemented * @implemented
*/ */
div_t div_t
CDECL
div(int num, int denom) div(int num, int denom)
{ {
div_t r; div_t r;

View file

@ -9,7 +9,7 @@ static unsigned __int64 next = 0;
/* /*
* @implemented * @implemented
*/ */
int rand(void) int __cdecl rand(void)
{ {
#if defined(__GNUC__) #if defined(__GNUC__)
next = next * 0x5deece66dLL + 11; next = next * 0x5deece66dLL + 11;
@ -23,7 +23,7 @@ int rand(void)
/* /*
* @implemented * @implemented
*/ */
void srand(unsigned seed) void __cdecl srand(unsigned seed)
{ {
next = seed; next = seed;
} }

View file

@ -22,7 +22,7 @@ int isleadbyte(int byte);
/* /*
* @implemented * @implemented
*/ */
size_t _mbstrlen( const char *str ) size_t __cdecl _mbstrlen( const char *str )
{ {
size_t len = 0; size_t len = 0;
while(*str) while(*str)

View file

@ -3,6 +3,7 @@
void * void *
__cdecl
_memccpy (void *to, const void *from,int c,size_t count) _memccpy (void *to, const void *from,int c,size_t count)
{ {
char t; char t;

View file

@ -5,7 +5,7 @@
#pragma function(memchr) #pragma function(memchr)
#endif /* _MSC_VER */ #endif /* _MSC_VER */
void* memchr(const void *s, int c, size_t n) void* __cdecl memchr(const void *s, int c, size_t n)
{ {
if (n) if (n)
{ {

View file

@ -6,7 +6,7 @@
#pragma function(memcmp) #pragma function(memcmp)
#endif #endif
int memcmp(const void *s1, const void *s2, size_t n) int __cdecl memcmp(const void *s1, const void *s2, size_t n)
{ {
if (n != 0) { if (n != 0) {
const unsigned char *p1 = s1, *p2 = s2; const unsigned char *p1 = s1, *p2 = s2;

View file

@ -5,7 +5,7 @@
#endif /* _MSC_VER */ #endif /* _MSC_VER */
/* NOTE: This code is a duplicate of memmove implementation! */ /* NOTE: This code is a duplicate of memmove implementation! */
void* memcpy(void* dest, const void* src, size_t count) void* __cdecl memcpy(void* dest, const void* src, size_t count)
{ {
char *char_dest = (char *)dest; char *char_dest = (char *)dest;
char *char_src = (char *)src; char *char_src = (char *)src;

View file

@ -5,6 +5,7 @@
* @implemented * @implemented
*/ */
int int
CDECL
_memicmp(const void *s1, const void *s2, size_t n) _memicmp(const void *s1, const void *s2, size_t n)
{ {
if (n != 0) if (n != 0)

View file

@ -1,7 +1,7 @@
#include <string.h> #include <string.h>
/* NOTE: This code is duplicated in memcpy function */ /* NOTE: This code is duplicated in memcpy function */
void * memmove(void *dest,const void *src,size_t count) void * __cdecl memmove(void *dest,const void *src,size_t count)
{ {
char *char_dest = (char *)dest; char *char_dest = (char *)dest;
char *char_src = (char *)src; char *char_src = (char *)src;

View file

@ -5,7 +5,7 @@
#pragma function(memset) #pragma function(memset)
#endif /* _MSC_VER */ #endif /* _MSC_VER */
void* memset(void* src, int val, size_t count) void* __cdecl memset(void* src, int val, size_t count)
{ {
char *char_src = (char *)src; char *char_src = (char *)src;

View file

@ -36,6 +36,14 @@
#include <winuser.h> #include <winuser.h>
#include <ndk/rtlfuncs.h> #include <ndk/rtlfuncs.h>
// Our headers are pretty messed up
#undef CDECL
#if defined(_M_IX86)
#define CDECL __cdecl
#else
#define CDECL
#endif
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
#include <stdint.h> #include <stdint.h>
#endif #endif

View file

@ -15,6 +15,7 @@
int __cdecl wstreamout(FILE *stream, const wchar_t *format, va_list argptr); int __cdecl wstreamout(FILE *stream, const wchar_t *format, va_list argptr);
int int
__cdecl
_vscwprintf( _vscwprintf(
const wchar_t *format, const wchar_t *format,
va_list argptr) va_list argptr)

View file

@ -5,6 +5,7 @@
* @implemented * @implemented
*/ */
void * void *
__cdecl
bsearch(const void *key, const void *base0, size_t nelem, bsearch(const void *key, const void *base0, size_t nelem,
size_t size, int (__cdecl *cmp)(const void *ck, const void *ce)) size_t size, int (__cdecl *cmp)(const void *ck, const void *ce))
{ {

View file

@ -4,7 +4,7 @@
/* /*
* @implemented * @implemented
*/ */
void *_lfind(const void *key, const void *base, unsigned int *nelp, void * __cdecl _lfind(const void *key, const void *base, unsigned int *nelp,
unsigned int width, int (__cdecl *compar)(const void *, const void *)) unsigned int width, int (__cdecl *compar)(const void *, const void *))
{ {
char* char_base = (char*)base; char* char_base = (char*)base;

View file

@ -5,7 +5,7 @@
/* /*
* @implemented * @implemented
*/ */
void *_lsearch(const void *key, void *base, unsigned int *nelp, unsigned int width, void * __cdecl _lsearch(const void *key, void *base, unsigned int *nelp, unsigned int width,
int (__cdecl *compar)(const void *, const void *)) int (__cdecl *compar)(const void *, const void *))
{ {
void *ret_find = _lfind(key,base,nelp,width,compar); void *ret_find = _lfind(key,base,nelp,width,compar);

View file

@ -49,7 +49,7 @@
* (And there are only three places where this is done). * (And there are only three places where this is done).
*/ */
static void static void __cdecl
qst(size_t size, int (__cdecl *compar)(const void*, const void*), char *base, char *max) qst(size_t size, int (__cdecl *compar)(const void*, const void*), char *base, char *max)
{ {
char c, *i, *j, *jj; char c, *i, *j, *jj;
@ -176,6 +176,7 @@ qst(size_t size, int (__cdecl *compar)(const void*, const void*), char *base, ch
* @implemented * @implemented
*/ */
void void
__cdecl
qsort(void *base0, size_t n, size_t size, int (__cdecl *compar)(const void*, const void*)) qsort(void *base0, size_t n, size_t size, int (__cdecl *compar)(const void*, const void*))
{ {
char *base = (char *)base0; char *base = (char *)base0;

View file

@ -6,6 +6,7 @@
* @implemented * @implemented
*/ */
int int
CDECL
_ttoi(const _TCHAR *str) _ttoi(const _TCHAR *str)
{ {
return (int)_ttoi64(str); return (int)_ttoi64(str);

View file

@ -14,6 +14,7 @@
* @implemented * @implemented
*/ */
__int64 __int64
CDECL
_atoi64(const char *nptr) _atoi64(const char *nptr)
{ {
char *s = (char *)nptr; char *s = (char *)nptr;

View file

@ -4,7 +4,7 @@
/* /*
* @implemented * @implemented
*/ */
long atol(const char *str) long CDECL atol(const char *str)
{ {
return (long)_atoi64(str); return (long)_atoi64(str);
} }
@ -12,7 +12,7 @@ long atol(const char *str)
/* /*
* @unimplemented * @unimplemented
*/ */
int _atoldbl(_LDOUBLE *value, char *str) int CDECL _atoldbl(_LDOUBLE *value, char *str)
{ {
/* FIXME needs error checking for huge/small values */ /* FIXME needs error checking for huge/small values */
#if 0 #if 0

View file

@ -628,7 +628,7 @@ int __cdecl _isleadbyte_l(int c, _locale_t locale)
/* /*
* @implemented * @implemented
*/ */
int isalpha(int c) int __cdecl isalpha(int c)
{ {
return(_isctype(c, _ALPHA)); return(_isctype(c, _ALPHA));
} }
@ -636,7 +636,7 @@ int isalpha(int c)
/* /*
* @implemented * @implemented
*/ */
int isalnum(int c) int __cdecl isalnum(int c)
{ {
return(_isctype(c, _ALPHA | _DIGIT)); return(_isctype(c, _ALPHA | _DIGIT));
} }
@ -644,7 +644,7 @@ int isalnum(int c)
/* /*
* @implemented * @implemented
*/ */
int iswalnum(wint_t c) int __cdecl iswalnum(wint_t c)
{ {
return iswctype(c, _ALPHA | _DIGIT); return iswctype(c, _ALPHA | _DIGIT);
} }
@ -652,7 +652,7 @@ int iswalnum(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int __isascii(int c) int __cdecl __isascii(int c)
{ {
return ((unsigned char)c <= 0x7f); return ((unsigned char)c <= 0x7f);
} }
@ -660,7 +660,7 @@ int __isascii(int c)
/* /*
* @implemented * @implemented
*/ */
int iswascii(wint_t c) int __cdecl iswascii(wint_t c)
{ {
return __isascii(c); return __isascii(c);
} }
@ -668,7 +668,7 @@ int iswascii(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iscntrl(int c) int __cdecl iscntrl(int c)
{ {
return(_isctype(c, _CONTROL)); return(_isctype(c, _CONTROL));
} }
@ -676,7 +676,7 @@ int iscntrl(int c)
/* /*
* @implemented * @implemented
*/ */
int __iscsym(int c) int __cdecl __iscsym(int c)
{ {
return (c < 127 && (isalnum(c) || (c == '_'))); return (c < 127 && (isalnum(c) || (c == '_')));
} }
@ -684,7 +684,7 @@ int __iscsym(int c)
/* /*
* @implemented * @implemented
*/ */
int __iscsymf(int c) int __cdecl __iscsymf(int c)
{ {
return (c < 127 && (isalpha(c) || (c == '_'))); return (c < 127 && (isalpha(c) || (c == '_')));
} }
@ -692,7 +692,7 @@ int __iscsymf(int c)
/* /*
* @implemented * @implemented
*/ */
int isdigit(int c) int __cdecl isdigit(int c)
{ {
return(_isctype(c, _DIGIT)); return(_isctype(c, _DIGIT));
} }
@ -700,7 +700,7 @@ int isdigit(int c)
/* /*
* @implemented * @implemented
*/ */
int isgraph(int c) int __cdecl isgraph(int c)
{ {
return (_isctype (c, _PUNCT | _ALPHA | _DIGIT)); return (_isctype (c, _PUNCT | _ALPHA | _DIGIT));
} }
@ -708,7 +708,7 @@ int isgraph(int c)
/* /*
* @implemented * @implemented
*/ */
int islower(int c) int __cdecl islower(int c)
{ {
return (_isctype (c, _LOWER)); return (_isctype (c, _LOWER));
} }
@ -716,7 +716,7 @@ int islower(int c)
/* /*
* @implemented * @implemented
*/ */
int isprint(int c) int __cdecl isprint(int c)
{ {
return (_isctype (c, _BLANK | _PUNCT | _ALPHA | _DIGIT)); return (_isctype (c, _BLANK | _PUNCT | _ALPHA | _DIGIT));
} }
@ -724,7 +724,7 @@ int isprint(int c)
/* /*
* @implemented * @implemented
*/ */
int ispunct(int c) int __cdecl ispunct(int c)
{ {
return (_isctype (c, _PUNCT)); return (_isctype (c, _PUNCT));
} }
@ -732,7 +732,7 @@ int ispunct(int c)
/* /*
* @implemented * @implemented
*/ */
int isspace(int c) int __cdecl isspace(int c)
{ {
return (_isctype (c, _SPACE)); return (_isctype (c, _SPACE));
} }
@ -740,7 +740,7 @@ int isspace(int c)
/* /*
* @implemented * @implemented
*/ */
int isupper(int c) int __cdecl isupper(int c)
{ {
return (_isctype (c, _UPPER)); return (_isctype (c, _UPPER));
} }
@ -748,7 +748,7 @@ int isupper(int c)
/* /*
* @implemented * @implemented
*/ */
int isxdigit(int c) int __cdecl isxdigit(int c)
{ {
return (_isctype (c, _HEX)); return (_isctype (c, _HEX));
} }
@ -757,7 +757,7 @@ int isxdigit(int c)
/* /*
* @implemented * @implemented
*/ */
int iswalpha(wint_t c) int __cdecl iswalpha(wint_t c)
{ {
return (iswctype (c, _ALPHA)); return (iswctype (c, _ALPHA));
} }
@ -765,7 +765,7 @@ int iswalpha(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswcntrl(wint_t c) int __cdecl iswcntrl(wint_t c)
{ {
return iswctype(c, _CONTROL); return iswctype(c, _CONTROL);
} }
@ -773,7 +773,7 @@ int iswcntrl(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswdigit(wint_t c) int __cdecl iswdigit(wint_t c)
{ {
return (iswctype (c, _DIGIT)); return (iswctype (c, _DIGIT));
} }
@ -781,7 +781,7 @@ int iswdigit(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswgraph(wint_t c) int __cdecl iswgraph(wint_t c)
{ {
return iswctype(c,_PUNCT | _ALPHA | _DIGIT); return iswctype(c,_PUNCT | _ALPHA | _DIGIT);
} }
@ -789,7 +789,7 @@ int iswgraph(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswprint(wint_t c) int __cdecl iswprint(wint_t c)
{ {
return iswctype((unsigned short)c,_BLANK | _PUNCT | _ALPHA | _DIGIT); return iswctype((unsigned short)c,_BLANK | _PUNCT | _ALPHA | _DIGIT);
} }
@ -798,7 +798,7 @@ int iswprint(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswpunct(wint_t c) int __cdecl iswpunct(wint_t c)
{ {
return iswctype(c, _PUNCT); return iswctype(c, _PUNCT);
} }
@ -806,7 +806,7 @@ int iswpunct(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswlower(wint_t c) int __cdecl iswlower(wint_t c)
{ {
return (iswctype (c, _LOWER)); return (iswctype (c, _LOWER));
} }
@ -814,7 +814,7 @@ int iswlower(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswupper(wint_t c) int __cdecl iswupper(wint_t c)
{ {
return iswctype(c, _UPPER); return iswctype(c, _UPPER);
} }
@ -823,7 +823,7 @@ int iswupper(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswspace(wint_t c) int __cdecl iswspace(wint_t c)
{ {
return (iswctype (c, _SPACE)); return (iswctype (c, _SPACE));
} }
@ -831,7 +831,7 @@ int iswspace(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int iswxdigit(wint_t c) int __cdecl iswxdigit(wint_t c)
{ {
return (iswctype (c, _HEX)); return (iswctype (c, _HEX));
} }
@ -840,7 +840,7 @@ int iswxdigit(wint_t c)
/* /*
* @implemented * @implemented
*/ */
int __toascii(int c) int __cdecl __toascii(int c)
{ {
return((unsigned int)(c) & 0x7f); return((unsigned int)(c) & 0x7f);
} }
@ -848,7 +848,7 @@ int __toascii(int c)
/* /*
* @implemented * @implemented
*/ */
int _tolower(int c) int __cdecl _tolower(int c)
{ {
if (_isctype (c, _UPPER)) if (_isctype (c, _UPPER))
return (c - upalpha); return (c - upalpha);
@ -858,7 +858,7 @@ int _tolower(int c)
/* /*
* @implemented * @implemented
*/ */
int _toupper(int c) int __cdecl _toupper(int c)
{ {
if (_isctype (c, _LOWER)) if (_isctype (c, _LOWER))
return (c + upalpha); return (c + upalpha);
@ -868,7 +868,7 @@ int _toupper(int c)
/* /*
* @implemented * @implemented
*/ */
int tolower(int c) int __cdecl tolower(int c)
{ {
if (_isctype (c, _UPPER)) if (_isctype (c, _UPPER))
return (c - upalpha); return (c - upalpha);
@ -878,7 +878,7 @@ int tolower(int c)
/* /*
* @implemented * @implemented
*/ */
int toupper(int c) int __cdecl toupper(int c)
{ {
if (_isctype (c, _LOWER)) if (_isctype (c, _LOWER))
return (c + upalpha); return (c + upalpha);
@ -888,7 +888,7 @@ int toupper(int c)
/* /*
* @implemented * @implemented
*/ */
wint_t towlower(wint_t c) wint_t __cdecl towlower(wint_t c)
{ {
if (iswctype (c, _UPPER)) if (iswctype (c, _UPPER))
return (c - upalpha); return (c - upalpha);
@ -898,7 +898,7 @@ wint_t towlower(wint_t c)
/* /*
* @implemented * @implemented
*/ */
wint_t towupper(wint_t c) wint_t __cdecl towupper(wint_t c)
{ {
if (iswctype (c, _LOWER)) if (iswctype (c, _LOWER))
return (c + upalpha); return (c + upalpha);

View file

@ -5,7 +5,7 @@ extern const unsigned short wine_wctype_table[];
/* /*
* @implemented * @implemented
*/ */
int iswctype(wint_t wc, wctype_t wctypeFlags) int __cdecl iswctype(wint_t wc, wctype_t wctypeFlags)
{ {
return (wine_wctype_table[wine_wctype_table[wc >> 8] + (wc & 0xff)] & wctypeFlags); return (wine_wctype_table[wine_wctype_table[wc >> 8] + (wc & 0xff)] & wctypeFlags);
} }

View file

@ -6,6 +6,7 @@
* @implemented * @implemented
*/ */
char * char *
CDECL
_i64toa(__int64 value, char *string, int radix) _i64toa(__int64 value, char *string, int radix)
{ {
ULONGLONG val; ULONGLONG val;
@ -125,6 +126,7 @@ int CDECL _i64toa_s(__int64 value, char *str, size_t size, int radix)
* @implemented * @implemented
*/ */
char * char *
CDECL
_ui64toa(unsigned __int64 value, char *string, int radix) _ui64toa(unsigned __int64 value, char *string, int radix)
{ {
char buffer[65]; char buffer[65];
@ -199,6 +201,7 @@ int CDECL _itoa_s(int value, char *str, size_t size, int radix)
* @implemented * @implemented
*/ */
char * char *
CDECL
_itoa(int value, char *string, int radix) _itoa(int value, char *string, int radix)
{ {
return _ltoa(value, string, radix); return _ltoa(value, string, radix);
@ -208,6 +211,7 @@ _itoa(int value, char *string, int radix)
* @implemented * @implemented
*/ */
char * char *
CDECL
_ltoa(long value, char *string, int radix) _ltoa(long value, char *string, int radix)
{ {
unsigned long val; unsigned long val;
@ -328,6 +332,7 @@ int CDECL _ltoa_s(long value, char *str, size_t size, int radix)
* @implemented * @implemented
*/ */
char * char *
CDECL
_ultoa(unsigned long value, char *string, int radix) _ultoa(unsigned long value, char *string, int radix)
{ {
char buffer[33]; char buffer[33];

View file

@ -13,6 +13,7 @@
* @implemented * @implemented
*/ */
wchar_t * wchar_t *
CDECL
_i64tow(__int64 value, wchar_t *string, int radix) _i64tow(__int64 value, wchar_t *string, int radix)
{ {
ULONGLONG val; ULONGLONG val;
@ -56,6 +57,7 @@ _i64tow(__int64 value, wchar_t *string, int radix)
* @implemented * @implemented
*/ */
int int
CDECL
_i64tow_s(__int64 value, wchar_t *str, size_t size, int radix) _i64tow_s(__int64 value, wchar_t *str, size_t size, int radix)
{ {
unsigned __int64 val; unsigned __int64 val;
@ -136,6 +138,7 @@ _i64tow_s(__int64 value, wchar_t *str, size_t size, int radix)
* @implemented * @implemented
*/ */
wchar_t * wchar_t *
CDECL
_ui64tow(unsigned __int64 value, wchar_t *string, int radix) _ui64tow(unsigned __int64 value, wchar_t *string, int radix)
{ {
WCHAR buffer[65]; WCHAR buffer[65];
@ -165,6 +168,7 @@ _ui64tow(unsigned __int64 value, wchar_t *string, int radix)
* @implemented * @implemented
*/ */
int int
CDECL
_ui64tow_s( unsigned __int64 value, wchar_t *str, _ui64tow_s( unsigned __int64 value, wchar_t *str,
size_t size, int radix ) size_t size, int radix )
{ {
@ -204,6 +208,7 @@ _ui64tow_s( unsigned __int64 value, wchar_t *str,
* @implemented * @implemented
*/ */
wchar_t * wchar_t *
CDECL
_itow(int value, wchar_t *string, int radix) _itow(int value, wchar_t *string, int radix)
{ {
return _ltow(value, string, radix); return _ltow(value, string, radix);
@ -213,6 +218,7 @@ _itow(int value, wchar_t *string, int radix)
* @implemented * @implemented
*/ */
int int
CDECL
_itow_s(int value, wchar_t *str, size_t size, int radix) _itow_s(int value, wchar_t *str, size_t size, int radix)
{ {
return _ltow_s(value, str, size, radix); return _ltow_s(value, str, size, radix);
@ -222,6 +228,7 @@ _itow_s(int value, wchar_t *str, size_t size, int radix)
* @implemented * @implemented
*/ */
wchar_t * wchar_t *
CDECL
_ltow(long value, wchar_t *string, int radix) _ltow(long value, wchar_t *string, int radix)
{ {
unsigned long val; unsigned long val;
@ -265,6 +272,7 @@ _ltow(long value, wchar_t *string, int radix)
* @implemented * @implemented
*/ */
int int
CDECL
_ltow_s(long value, wchar_t *str, size_t size, int radix) _ltow_s(long value, wchar_t *str, size_t size, int radix)
{ {
unsigned long val; unsigned long val;
@ -345,6 +353,7 @@ _ltow_s(long value, wchar_t *str, size_t size, int radix)
* @implemented * @implemented
*/ */
wchar_t * wchar_t *
CDECL
_ultow(unsigned long value, wchar_t *string, int radix) _ultow(unsigned long value, wchar_t *string, int radix)
{ {
WCHAR buffer[33]; WCHAR buffer[33];

View file

@ -4,6 +4,7 @@
* @implemented * @implemented
*/ */
int int
CDECL
_stricmp(const char *s1, const char *s2) _stricmp(const char *s1, const char *s2)
{ {
while (toupper(*s1) == toupper(*s2)) while (toupper(*s1) == toupper(*s2))
@ -20,6 +21,7 @@ _stricmp(const char *s1, const char *s2)
* @implemented * @implemented
*/ */
int int
CDECL
_strcmpi(const char *s1, const char *s2) _strcmpi(const char *s1, const char *s2)
{ {
return _stricmp(s1,s2); return _stricmp(s1,s2);

View file

@ -4,7 +4,7 @@
/* /*
* @implemented * @implemented
*/ */
char * _strlwr(char *x) char * CDECL _strlwr(char *x)
{ {
char *y=x; char *y=x;

View file

@ -3,7 +3,7 @@
/* /*
* @implemented * @implemented
*/ */
int _strnicmp(const char *s1, const char *s2, size_t n) int CDECL _strnicmp(const char *s1, const char *s2, size_t n)
{ {
if (n == 0) if (n == 0)

View file

@ -4,7 +4,7 @@
#define BIT_SIZE (CHAR_BIT * sizeof(unsigned long) / sizeof(char)) #define BIT_SIZE (CHAR_BIT * sizeof(unsigned long) / sizeof(char))
char* strpbrk(const char *s1, const char *s2) char* __cdecl strpbrk(const char *s1, const char *s2)
{ {
if (*s2 == 0) if (*s2 == 0)
{ {

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
char * _strrev(char *s) char * CDECL _strrev(char *s)
{ {
char a, *b, *e; char a, *b, *e;
b=e=s; b=e=s;

View file

@ -13,6 +13,7 @@
* @implemented * @implemented
*/ */
char * char *
CDECL
strstr(const char *s, const char *find) strstr(const char *s, const char *find)
{ {
char c, sc; char c, sc;

View file

@ -4,6 +4,7 @@
* @implemented * @implemented
*/ */
long long
CDECL
strtol(const char *nptr, char **endptr, int base) strtol(const char *nptr, char **endptr, int base)
{ {
const char *s = nptr; const char *s = nptr;

View file

@ -1,6 +1,7 @@
#include <precomp.h> #include <precomp.h>
unsigned long long unsigned long long
CDECL
strtoull(const char *nptr, char **endptr, int base) strtoull(const char *nptr, char **endptr, int base)
{ {
const char *s = nptr; const char *s = nptr;

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
char *_strupr(char *x) char * CDECL _strupr(char *x)
{ {
char *y=x; char *y=x;

View file

@ -2,7 +2,7 @@
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
size_t _strxspn(const char *s1, const char *s2) size_t __cdecl _strxspn(const char *s1, const char *s2)
{ {
unsigned char char_map[1 << CHAR_BIT * sizeof(char)]; unsigned char char_map[1 << CHAR_BIT * sizeof(char)];
const unsigned char * us2 = (const unsigned char *)s2; const unsigned char * us2 = (const unsigned char *)s2;

View file

@ -13,6 +13,7 @@
* @implemented * @implemented
*/ */
long long
CDECL
wcstol(const wchar_t *nptr, wchar_t **endptr, int base) wcstol(const wchar_t *nptr, wchar_t **endptr, int base)
{ {
const wchar_t *s = nptr; const wchar_t *s = nptr;

View file

@ -10,6 +10,7 @@
* @implemented * @implemented
*/ */
unsigned long unsigned long
CDECL
wcstoul(const wchar_t *nptr, wchar_t **endptr, int base) wcstoul(const wchar_t *nptr, wchar_t **endptr, int base)
{ {
const wchar_t *s = nptr; const wchar_t *s = nptr;

View file

@ -14,6 +14,7 @@
* @implemented * @implemented
*/ */
__int64 __int64
CDECL
_wtoi64 (const wchar_t *nptr) _wtoi64 (const wchar_t *nptr)
{ {
int c; int c;
@ -50,6 +51,7 @@ _wtoi64 (const wchar_t *nptr)
* @unimplemented * @unimplemented
*/ */
__int64 __int64
CDECL
_wcstoi64 (const wchar_t *nptr, wchar_t **endptr, int base) _wcstoi64 (const wchar_t *nptr, wchar_t **endptr, int base)
{ {
TRACE("_wcstoi64 is UNIMPLEMENTED\n"); TRACE("_wcstoi64 is UNIMPLEMENTED\n");
@ -60,6 +62,7 @@ _wcstoi64 (const wchar_t *nptr, wchar_t **endptr, int base)
* @unimplemented * @unimplemented
*/ */
unsigned __int64 unsigned __int64
CDECL
_wcstoui64 (const wchar_t *nptr, wchar_t **endptr, int base) _wcstoui64 (const wchar_t *nptr, wchar_t **endptr, int base)
{ {
TRACE("_wcstoui64 is UNIMPLEMENTED\n"); TRACE("_wcstoui64 is UNIMPLEMENTED\n");

View file

@ -13,7 +13,7 @@
/* /*
* @unimplemented * @unimplemented
*/ */
int _wcsncoll (const wchar_t *s1, const wchar_t *s2, size_t c) int CDECL _wcsncoll (const wchar_t *s1, const wchar_t *s2, size_t c)
{ {
/* FIXME: handle collates */ /* FIXME: handle collates */
return wcsncmp(s1,s2,c); return wcsncmp(s1,s2,c);
@ -22,7 +22,7 @@ int _wcsncoll (const wchar_t *s1, const wchar_t *s2, size_t c)
/* /*
* @unimplemented * @unimplemented
*/ */
int _wcsnicoll (const wchar_t *s1, const wchar_t *s2, size_t c) int CDECL _wcsnicoll (const wchar_t *s1, const wchar_t *s2, size_t c)
{ {
/* FIXME: handle collates */ /* FIXME: handle collates */
return _wcsnicmp(s1,s2,c); return _wcsnicmp(s1,s2,c);

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
size_t wcscspn(const wchar_t *str,const wchar_t *reject) size_t CDECL wcscspn(const wchar_t *str,const wchar_t *reject)
{ {
wchar_t *s; wchar_t *s;
wchar_t *t; wchar_t *t;

View file

@ -5,7 +5,7 @@
/* /*
* @implemented * @implemented
*/ */
int _wcsicmp(const wchar_t* cs,const wchar_t * ct) int CDECL _wcsicmp(const wchar_t* cs,const wchar_t * ct)
{ {
while (towlower(*cs) == towlower(*ct)) while (towlower(*cs) == towlower(*ct))
{ {

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
wchar_t * _wcslwr(wchar_t *x) wchar_t * CDECL _wcslwr(wchar_t *x)
{ {
wchar_t *y=x; wchar_t *y=x;

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
int _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count) int CDECL _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count)
{ {
if (count == 0) if (count == 0)
return 0; return 0;

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
size_t wcsspn(const wchar_t *str,const wchar_t *accept) size_t CDECL wcsspn(const wchar_t *str,const wchar_t *accept)
{ {
wchar_t *s; wchar_t *s;
wchar_t *t; wchar_t *t;

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
wchar_t *wcsstr(const wchar_t *s,const wchar_t *b) wchar_t * CDECL wcsstr(const wchar_t *s,const wchar_t *b)
{ {
wchar_t *x; wchar_t *x;
wchar_t *y; wchar_t *y;

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
wchar_t *_wcsupr(wchar_t *x) wchar_t * CDECL _wcsupr(wchar_t *x)
{ {
wchar_t *y = x; wchar_t *y = x;

View file

@ -13,7 +13,7 @@
/* /*
* @implemented * @implemented
*/ */
size_t wcsxfrm(wchar_t *dst,const wchar_t *src, size_t n) size_t CDECL wcsxfrm(wchar_t *dst,const wchar_t *src, size_t n)
{ {
size_t r = 0; size_t r = 0;
int c; int c;

View file

@ -148,7 +148,9 @@ KiExitInterrupt(IN PKTRAP_FRAME TrapFrame,
KiEoiHelper(TrapFrame); KiEoiHelper(TrapFrame);
} }
DECLSPEC_NORETURN
VOID VOID
__cdecl
KiUnexpectedInterrupt(VOID) KiUnexpectedInterrupt(VOID)
{ {
/* Crash the machine */ /* Crash the machine */

View file

@ -12,8 +12,8 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
VOID KiFastCallEntry(VOID); VOID __cdecl KiFastCallEntry(VOID);
VOID KiFastCallEntryWithSingleStep(VOID); VOID __cdecl KiFastCallEntryWithSingleStep(VOID);
extern PVOID FrRestore; extern PVOID FrRestore;
VOID FASTCALL Ke386LoadFpuState(IN PFX_SAVE_AREA SaveArea); VOID FASTCALL Ke386LoadFpuState(IN PFX_SAVE_AREA SaveArea);