From 1b135b87320995b01c4bc1686d5241f815d1f0a0 Mon Sep 17 00:00:00 2001 From: Robert Dickenson Date: Fri, 29 Nov 2002 15:59:05 +0000 Subject: [PATCH] Further reduced differences and include all identical msvcrt targets in crtdll makefile. svn path=/trunk/; revision=3809 --- reactos/lib/crtdll/ctype/isalnum.c | 4 +- reactos/lib/crtdll/ctype/isalpha.c | 4 +- reactos/lib/crtdll/ctype/isascii.c | 4 +- reactos/lib/crtdll/ctype/isspace.c | 2 + reactos/lib/crtdll/direct/chdir.c | 12 +- reactos/lib/crtdll/direct/chdrive.c | 24 +- reactos/lib/crtdll/direct/getcwd.c | 24 +- reactos/lib/crtdll/direct/getdcwd.c | 28 +- reactos/lib/crtdll/direct/getdfree.c | 24 +- reactos/lib/crtdll/direct/getdrive.c | 17 +- reactos/lib/crtdll/direct/mkdir.c | 8 +- reactos/lib/crtdll/direct/rmdir.c | 8 +- reactos/lib/crtdll/io/find.c | 8 +- reactos/lib/crtdll/io/setmode.c | 2 +- reactos/lib/crtdll/makefile | 501 ++++++++++++------------ reactos/lib/crtdll/math/modf.c | 93 ++--- reactos/lib/crtdll/math/tanh.c | 2 +- reactos/lib/crtdll/mbstring/ismbc.c | 1 - reactos/lib/crtdll/mbstring/mbscoll.c | 2 + reactos/lib/crtdll/mbstring/mbscspn.c | 1 + reactos/lib/crtdll/mbstring/mbsicoll.c | 1 + reactos/lib/crtdll/mbstring/mbsncpy.c | 12 +- reactos/lib/crtdll/mbstring/mbsnextc.c | 2 - reactos/lib/crtdll/mbstring/mbsnicoll.c | 1 + reactos/lib/crtdll/mbstring/mbsspn.c | 1 + reactos/lib/crtdll/mbstring/mbsspnp.c | 1 + reactos/lib/crtdll/process/procid.c | 4 +- reactos/lib/crtdll/process/thread.c | 13 +- reactos/lib/crtdll/search/lfind.c | 4 +- reactos/lib/crtdll/stdio/fdopen.c | 2 +- reactos/lib/crtdll/stdio/fscanf.c | 5 +- reactos/lib/crtdll/stdio/printf.c | 2 +- reactos/lib/crtdll/stdio/rewind.c | 1 - reactos/lib/crtdll/stdio/sprintf.c | 2 +- reactos/lib/crtdll/stdio/sscanf.c | 5 +- reactos/lib/crtdll/stdio/tempnam.c | 5 +- reactos/lib/crtdll/stdio/vprintf.c | 2 +- reactos/lib/crtdll/stdio/vscanf.c | 5 +- reactos/lib/crtdll/stdio/vsprintf.c | 2 +- reactos/lib/crtdll/stdlib/fullpath.c | 2 +- reactos/lib/crtdll/stdlib/itow.c | 6 +- reactos/lib/crtdll/stdlib/makepath.c | 2 +- reactos/lib/crtdll/stdlib/senv.c | 1 + reactos/lib/crtdll/stdlib/splitp.c | 2 +- reactos/lib/crtdll/string/memcpy.c | 7 +- reactos/lib/crtdll/string/memset.c | 6 +- reactos/lib/crtdll/string/strcmp.c | 4 +- reactos/lib/crtdll/string/strcoll.c | 24 +- reactos/lib/crtdll/string/strdup.c | 2 +- reactos/lib/crtdll/string/strlen.c | 6 +- reactos/lib/crtdll/string/strrev.c | 2 +- reactos/lib/crtdll/string/strxfrm.c | 9 +- reactos/lib/crtdll/time/clock.c | 18 +- reactos/lib/crtdll/time/ctime.c | 29 +- reactos/lib/crtdll/time/time.c | 4 +- reactos/lib/msvcrt/Makefile | 3 +- reactos/lib/msvcrt/ctype/isalnum.c | 4 +- reactos/lib/msvcrt/ctype/isalpha.c | 6 +- reactos/lib/msvcrt/ctype/isascii.c | 4 +- reactos/lib/msvcrt/ctype/iscntrl.c | 5 +- reactos/lib/msvcrt/ctype/iscsym.c | 6 +- reactos/lib/msvcrt/ctype/isdigit.c | 5 +- reactos/lib/msvcrt/ctype/islower.c | 5 +- reactos/lib/msvcrt/ctype/ispunct.c | 5 +- reactos/lib/msvcrt/ctype/isspace.c | 2 + reactos/lib/msvcrt/ctype/isupper.c | 5 +- reactos/lib/msvcrt/ctype/isxdigit.c | 5 +- reactos/lib/msvcrt/ctype/toascii.c | 2 +- reactos/lib/msvcrt/except/matherr.c | 29 +- reactos/lib/msvcrt/float/chgsign.c | 2 + reactos/lib/msvcrt/float/fpclass.c | 4 +- reactos/lib/msvcrt/float/fpreset.c | 1 + reactos/lib/msvcrt/float/isnan.c | 7 +- reactos/lib/msvcrt/float/nafter.c | 1 + reactos/lib/msvcrt/io/locking.c | 2 + reactos/lib/msvcrt/math/acos.c | 5 +- reactos/lib/msvcrt/math/asin.c | 5 +- reactos/lib/msvcrt/math/cosh.c | 5 +- reactos/lib/msvcrt/math/frexp.c | 17 +- reactos/lib/msvcrt/math/ftol.c | 2 +- reactos/lib/msvcrt/math/j0_y0.c | 10 +- reactos/lib/msvcrt/math/j1_y1.c | 9 +- reactos/lib/msvcrt/math/jn_yn.c | 1 + reactos/lib/msvcrt/math/stubs.c | 71 ++-- reactos/lib/msvcrt/mbstring/ischira.c | 1 + reactos/lib/msvcrt/mbstring/iskmoji.c | 2 +- reactos/lib/msvcrt/mbstring/ismbpun.c | 7 +- reactos/lib/msvcrt/mbstring/mbsncat.c | 1 - reactos/lib/msvcrt/mbstring/mbsncpy.c | 14 +- reactos/lib/msvcrt/mbstring/mbsnicmp.c | 3 +- reactos/lib/msvcrt/mbstring/mbspbrk.c | 1 - reactos/lib/msvcrt/mbstring/mbsupr.c | 1 - reactos/lib/msvcrt/misc/assert.c | 1 + reactos/lib/msvcrt/process/_cwait.c | 25 +- reactos/lib/msvcrt/process/dll.c | 11 +- reactos/lib/msvcrt/process/thread.c | 39 +- reactos/lib/msvcrt/search/lfind.c | 16 +- reactos/lib/msvcrt/stdlib/mbstowcs.c | 5 +- reactos/lib/msvcrt/stdlib/mbtowc.c | 37 -- reactos/lib/msvcrt/string/memcpy.c | 7 +- reactos/lib/msvcrt/string/memset.c | 6 +- reactos/lib/msvcrt/string/strcmp.c | 4 +- reactos/lib/msvcrt/string/strlen.c | 6 +- reactos/lib/msvcrt/string/strxfrm.c | 3 +- reactos/lib/msvcrt/sys_stat/fstat.c | 5 +- reactos/lib/msvcrt/sys_stat/futime.c | 1 + reactos/lib/msvcrt/time/ctime.c | 30 +- reactos/lib/msvcrt/time/strftime.c | 36 +- reactos/lib/msvcrt/time/time.c | 8 +- 109 files changed, 714 insertions(+), 747 deletions(-) diff --git a/reactos/lib/crtdll/ctype/isalnum.c b/reactos/lib/crtdll/ctype/isalnum.c index 64de232da21..cf741ced5f7 100644 --- a/reactos/lib/crtdll/ctype/isalnum.c +++ b/reactos/lib/crtdll/ctype/isalnum.c @@ -13,11 +13,11 @@ #undef isalnum int isalnum(int c) { - return _isctype(c,_ALPHA | _DIGIT); + return _isctype(c, _ALPHA | _DIGIT); } #undef iswalnum int iswalnum(wint_t c) { - return iswctype(c,_ALPHA | _DIGIT); + return iswctype(c, _ALPHA | _DIGIT); } diff --git a/reactos/lib/crtdll/ctype/isalpha.c b/reactos/lib/crtdll/ctype/isalpha.c index 3aece4abb3a..fecee0aae2b 100644 --- a/reactos/lib/crtdll/ctype/isalpha.c +++ b/reactos/lib/crtdll/ctype/isalpha.c @@ -1,16 +1,18 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries - * FILE: lib/crtdll/conio/putch.c + * FILE: lib/crtdll/ctype/isalpha.c * PURPOSE: Checks if a character is alphanumeric * PROGRAMER: Boudewijn Dekker * UPDATE HISTORY: * 28/12/98: Created */ + #include #undef isalpha + int isalpha(int c) { return _isctype(c, _ALPHA); diff --git a/reactos/lib/crtdll/ctype/isascii.c b/reactos/lib/crtdll/ctype/isascii.c index 822ee3c906f..5536f0268d3 100644 --- a/reactos/lib/crtdll/ctype/isascii.c +++ b/reactos/lib/crtdll/ctype/isascii.c @@ -12,10 +12,10 @@ int __isascii(int c) { - return (!((c)&(~0x7f))) ; + return (!((c)&(~0x7f))); } int iswascii(wint_t c) { - return __isascii(c); + return __isascii(c); } diff --git a/reactos/lib/crtdll/ctype/isspace.c b/reactos/lib/crtdll/ctype/isspace.c index 9eae142cf83..723b8b0cc23 100644 --- a/reactos/lib/crtdll/ctype/isspace.c +++ b/reactos/lib/crtdll/ctype/isspace.c @@ -7,8 +7,10 @@ * UPDATE HISTORY: * 28/12/98: Created */ + #include + #undef isspace int isspace(int c) { diff --git a/reactos/lib/crtdll/direct/chdir.c b/reactos/lib/crtdll/direct/chdir.c index 212b7dca0e2..eb8061dbe35 100644 --- a/reactos/lib/crtdll/direct/chdir.c +++ b/reactos/lib/crtdll/direct/chdir.c @@ -3,11 +3,11 @@ #include -int _chdir( const char *_path ) +int _chdir(const char* _path) { - if ( _path[1] == ':') - _chdrive(tolower(_path[0] - 'a')+1); - if ( !SetCurrentDirectoryA((char *)_path) ) - return -1; - return 0; + if (_path[1] == ':') + _chdrive(tolower(_path[0] - 'a')+1); + if (!SetCurrentDirectoryA((char*)_path)) + return -1; + return 0; } diff --git a/reactos/lib/crtdll/direct/chdrive.c b/reactos/lib/crtdll/direct/chdrive.c index d31ed463e08..15229040b0f 100644 --- a/reactos/lib/crtdll/direct/chdrive.c +++ b/reactos/lib/crtdll/direct/chdrive.c @@ -7,18 +7,18 @@ int cur_drive = 0; -int _chdrive( int drive ) +int _chdrive(int drive) { - char d[3]; - if (!( drive >= 1 && drive <= 26 )) - return -1; + char d[3]; - if ( cur_drive != drive ) { - cur_drive = drive; - d[0] = toupper(cur_drive + '@'); - d[1] = ':'; - d[2] = 0; - SetCurrentDirectoryA(d); - } - return 0; + if (!( drive >= 1 && drive <= 26)) + return -1; + if (cur_drive != drive) { + cur_drive = drive; + d[0] = toupper(cur_drive + '@'); + d[1] = ':'; + d[2] = 0; + SetCurrentDirectoryA(d); + } + return 0; } diff --git a/reactos/lib/crtdll/direct/getcwd.c b/reactos/lib/crtdll/direct/getcwd.c index 1a27d4bc6ed..67638b939f2 100644 --- a/reactos/lib/crtdll/direct/getcwd.c +++ b/reactos/lib/crtdll/direct/getcwd.c @@ -3,20 +3,20 @@ #include -char *_getcwd( char *buffer, int maxlen ) +char *_getcwd(char* buffer, int maxlen) { - char *cwd; - int len; + char *cwd; + int len; - if ( buffer == NULL ) { - cwd = malloc(MAX_PATH); - len = MAX_PATH; - } else { - cwd = buffer; - len = maxlen; - } + if (buffer == NULL) { + cwd = malloc(MAX_PATH); + len = MAX_PATH; + } else { + cwd = buffer; + len = maxlen; + } if (GetCurrentDirectoryA(len, cwd) == 0) { - return NULL; + return NULL; } - return cwd; + return cwd; } diff --git a/reactos/lib/crtdll/direct/getdcwd.c b/reactos/lib/crtdll/direct/getdcwd.c index 2c6c888f360..bbf79fd9be5 100644 --- a/reactos/lib/crtdll/direct/getdcwd.c +++ b/reactos/lib/crtdll/direct/getdcwd.c @@ -1,19 +1,19 @@ #include #include -char* _getdcwd (int nDrive, char* caBuffer, int nBufLen) +char* _getdcwd(int nDrive, char* caBuffer, int nBufLen) { - int i =0; - int dr = _getdrive(); - - if ( nDrive < 1 || nDrive > 26 ) - return NULL; - if ( dr != nDrive ) - _chdrive(nDrive); - i = GetCurrentDirectoryA(nBufLen,caBuffer); - if ( i == nBufLen ) - return NULL; - if ( dr != nDrive ) - _chdrive(dr); - return caBuffer; + int i =0; + int dr = _getdrive(); + + if (nDrive < 1 || nDrive > 26) + return NULL; + if (dr != nDrive) + _chdrive(nDrive); + i = GetCurrentDirectoryA(nBufLen, caBuffer); + if (i == nBufLen) + return NULL; + if (dr != nDrive) + _chdrive(dr); + return caBuffer; } diff --git a/reactos/lib/crtdll/direct/getdfree.c b/reactos/lib/crtdll/direct/getdfree.c index a2405031215..cd90b43ff67 100644 --- a/reactos/lib/crtdll/direct/getdfree.c +++ b/reactos/lib/crtdll/direct/getdfree.c @@ -3,18 +3,18 @@ #include -unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace) +unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t* _diskspace) { - char RootPathName[10]; - RootPathName[0] = toupper(_drive +'@'); - RootPathName[1] = ':'; - RootPathName[2] = '\\'; - RootPathName[3] = 0; - if ( _diskspace == NULL ) - return 0; + char RootPathName[10]; - if ( !GetDiskFreeSpaceA(RootPathName,(LPDWORD)&_diskspace->sectors_per_cluster,(LPDWORD)&_diskspace->bytes_per_sector, - (LPDWORD )&_diskspace->avail_clusters,(LPDWORD )&_diskspace->total_clusters ) ) - return 0; - return _diskspace->avail_clusters; + RootPathName[0] = toupper(_drive +'@'); + RootPathName[1] = ':'; + RootPathName[2] = '\\'; + RootPathName[3] = 0; + if (_diskspace == NULL) + return 0; + if (!GetDiskFreeSpaceA(RootPathName,(LPDWORD)&_diskspace->sectors_per_cluster,(LPDWORD)&_diskspace->bytes_per_sector, + (LPDWORD )&_diskspace->avail_clusters,(LPDWORD )&_diskspace->total_clusters)) + return 0; + return _diskspace->avail_clusters; } diff --git a/reactos/lib/crtdll/direct/getdrive.c b/reactos/lib/crtdll/direct/getdrive.c index e2b6e66aff9..5638c652c03 100644 --- a/reactos/lib/crtdll/direct/getdrive.c +++ b/reactos/lib/crtdll/direct/getdrive.c @@ -5,21 +5,20 @@ extern int cur_drive; -int _getdrive( void ) +int _getdrive(void) { - char Buffer[MAX_PATH]; + char Buffer[MAX_PATH]; - if ( cur_drive == 0 ) { - GetCurrentDirectoryA(MAX_PATH,Buffer); - cur_drive = toupper(Buffer[0] - '@'); - } - - return cur_drive; + if (cur_drive == 0) { + GetCurrentDirectoryA(MAX_PATH, Buffer); + cur_drive = toupper(Buffer[0] - '@'); + } + return cur_drive; } unsigned long _getdrives(void) { //fixme get logical drives //return GetLogicalDrives(); - return 5; // drive A and C + return 5; // drive A and C } diff --git a/reactos/lib/crtdll/direct/mkdir.c b/reactos/lib/crtdll/direct/mkdir.c index 9b5bb0f5e1f..e568b9cdc0a 100644 --- a/reactos/lib/crtdll/direct/mkdir.c +++ b/reactos/lib/crtdll/direct/mkdir.c @@ -2,9 +2,9 @@ #include -int _mkdir( const char *_path ) +int _mkdir(const char* _path) { - if (!CreateDirectoryA(_path,NULL)) - return -1; - return 0; + if (!CreateDirectoryA(_path, NULL)) + return -1; + return 0; } diff --git a/reactos/lib/crtdll/direct/rmdir.c b/reactos/lib/crtdll/direct/rmdir.c index 3619d04a225..a057acdc41e 100644 --- a/reactos/lib/crtdll/direct/rmdir.c +++ b/reactos/lib/crtdll/direct/rmdir.c @@ -2,9 +2,9 @@ #include -int _rmdir( const char *_path ) +int _rmdir(const char* _path) { - if (!RemoveDirectoryA(_path)) - return -1; - return 0; + if (!RemoveDirectoryA(_path)) + return -1; + return 0; } diff --git a/reactos/lib/crtdll/io/find.c b/reactos/lib/crtdll/io/find.c index a2dfe8b8b41..83b379bb2df 100644 --- a/reactos/lib/crtdll/io/find.c +++ b/reactos/lib/crtdll/io/find.c @@ -14,13 +14,13 @@ int _findclose(int handle) int _findfirst(const char* _name, struct _finddata_t* result) { - WIN32_FIND_DATA FindFileData; + WIN32_FIND_DATAA FindFileData; char dir[MAX_PATH]; long hFindFile; int len = 0; if (_name == NULL || _name[0] == 0) { - len = GetCurrentDirectory(MAX_PATH-4,dir); + len = GetCurrentDirectoryA(MAX_PATH-4,dir); if (dir[len-1] != '\\') { dir[len] = '\\'; dir[len+1] = 0; @@ -41,7 +41,7 @@ int _findfirst(const char* _name, struct _finddata_t* result) result->time_access = FileTimeToUnixTime(&FindFileData.ftLastAccessTime,NULL); result->time_write = FileTimeToUnixTime(&FindFileData.ftLastWriteTime,NULL); result->size = FindFileData.nFileSizeLow; - strncpy(result->name,FindFileData.cFileName,260); + strncpy(result->name,FindFileData.cFileName,MAX_PATH); // if no wildcard the find file handle can be closed right away // a return value of 0 can flag this. @@ -56,7 +56,7 @@ int _findfirst(const char* _name, struct _finddata_t* result) int _findnext(int handle, struct _finddata_t* result) { - WIN32_FIND_DATA FindFileData; + WIN32_FIND_DATAA FindFileData; // check no wildcards or invalid handle if (handle == 0 || handle == -1) diff --git a/reactos/lib/crtdll/io/setmode.c b/reactos/lib/crtdll/io/setmode.c index a127902d6fd..6109947b021 100644 --- a/reactos/lib/crtdll/io/setmode.c +++ b/reactos/lib/crtdll/io/setmode.c @@ -1,4 +1,4 @@ -/* $Id: setmode.c,v 1.5 2002/11/24 18:42:13 robd Exp $ +/* $Id: setmode.c,v 1.6 2002/11/29 15:59:00 robd Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries diff --git a/reactos/lib/crtdll/makefile b/reactos/lib/crtdll/makefile index a23db83bae8..a7f767e9ac7 100644 --- a/reactos/lib/crtdll/makefile +++ b/reactos/lib/crtdll/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.50 2002/11/24 18:42:12 robd Exp $ +# $Id: makefile,v 1.51 2002/11/29 15:58:59 robd Exp $ PATH_TO_TOP = ../.. @@ -52,45 +52,45 @@ include $(TOOLS_PATH)/helper.mk CONIO_OBJECTS = \ - conio/cgets.o \ - conio/cprintf.o \ - conio/cputs.o \ - conio/cscanf.o \ - conio/getch.o \ - conio/getche.o \ - conio/kbhit.o \ - conio/putch.o \ - conio/ungetch.o + $(PATH_TO_MSVCRT)/conio/cgets.o \ + $(PATH_TO_MSVCRT)/conio/cprintf.o \ + $(PATH_TO_MSVCRT)/conio/cputs.o \ + $(PATH_TO_MSVCRT)/conio/cscanf.o \ + $(PATH_TO_MSVCRT)/conio/getch.o \ + $(PATH_TO_MSVCRT)/conio/getche.o \ + $(PATH_TO_MSVCRT)/conio/kbhit.o \ + $(PATH_TO_MSVCRT)/conio/putch.o \ + $(PATH_TO_MSVCRT)/conio/ungetch.o CTYPE_OBJECTS = \ - ctype/ctype.o \ - ctype/isalnum.o \ - ctype/isalpha.o \ - ctype/isascii.o \ - ctype/iscntrl.o \ - ctype/isdigit.o \ - ctype/isgraph.o \ - ctype/islower.o \ - ctype/isprint.o \ - ctype/ispunct.o \ - ctype/isspace.o \ - ctype/isupper.o \ - ctype/isxdigit.o \ - ctype/toascii.o \ - ctype/tolower.o \ - ctype/toupper.o \ - ctype/iscsym.o \ + $(PATH_TO_MSVCRT)/ctype/ctype.o \ + $(PATH_TO_MSVCRT)/ctype/isalnum.o \ + $(PATH_TO_MSVCRT)/ctype/isalpha.o \ + $(PATH_TO_MSVCRT)/ctype/isascii.o \ + $(PATH_TO_MSVCRT)/ctype/iscntrl.o \ + $(PATH_TO_MSVCRT)/ctype/isdigit.o \ + $(PATH_TO_MSVCRT)/ctype/isgraph.o \ + $(PATH_TO_MSVCRT)/ctype/islower.o \ + $(PATH_TO_MSVCRT)/ctype/isprint.o \ + $(PATH_TO_MSVCRT)/ctype/ispunct.o \ + $(PATH_TO_MSVCRT)/ctype/isspace.o \ + $(PATH_TO_MSVCRT)/ctype/isupper.o \ + $(PATH_TO_MSVCRT)/ctype/isxdigit.o \ + $(PATH_TO_MSVCRT)/ctype/toascii.o \ + $(PATH_TO_MSVCRT)/ctype/tolower.o \ + $(PATH_TO_MSVCRT)/ctype/toupper.o \ + $(PATH_TO_MSVCRT)/ctype/iscsym.o \ ctype/isctype.o DIRECT_OBJECTS = \ - direct/chdir.o \ - direct/chdrive.o \ - direct/getcwd.o \ - direct/getdcwd.o \ - direct/getdfree.o \ - direct/getdrive.o \ - direct/mkdir.o \ - direct/rmdir.o + $(PATH_TO_MSVCRT)/direct/chdir.o \ + $(PATH_TO_MSVCRT)/direct/chdrive.o \ + $(PATH_TO_MSVCRT)/direct/getcwd.o \ + $(PATH_TO_MSVCRT)/direct/getdcwd.o \ + $(PATH_TO_MSVCRT)/direct/getdfree.o \ + $(PATH_TO_MSVCRT)/direct/getdrive.o \ + $(PATH_TO_MSVCRT)/direct/mkdir.o \ + $(PATH_TO_MSVCRT)/direct/rmdir.o EXCEPT_OBJECTS = \ except/abnorter.o \ @@ -99,159 +99,159 @@ EXCEPT_OBJECTS = \ except/unwind.o FLOAT_OBJECTS = \ - float/chgsign.o \ - float/clearfp.o \ - float/cntrlfp.o \ - float/copysign.o \ - float/fpclass.o \ - float/fpreset.o \ - float/isnan.o \ - float/logb.o \ - float/nafter.o \ - float/scalb.o \ - float/statfp.o + $(PATH_TO_MSVCRT)/float/chgsign.o \ + $(PATH_TO_MSVCRT)/float/clearfp.o \ + $(PATH_TO_MSVCRT)/float/cntrlfp.o \ + $(PATH_TO_MSVCRT)/float/copysign.o \ + $(PATH_TO_MSVCRT)/float/fpclass.o \ + $(PATH_TO_MSVCRT)/float/fpreset.o \ + $(PATH_TO_MSVCRT)/float/isnan.o \ + $(PATH_TO_MSVCRT)/float/logb.o \ + $(PATH_TO_MSVCRT)/float/nafter.o \ + $(PATH_TO_MSVCRT)/float/scalb.o \ + $(PATH_TO_MSVCRT)/float/statfp.o IO_OBJECTS = \ - io/access.o \ - io/chmod.o \ - io/chsize.o \ - io/close.o \ - io/commit.o \ + $(PATH_TO_MSVCRT)/io/access.o \ + $(PATH_TO_MSVCRT)/io/chmod.o \ + $(PATH_TO_MSVCRT)/io/chsize.o \ + $(PATH_TO_MSVCRT)/io/close.o \ + $(PATH_TO_MSVCRT)/io/commit.o \ io/create.o \ io/dup.o \ - io/dup2.o \ + $(PATH_TO_MSVCRT)/io/dup2.o \ io/eof.o \ - io/filelen.o \ + $(PATH_TO_MSVCRT)/io/filelen.o \ io/find.o \ io/fmode.o \ - io/isatty.o \ - io/locking.o \ + $(PATH_TO_MSVCRT)/io/isatty.o \ + $(PATH_TO_MSVCRT)/io/locking.o \ io/lseek.o \ - io/mktemp.o \ + $(PATH_TO_MSVCRT)/io/mktemp.o \ io/open.o \ io/pipe.o \ io/read.o \ - io/setmode.o \ - io/sopen.o \ - io/tell.o \ - io/umask.o \ + $(PATH_TO_MSVCRT)/io/setmode.o \ + $(PATH_TO_MSVCRT)/io/sopen.o \ + $(PATH_TO_MSVCRT)/io/tell.o \ + $(PATH_TO_MSVCRT)/io/umask.o \ io/unlink.o \ - io/utime.o \ + $(PATH_TO_MSVCRT)/io/utime.o \ io/write.o LOCALE_OBJECTS = \ - locale/locale.o + $(PATH_TO_MSVCRT)/locale/locale.o MATH_OBJECTS = \ - math/acos.o \ + $(PATH_TO_MSVCRT)/math/acos.o \ math/acosh.o \ - math/asin.o \ + $(PATH_TO_MSVCRT)/math/asin.o \ math/asinh.o \ - math/atan.o \ - math/atan2.o\ + $(PATH_TO_MSVCRT)/math/atan.o \ + $(PATH_TO_MSVCRT)/math/atan2.o\ math/atanh.o \ - math/cabs.o \ + $(PATH_TO_MSVCRT)/math/cabs.o \ math/ceil.o \ - math/cos.o \ - math/cosh.o \ - math/exp.o \ - math/fabs.o\ + $(PATH_TO_MSVCRT)/math/cos.o \ + $(PATH_TO_MSVCRT)/math/cosh.o \ + $(PATH_TO_MSVCRT)/math/exp.o \ + $(PATH_TO_MSVCRT)/math/fabs.o\ math/floor.o \ - math/fmod.o \ - math/frexp.o \ - math/ftol.o \ + $(PATH_TO_MSVCRT)/math/fmod.o \ + $(PATH_TO_MSVCRT)/math/frexp.o \ + $(PATH_TO_MSVCRT)/math/ftol.o \ math/huge_val.o \ - math/hypot.o \ - math/j0_y0.o \ - math/j1_y1.o \ - math/jn_yn.o \ - math/ldexp.o \ - math/log.o \ - math/log10.o \ - math/modf.o \ - math/pow.o \ - math/sin.o \ - math/sinh.o \ - math/sqrt.o \ - math/stubs.o \ - math/tan.o \ - math/tanh.o + $(PATH_TO_MSVCRT)/math/hypot.o \ + $(PATH_TO_MSVCRT)/math/j0_y0.o \ + $(PATH_TO_MSVCRT)/math/j1_y1.o \ + $(PATH_TO_MSVCRT)/math/jn_yn.o \ + $(PATH_TO_MSVCRT)/math/ldexp.o \ + $(PATH_TO_MSVCRT)/math/log.o \ + $(PATH_TO_MSVCRT)/math/log10.o \ + $(PATH_TO_MSVCRT)/math/modf.o \ + $(PATH_TO_MSVCRT)/math/pow.o \ + $(PATH_TO_MSVCRT)/math/sin.o \ + $(PATH_TO_MSVCRT)/math/sinh.o \ + $(PATH_TO_MSVCRT)/math/sqrt.o \ + $(PATH_TO_MSVCRT)/math/stubs.o \ + $(PATH_TO_MSVCRT)/math/tan.o \ + $(PATH_TO_MSVCRT)/math/tanh.o MALLOC_OBJECTS = \ malloc/expand.o \ malloc/heap.o MBSTRING_OBJECTS = \ - mbstring/hanzen.o \ - mbstring/ischira.o \ - mbstring/iskana.o \ - mbstring/iskpun.o \ - mbstring/islead.o \ - mbstring/islwr.o \ - mbstring/iskmoji.o \ - mbstring/ismbal.o \ - mbstring/ismbaln.o \ - mbstring/ismbc.o \ - mbstring/ismbgra.o \ - mbstring/ismbkaln.o \ - mbstring/ismblead.o \ - mbstring/ismbpri.o \ - mbstring/ismbpun.o \ - mbstring/ismbtrl.o \ - mbstring/isuppr.o \ - mbstring/jistojms.o \ - mbstring/jmstojis.o \ - mbstring/mbbtype.o \ - mbstring/mbccpy.o \ - mbstring/mbclen.o \ - mbstring/mbscat.o \ - mbstring/mbschr.o \ - mbstring/mbscmp.o \ - mbstring/mbscoll.o \ - mbstring/mbscpy.o \ - mbstring/mbscspn.o \ - mbstring/mbsdec.o \ - mbstring/mbsdup.o \ - mbstring/mbsicmp.o \ - mbstring/mbsicoll.o \ - mbstring/mbsinc.o \ - mbstring/mbslen.o \ - mbstring/mbslwr.o \ - mbstring/mbsncat.o \ - mbstring/mbsnccnt.o \ - mbstring/mbsncmp.o \ - mbstring/mbsncoll.o \ - mbstring/mbsncpy.o \ - mbstring/mbsnextc.o \ - mbstring/mbsnicmp.o \ - mbstring/mbsnicoll.o \ - mbstring/mbsninc.o \ - mbstring/mbsnset.o \ - mbstring/mbspbrk.o \ - mbstring/mbsrchr.o \ - mbstring/mbsrev.o \ - mbstring/mbsset.o \ - mbstring/mbsspn.o \ - mbstring/mbsspnp.o \ - mbstring/mbsstr.o \ - mbstring/mbstok.o \ - mbstring/mbstrlen.o \ - mbstring/mbsupr.o + $(PATH_TO_MSVCRT)/mbstring/hanzen.o \ + $(PATH_TO_MSVCRT)/mbstring/ischira.o \ + $(PATH_TO_MSVCRT)/mbstring/iskana.o \ + $(PATH_TO_MSVCRT)/mbstring/iskpun.o \ + $(PATH_TO_MSVCRT)/mbstring/islead.o \ + $(PATH_TO_MSVCRT)/mbstring/islwr.o \ + $(PATH_TO_MSVCRT)/mbstring/iskmoji.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbal.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbaln.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbc.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbgra.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbkaln.o \ + $(PATH_TO_MSVCRT)/mbstring/ismblead.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbpri.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbpun.o \ + $(PATH_TO_MSVCRT)/mbstring/ismbtrl.o \ + $(PATH_TO_MSVCRT)/mbstring/isuppr.o \ + $(PATH_TO_MSVCRT)/mbstring/jistojms.o \ + $(PATH_TO_MSVCRT)/mbstring/jmstojis.o \ + $(PATH_TO_MSVCRT)/mbstring/mbbtype.o \ + $(PATH_TO_MSVCRT)/mbstring/mbccpy.o \ + $(PATH_TO_MSVCRT)/mbstring/mbclen.o \ + $(PATH_TO_MSVCRT)/mbstring/mbscat.o \ + $(PATH_TO_MSVCRT)/mbstring/mbschr.o \ + $(PATH_TO_MSVCRT)/mbstring/mbscmp.o \ + $(PATH_TO_MSVCRT)/mbstring/mbscoll.o \ + $(PATH_TO_MSVCRT)/mbstring/mbscpy.o \ + $(PATH_TO_MSVCRT)/mbstring/mbscspn.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsdec.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsdup.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsicmp.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsicoll.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsinc.o \ + $(PATH_TO_MSVCRT)/mbstring/mbslen.o \ + $(PATH_TO_MSVCRT)/mbstring/mbslwr.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsncat.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsnccnt.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsncmp.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsncoll.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsncpy.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsnextc.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsnicmp.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsnicoll.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsninc.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsnset.o \ + $(PATH_TO_MSVCRT)/mbstring/mbspbrk.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsrchr.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsrev.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsset.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsspn.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsspnp.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsstr.o \ + $(PATH_TO_MSVCRT)/mbstring/mbstok.o \ + $(PATH_TO_MSVCRT)/mbstring/mbstrlen.o \ + $(PATH_TO_MSVCRT)/mbstring/mbsupr.o MISC_OBJECTS = \ misc/amsg.o \ - misc/assert.o \ + $(PATH_TO_MSVCRT)/misc/assert.o \ misc/debug.o \ misc/dllmain.o \ misc/GetArgs.o \ - misc/initterm.o \ + $(PATH_TO_MSVCRT)/misc/initterm.o \ misc/purecall.o \ misc/setnew.o PROCESS_OBJECTS = \ process/_cwait.o \ process/_system.o\ - process/dll.o \ + $(PATH_TO_MSVCRT)/process/dll.o \ process/spawnl.o \ process/spawnlp.o \ process/spawnlpe.o \ @@ -267,9 +267,9 @@ PROCESS_OBJECTS = \ process/execv.o \ process/execle.o \ process/execve.o \ - process/procid.o \ + $(PATH_TO_MSVCRT)/process/procid.o \ process/thread.o \ - process/threadid.o + $(PATH_TO_MSVCRT)/process/threadid.o QUAD_OBJECTS = \ quad/qdivrem.o \ @@ -279,159 +279,159 @@ QUAD_OBJECTS = \ quad/umoddi3.o SEARCH_OBJECTS = \ - search/lfind.o \ - search/lsearch.o + $(PATH_TO_MSVCRT)/search/lfind.o \ + $(PATH_TO_MSVCRT)/search/lsearch.o SETJMP_OBJECTS = \ - setjmp/setjmp.o + $(PATH_TO_MSVCRT)/setjmp/setjmp.o SIGNAL_OBJECTS = \ signal/xcptfil.o \ signal/xcptinfo.o \ - signal/signal.o + $(PATH_TO_MSVCRT)/signal/signal.o STDIO_OBJECTS = \ - stdio/allocfil.o \ + $(PATH_TO_MSVCRT)/stdio/allocfil.o \ stdio/getenv.o \ - stdio/clearerr.o \ - stdio/fclose.o \ - stdio/fdopen.o \ - stdio/feof.o \ + $(PATH_TO_MSVCRT)/stdio/clearerr.o \ + $(PATH_TO_MSVCRT)/stdio/fclose.o \ + $(PATH_TO_MSVCRT)/stdio/fdopen.o \ + $(PATH_TO_MSVCRT)/stdio/feof.o \ stdio/ferror.o \ stdio/fflush.o \ - stdio/fgetc.o \ + $(PATH_TO_MSVCRT)/stdio/fgetc.o \ stdio/fgetchar.o \ - stdio/fgetpos.o \ + $(PATH_TO_MSVCRT)/stdio/fgetpos.o \ stdio/fgets.o \ stdio/filbuf.o \ stdio/fileno.o \ - stdio/flsbuf.o \ + $(PATH_TO_MSVCRT)/stdio/flsbuf.o \ stdio/fopen.o \ - stdio/fprintf.o \ - stdio/fputc.o \ + $(PATH_TO_MSVCRT)/stdio/fprintf.o \ + $(PATH_TO_MSVCRT)/stdio/fputc.o \ stdio/fputchar.o\ stdio/fputs.o \ stdio/fread.o \ stdio/freopen.o \ stdio/fscanf.o \ - stdio/fseek.o \ - stdio/fsetpos.o \ + $(PATH_TO_MSVCRT)/stdio/fseek.o \ + $(PATH_TO_MSVCRT)/stdio/fsetpos.o \ stdio/frlist.o \ stdio/fsopen.o \ stdio/ftell.o \ - stdio/fwalk.o \ + $(PATH_TO_MSVCRT)/stdio/fwalk.o \ stdio/fwrite.o \ stdio/getc.o \ stdio/getchar.o \ stdio/gets.o \ - stdio/getw.o \ + $(PATH_TO_MSVCRT)/stdio/getw.o \ stdio/perror.o \ stdio/popen.o \ stdio/printf.o \ stdio/putc.o \ stdio/putchar.o \ stdio/puts.o \ - stdio/putw.o \ + $(PATH_TO_MSVCRT)/stdio/putw.o \ stdio/remove.o \ - stdio/rename.o \ - stdio/rewind.o \ - stdio/rmtmp.o \ + $(PATH_TO_MSVCRT)/stdio/rename.o \ + $(PATH_TO_MSVCRT)/stdio/rewind.o \ + $(PATH_TO_MSVCRT)/stdio/rmtmp.o \ + stdio/scanf.o \ + $(PATH_TO_MSVCRT)/stdio/setbuf.o \ stdio/setbuffe.o \ - stdlib/obsol.o \ stdio/setlineb.o \ - stdio/scanf.o \ - stdio/setbuf.o \ - stdio/setvbuf.o \ - stdio/sprintf.o \ - stdio/sscanf.o \ - stdio/stdhnd.o \ + $(PATH_TO_MSVCRT)/stdio/setvbuf.o \ + $(PATH_TO_MSVCRT)/stdio/sprintf.o \ + $(PATH_TO_MSVCRT)/stdio/sscanf.o \ + $(PATH_TO_MSVCRT)/stdio/stdhnd.o \ stdio/stdiohk.o \ - stdio/tempnam.o \ - stdio/tmpfile.o \ - stdio/tmpnam.o \ - stdio/ungetc.o \ + $(PATH_TO_MSVCRT)/stdio/tempnam.o \ + $(PATH_TO_MSVCRT)/stdio/tmpfile.o \ + $(PATH_TO_MSVCRT)/stdio/tmpnam.o \ + $(PATH_TO_MSVCRT)/stdio/ungetc.o \ stdio/vfprintf.o \ stdio/vfscanf.o \ stdio/vfwprint.o \ - stdio/vprintf.o \ - stdio/vscanf.o \ - stdio/vsprintf.o \ - stdio/vsscanf.o + $(PATH_TO_MSVCRT)/stdio/vprintf.o \ + $(PATH_TO_MSVCRT)/stdio/vscanf.o \ + $(PATH_TO_MSVCRT)/stdio/vsprintf.o \ + $(PATH_TO_MSVCRT)/stdio/vsscanf.o STDLIB_OBJECTS = \ - stdlib/_exit.o \ - stdlib/abort.o \ - stdlib/abs.o \ - stdlib/atexit.o \ - stdlib/atof.o \ - stdlib/atoi.o \ - stdlib/atol.o \ - stdlib/bsearch.o \ - stdlib/div.o \ - stdlib/ecvt.o \ - stdlib/ecvtbuf.o \ + $(PATH_TO_MSVCRT)/stdlib/_exit.o \ + $(PATH_TO_MSVCRT)/stdlib/abort.o \ + $(PATH_TO_MSVCRT)/stdlib/abs.o \ + $(PATH_TO_MSVCRT)/stdlib/atexit.o \ + $(PATH_TO_MSVCRT)/stdlib/atof.o \ + $(PATH_TO_MSVCRT)/stdlib/atoi.o \ + $(PATH_TO_MSVCRT)/stdlib/atol.o \ + $(PATH_TO_MSVCRT)/stdlib/bsearch.o \ + $(PATH_TO_MSVCRT)/stdlib/div.o \ + $(PATH_TO_MSVCRT)/stdlib/ecvt.o \ + $(PATH_TO_MSVCRT)/stdlib/ecvtbuf.o \ stdlib/errno.o \ - stdlib/fcvt.o \ - stdlib/fcvtbuf.o \ + $(PATH_TO_MSVCRT)/stdlib/fcvt.o \ + $(PATH_TO_MSVCRT)/stdlib/fcvtbuf.o \ stdlib/fullpath.o \ - stdlib/gcvt.o \ - stdlib/itoa.o \ + $(PATH_TO_MSVCRT)/stdlib/gcvt.o \ + $(PATH_TO_MSVCRT)/stdlib/itoa.o \ stdlib/itow.o \ - stdlib/labs.o \ - stdlib/ldiv.o \ - stdlib/makepath.o \ + $(PATH_TO_MSVCRT)/stdlib/labs.o \ + $(PATH_TO_MSVCRT)/stdlib/ldiv.o \ + $(PATH_TO_MSVCRT)/stdlib/makepath.o \ stdlib/malloc.o \ stdlib/mbstowcs.o \ + $(PATH_TO_MSVCRT)/stdlib/obsol.o \ stdlib/putenv.o \ stdlib/qsort.o \ stdlib/rand.o \ - stdlib/rot.o \ - stdlib/senv.o \ - stdlib/splitp.o \ - stdlib/strtod.o \ - stdlib/strtol.o \ - stdlib/strtoul.o \ - stdlib/swab.o \ - stdlib/wcstomb.o \ + $(PATH_TO_MSVCRT)/stdlib/rot.o \ + $(PATH_TO_MSVCRT)/stdlib/senv.o \ + $(PATH_TO_MSVCRT)/stdlib/splitp.o \ + $(PATH_TO_MSVCRT)/stdlib/strtod.o \ + $(PATH_TO_MSVCRT)/stdlib/strtol.o \ + $(PATH_TO_MSVCRT)/stdlib/strtoul.o \ + $(PATH_TO_MSVCRT)/stdlib/swab.o \ + $(PATH_TO_MSVCRT)/stdlib/wcstomb.o \ STRING_OBJECTS = \ - string/memccpy.o \ - string/memchr.o \ - string/memcmp.o \ - string/memcpy.o \ - string/memicmp.o \ - string/memmove.o \ - string/memset.o \ - string/strcat.o \ - string/strchr.o \ - string/strcmp.o \ - string/strcoll.o \ - string/strcpy.o \ - string/strcspn.o \ - string/strdup.o \ + $(PATH_TO_MSVCRT)/string/memccpy.o \ + $(PATH_TO_MSVCRT)/string/memchr.o \ + $(PATH_TO_MSVCRT)/string/memcmp.o \ + $(PATH_TO_MSVCRT)/string/memcpy.o \ + $(PATH_TO_MSVCRT)/string/memicmp.o \ + $(PATH_TO_MSVCRT)/string/memmove.o \ + $(PATH_TO_MSVCRT)/string/memset.o \ + $(PATH_TO_MSVCRT)/string/strcat.o \ + $(PATH_TO_MSVCRT)/string/strchr.o \ + $(PATH_TO_MSVCRT)/string/strcmp.o \ + $(PATH_TO_MSVCRT)/string/strcoll.o \ + $(PATH_TO_MSVCRT)/string/strcpy.o \ + $(PATH_TO_MSVCRT)/string/strcspn.o \ + $(PATH_TO_MSVCRT)/string/strdup.o \ string/strerror.o \ - string/stricmp.o \ - string/strlen.o \ - string/strlwr.o \ - string/strncat.o \ - string/strncmp.o \ - string/strncpy.o \ - string/strnicmp.o \ - string/strnlen.o \ - string/strpbrk.o \ - string/strrchr.o \ - string/strrev.o \ - string/strset.o \ - string/strspn.o \ - string/strstr.o \ + $(PATH_TO_MSVCRT)/string/stricmp.o \ + $(PATH_TO_MSVCRT)/string/strlen.o \ + $(PATH_TO_MSVCRT)/string/strlwr.o \ + $(PATH_TO_MSVCRT)/string/strncat.o \ + $(PATH_TO_MSVCRT)/string/strncmp.o \ + $(PATH_TO_MSVCRT)/string/strncpy.o \ + $(PATH_TO_MSVCRT)/string/strnicmp.o \ + $(PATH_TO_MSVCRT)/string/strnlen.o \ + $(PATH_TO_MSVCRT)/string/strpbrk.o \ + $(PATH_TO_MSVCRT)/string/strrchr.o \ + $(PATH_TO_MSVCRT)/string/strrev.o \ + $(PATH_TO_MSVCRT)/string/strset.o \ + $(PATH_TO_MSVCRT)/string/strspn.o \ + $(PATH_TO_MSVCRT)/string/strstr.o \ string/strtok.o \ - string/strupr.o \ + $(PATH_TO_MSVCRT)/string/strupr.o \ string/str_old.o \ - string/strxfrm.o + $(PATH_TO_MSVCRT)/string/strxfrm.o SYS_STAT_OBJECTS = \ sys_stat/fstat.o \ - sys_stat/futime.o \ + $(PATH_TO_MSVCRT)/sys_stat/futime.o \ sys_stat/ftime.o \ sys_stat/systime.o \ sys_stat/stat.o @@ -445,13 +445,14 @@ TCHAR_OBJECTS = \ tchar/strspnp.o TIME_OBJECTS = \ - time/clock.o \ - time/ctime.o \ - time/difftime.o \ - time/strdate.o \ - time/strftime.o \ - time/strtime.o \ - time/time.o + $(PATH_TO_MSVCRT)/time/clock.o \ + $(PATH_TO_MSVCRT)/time/ctime.o \ + $(PATH_TO_MSVCRT)/time/difftime.o \ + $(PATH_TO_MSVCRT)/time/strdate.o \ + $(PATH_TO_MSVCRT)/time/strftime.o \ + $(PATH_TO_MSVCRT)/time/strtime.o \ + $(PATH_TO_MSVCRT)/time/time.o \ + time/tz_vars.o \ WSTRING_OBJECTS = \ $(PATH_TO_MSVCRT)/wstring/wcscat.o \ diff --git a/reactos/lib/crtdll/math/modf.c b/reactos/lib/crtdll/math/modf.c index 71b615172f6..336a7d712bf 100644 --- a/reactos/lib/crtdll/math/modf.c +++ b/reactos/lib/crtdll/math/modf.c @@ -20,7 +20,6 @@ double modf(double __x, double *__i) { - double_t * x = (double_t *)&__x; double_t * iptr = ( double_t *)__i; @@ -39,7 +38,7 @@ double modf(double __x, double *__i) return 0.0; } - i = (0x000fffff)>>j0; + i = (0x000fffff)>>j0; iptr->sign = x->sign; iptr->exponent = x->exponent; iptr->mantissah = x->mantissah&(~i); @@ -48,48 +47,43 @@ double modf(double __x, double *__i) __x = 0.0; x->sign = iptr->sign; return __x; - } - return __x - *__i; + } + return __x - *__i; } } else if (j0>51) { /* no fraction part */ - *__i = __x; - if ( _isnan(__x) || _isinf(__x) ) - return __x; - - - __x = 0.0; - x->sign = iptr->sign; + *__i = __x; + if ( _isnan(__x) || _isinf(__x) ) return __x; - } else { /* fraction part in low x */ + __x = 0.0; + x->sign = iptr->sign; + return __x; + } else { /* fraction part in low x */ - i = ((unsigned)(0xffffffff))>>(j0-20); - iptr->sign = x->sign; - iptr->exponent = x->exponent; - iptr->mantissah = x->mantissah; - iptr->mantissal = x->mantissal&(~i); - if ( __x == *__i ) { - __x = 0.0; - x->sign = iptr->sign; - return __x; - } - return __x - *__i; + i = ((unsigned)(0xffffffff))>>(j0-20); + iptr->sign = x->sign; + iptr->exponent = x->exponent; + iptr->mantissah = x->mantissah; + iptr->mantissal = x->mantissal&(~i); + if ( __x == *__i ) { + __x = 0.0; + x->sign = iptr->sign; + return __x; + } + return __x - *__i; } } long double modfl(long double __x, long double *__i) { - - long_double_t * x = (long_double_t *)&__x; long_double_t * iptr = (long_double_t *)__i; int j0; unsigned int i; j0 = x->exponent - 0x3fff; /* exponent of x */ - - + if(j0<32) { /* integer part in high x */ if(j0<0) { /* |x|<1 */ *__i = 0.0L; @@ -97,7 +91,7 @@ long double modfl(long double __x, long double *__i) return __x; } else { - i = ((unsigned int)(0xffffffff))>>(j0+1); + i = ((unsigned int)(0xffffffff))>>(j0+1); if ( x->mantissal == 0 && (x->mantissal & i) == 0 ) { *__i = __x; __x = 0.0L; @@ -106,36 +100,33 @@ long double modfl(long double __x, long double *__i) } iptr->sign = x->sign; iptr->exponent = x->exponent; - iptr->mantissah = x->mantissah&((~i)); + iptr->mantissah = x->mantissah&((~i)); iptr->mantissal = 0; - - return __x - *__i; + return __x - *__i; } } else if (j0>63) { /* no fraction part */ - *__i = __x; - if ( _isnanl(__x) || _isinfl(__x) ) - return __x; - - __x = 0.0L; - x->sign = iptr->sign; + *__i = __x; + if ( _isnanl(__x) || _isinfl(__x) ) return __x; + + __x = 0.0L; + x->sign = iptr->sign; + return __x; } else { /* fraction part in low x */ - i = ((unsigned int)(0xffffffff))>>(j0-32); - if ( x->mantissal == 0 ) { - *__i = __x; - __x = 0.0L; - x->sign = iptr->sign; - return __x; - } - iptr->sign = x->sign; - iptr->exponent = x->exponent; - iptr->mantissah = x->mantissah; - iptr->mantissal = x->mantissal&(~i); + i = ((unsigned int)(0xffffffff))>>(j0-32); + if ( x->mantissal == 0 ) { + *__i = __x; + __x = 0.0L; + x->sign = iptr->sign; + return __x; + } + iptr->sign = x->sign; + iptr->exponent = x->exponent; + iptr->mantissah = x->mantissah; + iptr->mantissal = x->mantissal&(~i); - return __x - *__i; - - + return __x - *__i; } } diff --git a/reactos/lib/crtdll/math/tanh.c b/reactos/lib/crtdll/math/tanh.c index a87337e9bc9..da1eabb8ace 100644 --- a/reactos/lib/crtdll/math/tanh.c +++ b/reactos/lib/crtdll/math/tanh.c @@ -1,4 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ + #include double tanh(double x) @@ -14,4 +15,3 @@ double tanh(double x) return (ebig - esmall) / (ebig + esmall); } } - diff --git a/reactos/lib/crtdll/mbstring/ismbc.c b/reactos/lib/crtdll/mbstring/ismbc.c index deed6531ced..a79edbd3eca 100644 --- a/reactos/lib/crtdll/mbstring/ismbc.c +++ b/reactos/lib/crtdll/mbstring/ismbc.c @@ -87,7 +87,6 @@ int _ismbclegal(unsigned int c) return _ismbbtrail(c&0xFF); return 0; - } int _ismbcl0(unsigned int c) diff --git a/reactos/lib/crtdll/mbstring/mbscoll.c b/reactos/lib/crtdll/mbstring/mbscoll.c index 062413f38ae..dad12be050b 100644 --- a/reactos/lib/crtdll/mbstring/mbscoll.c +++ b/reactos/lib/crtdll/mbstring/mbscoll.c @@ -54,6 +54,7 @@ int _mbscoll(const unsigned char *str1, const unsigned char *str2) return 0; } +#if 0 int _mbsbcoll(const unsigned char *str1, const unsigned char *str2) { unsigned char *s1 = (unsigned char *)str1; @@ -93,3 +94,4 @@ int _mbsbcoll(const unsigned char *str1, const unsigned char *str2) } ; return 0; } +#endif diff --git a/reactos/lib/crtdll/mbstring/mbscspn.c b/reactos/lib/crtdll/mbstring/mbscspn.c index 63f3f35dde4..46783ee21fc 100644 --- a/reactos/lib/crtdll/mbstring/mbscspn.c +++ b/reactos/lib/crtdll/mbstring/mbscspn.c @@ -1,4 +1,5 @@ #include + // not correct size_t _mbscspn(const unsigned char *s1, const unsigned char *s2) { diff --git a/reactos/lib/crtdll/mbstring/mbsicoll.c b/reactos/lib/crtdll/mbstring/mbsicoll.c index 426880ec3dd..32020cc8348 100644 --- a/reactos/lib/crtdll/mbstring/mbsicoll.c +++ b/reactos/lib/crtdll/mbstring/mbsicoll.c @@ -10,6 +10,7 @@ #include #include #include + int colldif(unsigned short c1, unsigned short c2); int _mbsicoll(const unsigned char *str1, const unsigned char *str2) { diff --git a/reactos/lib/crtdll/mbstring/mbsncpy.c b/reactos/lib/crtdll/mbstring/mbsncpy.c index a2e21c0b79c..2090c4873f8 100644 --- a/reactos/lib/crtdll/mbstring/mbsncpy.c +++ b/reactos/lib/crtdll/mbstring/mbsncpy.c @@ -10,6 +10,7 @@ #include + unsigned char *_mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n) { unsigned char *s1 = (unsigned char *)str1; @@ -43,6 +44,13 @@ unsigned char *_mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n return str1; } + +// +//The _mbsnbcpy function copies count bytes from src to dest. If src is shorter +//than dest, the string is padded with null characters. If dest is less than or +//equal to count it is not terminated with a null character. +// + unsigned char * _mbsnbcpy(unsigned char *str1, const unsigned char *str2, size_t n) { unsigned char *s1 = (unsigned char *)str1; @@ -54,8 +62,10 @@ unsigned char * _mbsnbcpy(unsigned char *str1, const unsigned char *str2, size_t return 0; do { - if (*s2 == 0) + if (*s2 == 0) { + *s1 = *s2; break; + } if ( !_ismbblead(*s2) ) { diff --git a/reactos/lib/crtdll/mbstring/mbsnextc.c b/reactos/lib/crtdll/mbstring/mbsnextc.c index 3c3a254106e..7a11cd519b6 100644 --- a/reactos/lib/crtdll/mbstring/mbsnextc.c +++ b/reactos/lib/crtdll/mbstring/mbsnextc.c @@ -2,7 +2,6 @@ unsigned int _mbsnextc (const unsigned char *src) { - unsigned char *char_src = (unsigned char *)src; unsigned short *short_src = (unsigned short *)src; @@ -14,5 +13,4 @@ unsigned int _mbsnextc (const unsigned char *src) else return *short_src; return 0; - } diff --git a/reactos/lib/crtdll/mbstring/mbsnicoll.c b/reactos/lib/crtdll/mbstring/mbsnicoll.c index 8697c75ef3c..3fead6d6a7b 100644 --- a/reactos/lib/crtdll/mbstring/mbsnicoll.c +++ b/reactos/lib/crtdll/mbstring/mbsnicoll.c @@ -4,6 +4,7 @@ int _mbsnicoll(const unsigned char *s1, const unsigned char *s2, size_t n) { return 0; } + int _mbsnbicoll(const unsigned char *s1, const unsigned char *s2, size_t n) { return 0; diff --git a/reactos/lib/crtdll/mbstring/mbsspn.c b/reactos/lib/crtdll/mbstring/mbsspn.c index 4a1bbd709e8..c9ca1ac6219 100644 --- a/reactos/lib/crtdll/mbstring/mbsspn.c +++ b/reactos/lib/crtdll/mbstring/mbsspn.c @@ -1,4 +1,5 @@ #include + // not correct size_t _mbsspn(const unsigned char *s1, const unsigned char *s2) { diff --git a/reactos/lib/crtdll/mbstring/mbsspnp.c b/reactos/lib/crtdll/mbstring/mbsspnp.c index 4e0e6e3d60d..37b8f368efa 100644 --- a/reactos/lib/crtdll/mbstring/mbsspnp.c +++ b/reactos/lib/crtdll/mbstring/mbsspnp.c @@ -1,4 +1,5 @@ #include + // not correct unsigned char * _mbsspnp(const unsigned char *s1, const unsigned char *s2) { diff --git a/reactos/lib/crtdll/process/procid.c b/reactos/lib/crtdll/process/procid.c index 6d8f8a6978f..a8616fbbdae 100644 --- a/reactos/lib/crtdll/process/procid.c +++ b/reactos/lib/crtdll/process/procid.c @@ -3,8 +3,6 @@ int _getpid (void) { - //fixme GetCurrentProcessId - //return (int)GetCurrentProcessId(); - return 1; + return (int)GetCurrentProcessId(); } diff --git a/reactos/lib/crtdll/process/thread.c b/reactos/lib/crtdll/process/thread.c index b6c0f95bdc0..be3b5684865 100644 --- a/reactos/lib/crtdll/process/thread.c +++ b/reactos/lib/crtdll/process/thread.c @@ -1,12 +1,16 @@ +/* $Id: thread.c,v 1.6 2002/11/29 15:59:01 robd Exp $ + * + */ #include -#include #include +#include #include -unsigned long - _beginthread (void (*pfuncStart)(void *), - unsigned unStackSize, void* pArgList) +unsigned long _beginthread( + void (*pfuncStart)(void*), + unsigned unStackSize, + void* pArgList) { DWORD ThreadId; HANDLE hThread; @@ -20,6 +24,7 @@ unsigned long } return (unsigned long)hThread; } + void _endthread(void) { //fixme ExitThread diff --git a/reactos/lib/crtdll/search/lfind.c b/reactos/lib/crtdll/search/lfind.c index 33be7189308..8bfa4584477 100644 --- a/reactos/lib/crtdll/search/lfind.c +++ b/reactos/lib/crtdll/search/lfind.c @@ -5,11 +5,11 @@ void *_lfind(const void *key, const void *base, size_t *nelp, size_t width, int (*compar)(const void *, const void *)) { - char *char_base = (char *)base; + char* char_base = (char*)base; int i; for (i = 0; i < *nelp; i++) { - if ( compar(key,char_base) == 0) + if (compar(key, char_base) == 0) return char_base; char_base += width; } diff --git a/reactos/lib/crtdll/stdio/fdopen.c b/reactos/lib/crtdll/stdio/fdopen.c index 3ef67699b8a..d543e257f31 100644 --- a/reactos/lib/crtdll/stdio/fdopen.c +++ b/reactos/lib/crtdll/stdio/fdopen.c @@ -3,6 +3,7 @@ FILE * __alloc_file(void); + FILE *_fdopen(int handle, char *mode) { FILE *file; @@ -51,4 +52,3 @@ FILE *_fdopen(int handle, char *mode) return file; } - diff --git a/reactos/lib/crtdll/stdio/fscanf.c b/reactos/lib/crtdll/stdio/fscanf.c index 5e04c6c45b2..1b2389894d7 100644 --- a/reactos/lib/crtdll/stdio/fscanf.c +++ b/reactos/lib/crtdll/stdio/fscanf.c @@ -17,13 +17,13 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #include #include #include +#include -int __vfscanf (FILE *s, const char *format, va_list argptr); /* Read formatted input from STREAM according to the format string FORMAT. */ /* VARARGS2 */ int fscanf(FILE *stream,const char *format, ...) @@ -57,4 +57,3 @@ fwscanf(FILE *stream, const wchar_t *fmt, ...) free(cf); return done; } - diff --git a/reactos/lib/crtdll/stdio/printf.c b/reactos/lib/crtdll/stdio/printf.c index 96a16e8dc5c..36cd1ae8466 100644 --- a/reactos/lib/crtdll/stdio/printf.c +++ b/reactos/lib/crtdll/stdio/printf.c @@ -16,7 +16,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include #include #include diff --git a/reactos/lib/crtdll/stdio/rewind.c b/reactos/lib/crtdll/stdio/rewind.c index 19f451d28b2..013e2fcc38a 100644 --- a/reactos/lib/crtdll/stdio/rewind.c +++ b/reactos/lib/crtdll/stdio/rewind.c @@ -12,5 +12,4 @@ void rewind(FILE *f) f->_cnt = 0; f->_ptr = f->_base; f->_flag &= ~(_IOERR|_IOEOF|_IOAHEAD); - } diff --git a/reactos/lib/crtdll/stdio/sprintf.c b/reactos/lib/crtdll/stdio/sprintf.c index 205697c93d4..8a27c85a84d 100644 --- a/reactos/lib/crtdll/stdio/sprintf.c +++ b/reactos/lib/crtdll/stdio/sprintf.c @@ -18,7 +18,7 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #include #include #include diff --git a/reactos/lib/crtdll/stdio/sscanf.c b/reactos/lib/crtdll/stdio/sscanf.c index 002070adb36..c0ccbb3759f 100644 --- a/reactos/lib/crtdll/stdio/sscanf.c +++ b/reactos/lib/crtdll/stdio/sscanf.c @@ -16,14 +16,13 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include #include #include #include +#include -int __vsscanf (const char *s,const char *format,va_list arg); - /* Read formatted input from S, according to the format string FORMAT. */ /* VARARGS2 */ int sscanf (const char *s,const char *format, ...) diff --git a/reactos/lib/crtdll/stdio/tempnam.c b/reactos/lib/crtdll/stdio/tempnam.c index a527ebda696..574dc4ffd3e 100644 --- a/reactos/lib/crtdll/stdio/tempnam.c +++ b/reactos/lib/crtdll/stdio/tempnam.c @@ -13,11 +13,12 @@ char *_tempnam(const char *dir,const char *prefix ) else d = (char *)dir; -#ifdef _MSVCRT_LIB_ +#ifdef _MSVCRT_LIB_ // TODO: check on difference? if (GetTempFileNameA(d, prefix, 1, TempFileName) == 0) { -#else +#else// TODO: FIXME: review which is correct if (GetTempFileNameA(d, prefix, 0, TempFileName) == 0) { #endif /*_MSVCRT_LIB_*/ + free(TempFileName); return NULL; } diff --git a/reactos/lib/crtdll/stdio/vprintf.c b/reactos/lib/crtdll/stdio/vprintf.c index 5ce0410ef5c..f7247499e96 100644 --- a/reactos/lib/crtdll/stdio/vprintf.c +++ b/reactos/lib/crtdll/stdio/vprintf.c @@ -16,7 +16,7 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #undef __OPTIMIZE__ /* Avoid inline `vprintf' function. */ #include #include diff --git a/reactos/lib/crtdll/stdio/vscanf.c b/reactos/lib/crtdll/stdio/vscanf.c index 3a6ef3d0508..4c6b7968964 100644 --- a/reactos/lib/crtdll/stdio/vscanf.c +++ b/reactos/lib/crtdll/stdio/vscanf.c @@ -16,11 +16,11 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #include #include +#include -int __vfscanf (FILE *s, const char *format, va_list argptr); #undef vscanf @@ -31,5 +31,4 @@ int __vscanf (const char *format, va_list arg) { return __vfscanf(stdin, format, arg); } -//weak_alias (__vscanf, vscanf) diff --git a/reactos/lib/crtdll/stdio/vsprintf.c b/reactos/lib/crtdll/stdio/vsprintf.c index 764020c6838..75bfb1d1197 100644 --- a/reactos/lib/crtdll/stdio/vsprintf.c +++ b/reactos/lib/crtdll/stdio/vsprintf.c @@ -1,6 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include -#include +#include #include #include diff --git a/reactos/lib/crtdll/stdlib/fullpath.c b/reactos/lib/crtdll/stdlib/fullpath.c index 873a49f95de..246cadf00c6 100644 --- a/reactos/lib/crtdll/stdlib/fullpath.c +++ b/reactos/lib/crtdll/stdlib/fullpath.c @@ -20,7 +20,7 @@ char* _fullpath(char* absPath, const char* relPath, size_t maxLength) { char* lpFilePart; - if (GetFullPathName(relPath,maxLength,absPath,&lpFilePart) == 0) + if (GetFullPathNameA(relPath,maxLength,absPath,&lpFilePart) == 0) return NULL; return absPath; diff --git a/reactos/lib/crtdll/stdlib/itow.c b/reactos/lib/crtdll/stdlib/itow.c index 38d600b646c..af83dc8ce94 100644 --- a/reactos/lib/crtdll/stdlib/itow.c +++ b/reactos/lib/crtdll/stdlib/itow.c @@ -1,4 +1,4 @@ -/* $Id: itow.c,v 1.2 2002/11/24 18:42:18 robd Exp $ +/* $Id: itow.c,v 1.3 2002/11/29 15:59:01 robd Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -131,9 +131,9 @@ wchar_t* _ultow(unsigned long value, wchar_t* string, int radix) } if (string == 0) { -#ifdef _MSVCRT_LIB_ +#ifdef _MSVCRT_LIB_ // TODO: check on difference? string = (wchar_t *)malloc(((tp-tmp)+1)*sizeof(wchar_t)); -#else +#else // TODO: FIXME: review which is correct string = (wchar_t *) malloc((tp - tmp) + sizeof(wchar_t)); #endif /*_MSVCRT_LIB_*/ } diff --git a/reactos/lib/crtdll/stdlib/makepath.c b/reactos/lib/crtdll/stdlib/makepath.c index cccae145f3a..8bb52311d50 100644 --- a/reactos/lib/crtdll/stdlib/makepath.c +++ b/reactos/lib/crtdll/stdlib/makepath.c @@ -1,4 +1,4 @@ -/* $Id: makepath.c,v 1.8 2002/11/24 18:42:18 robd Exp $ +/* $Id: makepath.c,v 1.9 2002/11/29 15:59:01 robd Exp $ */ #include #include diff --git a/reactos/lib/crtdll/stdlib/senv.c b/reactos/lib/crtdll/stdlib/senv.c index b996ef64e29..b87dcb65276 100644 --- a/reactos/lib/crtdll/stdlib/senv.c +++ b/reactos/lib/crtdll/stdlib/senv.c @@ -5,6 +5,7 @@ #define NDEBUG #include + void _searchenv(const char *file,const char *var,char *path ) { char *env = getenv(var); diff --git a/reactos/lib/crtdll/stdlib/splitp.c b/reactos/lib/crtdll/stdlib/splitp.c index e6709fdf15e..9d69349746e 100644 --- a/reactos/lib/crtdll/stdlib/splitp.c +++ b/reactos/lib/crtdll/stdlib/splitp.c @@ -1,6 +1,7 @@ #include #include + void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ext ) { char *tmp_drive; @@ -44,4 +45,3 @@ void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ex *(fname+(tmp_ext-path))=0; } } - diff --git a/reactos/lib/crtdll/string/memcpy.c b/reactos/lib/crtdll/string/memcpy.c index ebad8d92343..7b2dd74fcd3 100644 --- a/reactos/lib/crtdll/string/memcpy.c +++ b/reactos/lib/crtdll/string/memcpy.c @@ -3,11 +3,10 @@ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ -void * -memcpy (void *to, const void *from, size_t count) +void* memcpy(void* to, const void* from, size_t count) { - register char *f = (char *)from; - register char *t = (char *)to; + register char* f = (char*)from; + register char* t = (char*)to; register int i = count; while (i-- > 0) diff --git a/reactos/lib/crtdll/string/memset.c b/reactos/lib/crtdll/string/memset.c index 124b3a6fbd1..01164bf033f 100644 --- a/reactos/lib/crtdll/string/memset.c +++ b/reactos/lib/crtdll/string/memset.c @@ -1,11 +1,11 @@ #include -void * memset(void *src,int val,size_t count) +void* memset(void* src, int val, size_t count) { - char *char_src = (char *)src; + char* char_src = (char*)src; - while(count>0) { + while (count>0) { *char_src = val; char_src++; count--; diff --git a/reactos/lib/crtdll/string/strcmp.c b/reactos/lib/crtdll/string/strcmp.c index 9a0b8e7a357..52d3448f1d0 100644 --- a/reactos/lib/crtdll/string/strcmp.c +++ b/reactos/lib/crtdll/string/strcmp.c @@ -2,7 +2,7 @@ #include -int strcmp(const char *s1, const char *s2) +int strcmp(const char* s1, const char* s2) { while (*s1 == *s2) { @@ -11,5 +11,5 @@ int strcmp(const char *s1, const char *s2) s1++; s2++; } - return *(unsigned const char *)s1 - *(unsigned const char *)(s2); + return *(unsigned const char*)s1 - *(unsigned const char*)(s2); } diff --git a/reactos/lib/crtdll/string/strcoll.c b/reactos/lib/crtdll/string/strcoll.c index 3ecadce6fda..81e27d61164 100644 --- a/reactos/lib/crtdll/string/strcoll.c +++ b/reactos/lib/crtdll/string/strcoll.c @@ -6,25 +6,25 @@ less than, equal to or greater than the collated form of S2. */ #if 1 -int strcoll (const char* s1, const char* s2) +int strcoll(const char* s1, const char* s2) { - return strcmp(s1,s2); + return strcmp(s1, s2); } -int _stricoll (const char* s1, const char* s2) +int _stricoll(const char* s1, const char* s2) { - return _stricmp(s1,s2); + return _stricmp(s1, s2); } #else -int strcoll (const char *s1,const char *s2) +int strcoll (const char* s1,const char* s2) { - int ret; - ret = CompareStringA(LOCALE_USER_DEFAULT,0,s1,strlen(s1),s2,strlen(s2)); - if (ret == 0) - return 0; - else - return ret - 2; - return 0; + int ret; + ret = CompareStringA(LOCALE_USER_DEFAULT,0,s1,strlen(s1),s2,strlen(s2)); + if (ret == 0) + return 0; + else + return ret - 2; + return 0; } #endif diff --git a/reactos/lib/crtdll/string/strdup.c b/reactos/lib/crtdll/string/strdup.c index 0161c7f8bf8..a84de3667bf 100644 --- a/reactos/lib/crtdll/string/strdup.c +++ b/reactos/lib/crtdll/string/strdup.c @@ -1,8 +1,8 @@ - /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include #include + char *_strdup(const char *_s) { char *rv; diff --git a/reactos/lib/crtdll/string/strlen.c b/reactos/lib/crtdll/string/strlen.c index 808d96c8f62..a2995f87dd6 100644 --- a/reactos/lib/crtdll/string/strlen.c +++ b/reactos/lib/crtdll/string/strlen.c @@ -1,10 +1,10 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include -size_t -strlen(const char *str) + +size_t strlen(const char* str) { - const char *s; + const char* s; if (str == 0) return 0; diff --git a/reactos/lib/crtdll/string/strrev.c b/reactos/lib/crtdll/string/strrev.c index ef5ab94a482..d36b7a3dee7 100644 --- a/reactos/lib/crtdll/string/strrev.c +++ b/reactos/lib/crtdll/string/strrev.c @@ -1,6 +1,6 @@ #include -char * _strrev(char *s) +char * _strrev(char *s) { char *e; char a; diff --git a/reactos/lib/crtdll/string/strxfrm.c b/reactos/lib/crtdll/string/strxfrm.c index 0ebc3c5af23..ce76f9987a2 100644 --- a/reactos/lib/crtdll/string/strxfrm.c +++ b/reactos/lib/crtdll/string/strxfrm.c @@ -4,15 +4,14 @@ #if 1 size_t strxfrm( char *dest, const char *src, size_t n ) { - - + strncpy(dest, src, n); + return (strlen(dest)); } #else size_t strxfrm( char *dest, const char *src, size_t n ) { - int ret = LCMapStringA(LOCALE_USER_DEFAULT,LCMAP_LOWERCASE, - src, strlen(src), - dest, strlen(dest) ); + int ret = LCMapStringA(LOCALE_USER_DEFAULT,LCMAP_LOWERCASE, + src, strlen(src), dest, strlen(dest)); if ( ret == 0 ) return -1; diff --git a/reactos/lib/crtdll/time/clock.c b/reactos/lib/crtdll/time/clock.c index 33bb0b0f434..3b7745ae572 100644 --- a/reactos/lib/crtdll/time/clock.c +++ b/reactos/lib/crtdll/time/clock.c @@ -16,16 +16,14 @@ VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime ); clock_t clock ( void ) { - FILETIME CreationTime; - FILETIME ExitTime; - FILETIME KernelTime; - FILETIME UserTime; - - DWORD Remainder; + FILETIME CreationTime; + FILETIME ExitTime; + FILETIME KernelTime; + FILETIME UserTime; + DWORD Remainder; - if ( !GetProcessTimes(GetCurrentProcess(),&CreationTime,&ExitTime,&KernelTime,&UserTime ) ) - return -1; - + if (!GetProcessTimes(GetCurrentProcess(),&CreationTime,&ExitTime,&KernelTime,&UserTime)) + return -1; - return FileTimeToUnixTime( &KernelTime,&Remainder ) + FileTimeToUnixTime( &UserTime,&Remainder ); + return FileTimeToUnixTime(&KernelTime,&Remainder) + FileTimeToUnixTime(&UserTime,&Remainder); } diff --git a/reactos/lib/crtdll/time/ctime.c b/reactos/lib/crtdll/time/ctime.c index 354296f9758..ef5c1179b5f 100644 --- a/reactos/lib/crtdll/time/ctime.c +++ b/reactos/lib/crtdll/time/ctime.c @@ -29,10 +29,6 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; -#endif /* LIBC_SCCS and not lint */ - /* ** Leap second handling from Bradley White (bww@k.gp.cs.cmu.edu). ** POSIX-style TZ environment variable handling from Guy Harris @@ -53,6 +49,7 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; #include "posixrul.h" + #ifdef __cplusplus #define CPP_CONST const #else @@ -88,13 +85,8 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; ** that tzname[0] has the "normal" length of three characters). */ -#ifdef _MSVCRT_LIB_ -int _daylight; -int _timezone; -#else -int _daylight_dll; -int _timezone_dll; -#endif /*_MSVCRT_LIB_*/ +void _set_daylight_export(int); +void _set_timezone_export(int); static char WILDABBR[] = " "; @@ -229,12 +221,17 @@ settzname(void) _tzname[ttisp->tt_isdst] = (char *)&sp->chars[ttisp->tt_abbrind]; #if 0 - if (ttisp->tt_isdst) - _daylight = 1; - if (i == 0 || !ttisp->tt_isdst) - _timezone_dll = -(ttisp->tt_gmtoff); - if (i == 0 || ttisp->tt_isdst) + if (ttisp->tt_isdst) { + //_daylight = 1; + _set_daylight_export(1); + } + if (i == 0 || !ttisp->tt_isdst) { + //_timezone_dll = -(ttisp->tt_gmtoff); + _set_timezone_export(-(ttisp->tt_gmtoff)); + } + if (i == 0 || ttisp->tt_isdst) { _altzone = -(ttisp->tt_gmtoff); + } #endif } /* diff --git a/reactos/lib/crtdll/time/time.c b/reactos/lib/crtdll/time/time.c index c28af3f9db9..f7019fbaac6 100644 --- a/reactos/lib/crtdll/time/time.c +++ b/reactos/lib/crtdll/time/time.c @@ -19,10 +19,10 @@ #include #include + VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime ); -time_t -time(time_t *t) +time_t time(time_t* t) { FILETIME SystemTime; DWORD Remainder; diff --git a/reactos/lib/msvcrt/Makefile b/reactos/lib/msvcrt/Makefile index 98c0fae1153..451563d1a71 100644 --- a/reactos/lib/msvcrt/Makefile +++ b/reactos/lib/msvcrt/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.27 2002/11/25 17:41:39 robd Exp $ +# $Id: Makefile,v 1.28 2002/11/29 15:59:02 robd Exp $ PATH_TO_TOP = ../.. @@ -448,6 +448,7 @@ TIME_OBJECTS = \ time/strftime.o \ time/strtime.o \ time/time.o \ + time/tz_vars.o \ time/wctime.o \ time/wstrdate.o \ time/wstrtime.o diff --git a/reactos/lib/msvcrt/ctype/isalnum.c b/reactos/lib/msvcrt/ctype/isalnum.c index e4b7a11b2c2..6fed569aee3 100644 --- a/reactos/lib/msvcrt/ctype/isalnum.c +++ b/reactos/lib/msvcrt/ctype/isalnum.c @@ -13,11 +13,11 @@ #undef isalnum int isalnum(int c) { - return _isctype(c,_ALPHA | _DIGIT); + return _isctype(c, _ALPHA | _DIGIT); } #undef iswalnum int iswalnum(wint_t c) { - return iswctype(c,_ALPHA | _DIGIT); + return iswctype(c, _ALPHA | _DIGIT); } diff --git a/reactos/lib/msvcrt/ctype/isalpha.c b/reactos/lib/msvcrt/ctype/isalpha.c index a506197d363..13f71608c93 100644 --- a/reactos/lib/msvcrt/ctype/isalpha.c +++ b/reactos/lib/msvcrt/ctype/isalpha.c @@ -10,14 +10,16 @@ #include + #undef isalpha + int isalpha(int c) { - return _isctype(c,_ALPHA); + return _isctype(c, _ALPHA); } #undef iswalpha int iswalpha(wint_t c) { - return iswctype(c,_ALPHA); + return iswctype(c, _ALPHA); } diff --git a/reactos/lib/msvcrt/ctype/isascii.c b/reactos/lib/msvcrt/ctype/isascii.c index 0725ce3a6ce..72819e23766 100644 --- a/reactos/lib/msvcrt/ctype/isascii.c +++ b/reactos/lib/msvcrt/ctype/isascii.c @@ -12,10 +12,10 @@ int __isascii(int c) { - return (!((c)&(~0x7f))); + return (!((c)&(~0x7f))); } int iswascii(wint_t c) { - return __isascii(c); + return __isascii(c); } diff --git a/reactos/lib/msvcrt/ctype/iscntrl.c b/reactos/lib/msvcrt/ctype/iscntrl.c index f6a685e1aa4..cd51e8df5f6 100644 --- a/reactos/lib/msvcrt/ctype/iscntrl.c +++ b/reactos/lib/msvcrt/ctype/iscntrl.c @@ -1,14 +1,15 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include + #undef iscntrl int iscntrl(int c) { - return _isctype(c,_CONTROL); + return _isctype(c, _CONTROL); } #undef iswcntrl int iswcntrl(wint_t c) { - return iswctype(c,_CONTROL); + return iswctype(c, _CONTROL); } diff --git a/reactos/lib/msvcrt/ctype/iscsym.c b/reactos/lib/msvcrt/ctype/iscsym.c index 41a6da69790..0e91f7d6929 100644 --- a/reactos/lib/msvcrt/ctype/iscsym.c +++ b/reactos/lib/msvcrt/ctype/iscsym.c @@ -7,15 +7,15 @@ * UPDATE HISTORY: * 28/12/98: Created */ - #include + int __iscsymf(int c) { - return (isalpha(c) || ( c == '_' )); + return (isalpha(c) || ( c == '_' )) ; } int __iscsym(int c) { - return (isalnum(c) || ( c == '_' )); + return (isalnum(c) || ( c == '_' )) ; } diff --git a/reactos/lib/msvcrt/ctype/isdigit.c b/reactos/lib/msvcrt/ctype/isdigit.c index ae588e464cb..e84881d49a6 100644 --- a/reactos/lib/msvcrt/ctype/isdigit.c +++ b/reactos/lib/msvcrt/ctype/isdigit.c @@ -1,14 +1,15 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include + #undef isdigit int isdigit(int c) { - return _isctype(c,_DIGIT); + return _isctype(c, _DIGIT); } #undef iswdigit int iswdigit(wint_t c) { - return iswctype(c,_DIGIT); + return iswctype(c, _DIGIT); } diff --git a/reactos/lib/msvcrt/ctype/islower.c b/reactos/lib/msvcrt/ctype/islower.c index c3a917850a2..34cc31af140 100644 --- a/reactos/lib/msvcrt/ctype/islower.c +++ b/reactos/lib/msvcrt/ctype/islower.c @@ -1,13 +1,14 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include + #undef islower int islower(int c) { - return _isctype(c,_LOWER); + return _isctype(c, _LOWER); } int iswlower(wint_t c) { - return iswctype(c,_LOWER); + return iswctype(c, _LOWER); } diff --git a/reactos/lib/msvcrt/ctype/ispunct.c b/reactos/lib/msvcrt/ctype/ispunct.c index e26e3e86ec5..5a06ae4a16a 100644 --- a/reactos/lib/msvcrt/ctype/ispunct.c +++ b/reactos/lib/msvcrt/ctype/ispunct.c @@ -1,14 +1,15 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include + #undef ispunct int ispunct(int c) { - return _isctype(c,_PUNCT); + return _isctype(c, _PUNCT); } #undef iswpunct int iswpunct(wint_t c) { - return iswctype(c,_PUNCT); + return iswctype(c, _PUNCT); } diff --git a/reactos/lib/msvcrt/ctype/isspace.c b/reactos/lib/msvcrt/ctype/isspace.c index de47c1121d7..3bb9d32471b 100644 --- a/reactos/lib/msvcrt/ctype/isspace.c +++ b/reactos/lib/msvcrt/ctype/isspace.c @@ -7,8 +7,10 @@ * UPDATE HISTORY: * 28/12/98: Created */ + #include + #undef isspace int isspace(int c) { diff --git a/reactos/lib/msvcrt/ctype/isupper.c b/reactos/lib/msvcrt/ctype/isupper.c index 9898cb3dc1d..a7e67b242d2 100644 --- a/reactos/lib/msvcrt/ctype/isupper.c +++ b/reactos/lib/msvcrt/ctype/isupper.c @@ -1,13 +1,14 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include + #undef isupper int isupper(int c) { - return _isctype(c,_UPPER); + return _isctype(c, _UPPER); } int iswupper(wint_t c) { - return iswctype(c,_UPPER); + return iswctype(c, _UPPER); } diff --git a/reactos/lib/msvcrt/ctype/isxdigit.c b/reactos/lib/msvcrt/ctype/isxdigit.c index 9c24dda454a..63f8464261a 100644 --- a/reactos/lib/msvcrt/ctype/isxdigit.c +++ b/reactos/lib/msvcrt/ctype/isxdigit.c @@ -1,15 +1,16 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include + #undef isxdigit int isxdigit(int c) { - return _isctype(c,_HEX); + return _isctype(c, _HEX); } #undef iswxdigit int iswxdigit(wint_t c) { - return iswctype(c,_HEX); + return iswctype(c, _HEX); } diff --git a/reactos/lib/msvcrt/ctype/toascii.c b/reactos/lib/msvcrt/ctype/toascii.c index 16d959bcec1..f26d5afe3b6 100644 --- a/reactos/lib/msvcrt/ctype/toascii.c +++ b/reactos/lib/msvcrt/ctype/toascii.c @@ -5,5 +5,5 @@ int __toascii(int c) { - return ((unsigned)(c) & 0x7F ); + return((unsigned)(c) & 0x7F); } diff --git a/reactos/lib/msvcrt/except/matherr.c b/reactos/lib/msvcrt/except/matherr.c index a87868da63c..01de05c38fc 100644 --- a/reactos/lib/msvcrt/except/matherr.c +++ b/reactos/lib/msvcrt/except/matherr.c @@ -1,28 +1,35 @@ +#include +#include + + struct _exception { - int type; - char *name; - double arg1; - double arg2; - double retval; - } ; - -int _matherr(struct _exception *e) + int type; + char* name; + double arg1; + double arg2; + double retval; +} ; + + +int _matherr(struct _exception* e) { return 0; } + // not exported by NTDLL -void __setusermatherr(int (* handler)(struct _exception *)) +void __setusermatherr(int (*handler)(struct _exception*)) { } + #define _FPIEEE_RECORD void int _fpieee_flt( unsigned long exception_code, - struct _EXCEPTION_POINTERS *ExceptionPointer, - int (* handler)(_FPIEEE_RECORD *) + struct _EXCEPTION_POINTERS* ExceptionPointer, + int (*handler)(_FPIEEE_RECORD*) ) { return 0; diff --git a/reactos/lib/msvcrt/float/chgsign.c b/reactos/lib/msvcrt/float/chgsign.c index 0fb4072de39..a8588a66d9a 100644 --- a/reactos/lib/msvcrt/float/chgsign.c +++ b/reactos/lib/msvcrt/float/chgsign.c @@ -1,9 +1,11 @@ #include #include + double _chgsign( double __x ) { double_t *x = (double_t *)&x; + if ( x->sign == 1 ) x->sign = 0; else diff --git a/reactos/lib/msvcrt/float/fpclass.c b/reactos/lib/msvcrt/float/fpclass.c index d4c280a09fe..5401aa14623 100644 --- a/reactos/lib/msvcrt/float/fpclass.c +++ b/reactos/lib/msvcrt/float/fpclass.c @@ -2,6 +2,7 @@ #include #include + #define _FPCLASS_SNAN 0x0001 /* signaling NaN */ #define _FPCLASS_QNAN 0x0002 /* quiet NaN */ #define _FPCLASS_NINF 0x0004 /* negative infinity */ @@ -58,8 +59,5 @@ fpclass_t _fpclass(double __d) } } - return 0; } - - diff --git a/reactos/lib/msvcrt/float/fpreset.c b/reactos/lib/msvcrt/float/fpreset.c index 4127159174d..59902e425ad 100644 --- a/reactos/lib/msvcrt/float/fpreset.c +++ b/reactos/lib/msvcrt/float/fpreset.c @@ -1,5 +1,6 @@ #include + void _fpreset(void) { /* FIXME: This causes an exception */ diff --git a/reactos/lib/msvcrt/float/isnan.c b/reactos/lib/msvcrt/float/isnan.c index 6cff15b7d35..27d810c3c26 100644 --- a/reactos/lib/msvcrt/float/isnan.c +++ b/reactos/lib/msvcrt/float/isnan.c @@ -20,6 +20,7 @@ Cambridge, MA 02139, USA. */ #include #include + int _isnan(double __x) { double_t * x = (double_t *)&__x; @@ -28,7 +29,6 @@ int _isnan(double __x) int _isnanl(long double __x) { - /* Intel's extended format has the normally implicit 1 explicit present. Sigh! */ @@ -43,15 +43,12 @@ int _isnanl(long double __x) && ( (x->mantissah & (unsigned int)0x7fffffff) != 0 || x->mantissal != 0 )); } - int _isinf(double __x) { double_t * x = (double_t *)&__x; return ( x->exponent == 0x7ff && ( x->mantissah == 0 && x->mantissal == 0 )); } - - int _finite( double x ) { return !_isinf(x); @@ -73,5 +70,3 @@ int _isinfl(long double __x) return x->sign ? -1 : 1; return 0; } - - diff --git a/reactos/lib/msvcrt/float/nafter.c b/reactos/lib/msvcrt/float/nafter.c index 9773d92b546..a8bd0347c1b 100644 --- a/reactos/lib/msvcrt/float/nafter.c +++ b/reactos/lib/msvcrt/float/nafter.c @@ -1,5 +1,6 @@ #include + double _nextafter( double x, double y ) { if ( x == y) diff --git a/reactos/lib/msvcrt/io/locking.c b/reactos/lib/msvcrt/io/locking.c index ba3283014e8..90121837a2d 100644 --- a/reactos/lib/msvcrt/io/locking.c +++ b/reactos/lib/msvcrt/io/locking.c @@ -1,10 +1,12 @@ #include #include + int _locking(int _fd, int mode, long nbytes) { long offset = _lseek(_fd, 0L, 1); if (!LockFile(_get_osfhandle(_fd),offset,0,nbytes,0)) return -1; + return 0; } diff --git a/reactos/lib/msvcrt/math/acos.c b/reactos/lib/msvcrt/math/acos.c index 9bde5e95b0a..23376a6116c 100644 --- a/reactos/lib/msvcrt/math/acos.c +++ b/reactos/lib/msvcrt/math/acos.c @@ -20,7 +20,8 @@ #include -double acos (double __x) + +double acos(double __x) { - return atan2 (sqrt (1.0 - __x * __x), __x); + return atan2(sqrt(1.0 - __x * __x), __x); } diff --git a/reactos/lib/msvcrt/math/asin.c b/reactos/lib/msvcrt/math/asin.c index 5f912baead1..fa57df2850c 100644 --- a/reactos/lib/msvcrt/math/asin.c +++ b/reactos/lib/msvcrt/math/asin.c @@ -20,7 +20,8 @@ #include -double asin (double __x) + +double asin(double __x) { - return atan2 (__x, sqrt (1.0 - __x * __x)); + return atan2(__x, sqrt(1.0 - __x * __x)); } diff --git a/reactos/lib/msvcrt/math/cosh.c b/reactos/lib/msvcrt/math/cosh.c index 1f89a0ead5b..10fadd67ec2 100644 --- a/reactos/lib/msvcrt/math/cosh.c +++ b/reactos/lib/msvcrt/math/cosh.c @@ -1,8 +1,9 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include + double cosh(double x) { - const double ebig = exp(fabs(x)); - return (ebig + 1.0/ebig) / 2.0; + const double ebig = exp(fabs(x)); + return (ebig + 1.0/ebig) / 2.0; } diff --git a/reactos/lib/msvcrt/math/frexp.c b/reactos/lib/msvcrt/math/frexp.c index 27de8a366e3..b85cd98da04 100644 --- a/reactos/lib/msvcrt/math/frexp.c +++ b/reactos/lib/msvcrt/math/frexp.c @@ -5,14 +5,15 @@ double frexp(double __x, int *exptr) { - double_t *x = (double_t *)&__x; - - if (exptr != NULL) - *exptr = x->exponent - 0x3FE; - - x->exponent = 0x3FE; - - return __x; + double_t *x = (double_t *)&__x; + + if ( exptr != NULL ) + *exptr = x->exponent - 0x3FE; + + + x->exponent = 0x3FE; + + return __x; } diff --git a/reactos/lib/msvcrt/math/ftol.c b/reactos/lib/msvcrt/math/ftol.c index dfa334624e6..17530906fe5 100644 --- a/reactos/lib/msvcrt/math/ftol.c +++ b/reactos/lib/msvcrt/math/ftol.c @@ -2,5 +2,5 @@ long _ftol(double fl) { - return (long)fl; + return (long)fl; } diff --git a/reactos/lib/msvcrt/math/j0_y0.c b/reactos/lib/msvcrt/math/j0_y0.c index db89a92acaa..83035eea002 100644 --- a/reactos/lib/msvcrt/math/j0_y0.c +++ b/reactos/lib/msvcrt/math/j0_y0.c @@ -1,12 +1,12 @@ #include -double _j0(double x) + +double _j0(double x) { - return x; + return x; } -double _y0(double x) +double _y0(double x) { - return x; + return x; } - diff --git a/reactos/lib/msvcrt/math/j1_y1.c b/reactos/lib/msvcrt/math/j1_y1.c index fa0f618f3fd..55d6bd62a6f 100644 --- a/reactos/lib/msvcrt/math/j1_y1.c +++ b/reactos/lib/msvcrt/math/j1_y1.c @@ -1,11 +1,12 @@ #include -double _j1(double x) + +double _j1(double x) { - return x; + return x; } -double _y1(double x) +double _y1(double x) { - return x; + return x; } diff --git a/reactos/lib/msvcrt/math/jn_yn.c b/reactos/lib/msvcrt/math/jn_yn.c index a953e80215f..8a3c833ad24 100644 --- a/reactos/lib/msvcrt/math/jn_yn.c +++ b/reactos/lib/msvcrt/math/jn_yn.c @@ -1,5 +1,6 @@ #include + double _jn(int n, double x) { return x; diff --git a/reactos/lib/msvcrt/math/stubs.c b/reactos/lib/msvcrt/math/stubs.c index a43b9fc9ca2..57eb090db01 100644 --- a/reactos/lib/msvcrt/math/stubs.c +++ b/reactos/lib/msvcrt/math/stubs.c @@ -1,84 +1,85 @@ #include -double _CIsin (double x); -double _CIcos (double x); -double _CItan (double x); -double _CIsinh (double x); -double _CIcosh (double x); -double _CItanh (double x); -double _CIasin (double x); -double _CIacos (double x); -double _CIatan (double x); -double _CIatan2 (double y, double x); -double _CIexp (double x); -double _CIlog (double x); -double _CIlog10 (double x); -double _CIpow (double x, double y); -double _CIsqrt (double x); -double _CIfmod (double x, double y); +double _CIsin(double x); +double _CIcos(double x); +double _CItan(double x); +double _CIsinh(double x); +double _CIcosh(double x); +double _CItanh(double x); +double _CIasin(double x); +double _CIacos(double x); +double _CIatan(double x); +double _CIatan2(double y, double x); +double _CIexp(double x); +double _CIlog(double x); +double _CIlog10(double x); +double _CIpow(double x, double y); +double _CIsqrt(double x); +double _CIfmod(double x, double y); -double _CIsin (double x) + +double _CIsin(double x) { return sin(x); } -double _CIcos (double x) +double _CIcos(double x) { return cos(x); } -double _CItan (double x) +double _CItan(double x) { return tan(x); } -double _CIsinh (double x) +double _CIsinh(double x) { return sinh(x); } -double _CIcosh (double x) +double _CIcosh(double x) { return cosh(x); } -double _CItanh (double x) +double _CItanh(double x) { return tanh(x); } -double _CIasin (double x) +double _CIasin(double x) { return asin(x); } -double _CIacos (double x) +double _CIacos(double x) { return acos(x); } -double _CIatan (double x) +double _CIatan(double x) { return atan(x); } -double _CIatan2 (double y, double x) +double _CIatan2(double y, double x) { - return atan2(y,x); + return atan2(y, x); } -double _CIexp (double x) +double _CIexp(double x) { return exp(x); } -double _CIlog (double x) +double _CIlog(double x) { return log(x); } -double _CIlog10 (double x) +double _CIlog10(double x) { return log10(x); } -double _CIpow (double x, double y) +double _CIpow(double x, double y) { - return pow(x,y); + return pow(x, y); } -double _CIsqrt (double x) +double _CIsqrt(double x) { return sqrt(x); } -double _CIfmod (double x, double y) +double _CIfmod(double x, double y) { - return fmod(x,y); + return fmod(x, y); } diff --git a/reactos/lib/msvcrt/mbstring/ischira.c b/reactos/lib/msvcrt/mbstring/ischira.c index 5cd46957e65..38415646010 100644 --- a/reactos/lib/msvcrt/mbstring/ischira.c +++ b/reactos/lib/msvcrt/mbstring/ischira.c @@ -11,6 +11,7 @@ #include #include + int _ismbchira( unsigned int c ) { return ((c>=0x829F) && (c<=0x82F1)); diff --git a/reactos/lib/msvcrt/mbstring/iskmoji.c b/reactos/lib/msvcrt/mbstring/iskmoji.c index a8cc1745bf8..88ac598a9cb 100644 --- a/reactos/lib/msvcrt/mbstring/iskmoji.c +++ b/reactos/lib/msvcrt/mbstring/iskmoji.c @@ -3,4 +3,4 @@ int _ismbbkalpha(unsigned char c) { return (0xA7 <= c <= 0xDF); -} \ No newline at end of file +} diff --git a/reactos/lib/msvcrt/mbstring/ismbpun.c b/reactos/lib/msvcrt/mbstring/ismbpun.c index 171b1a40b45..eebe521203c 100644 --- a/reactos/lib/msvcrt/mbstring/ismbpun.c +++ b/reactos/lib/msvcrt/mbstring/ismbpun.c @@ -1,14 +1,15 @@ - //iskana() :(0xA1 <= c <= 0xDF) - //iskpun() :(0xA1 <= c <= 0xA6) - //iskmoji() :(0xA7 <= c <= 0xDF) #include #include #include + int _ismbbpunct(unsigned char c) { // (0xA1 <= c <= 0xA6) return (ispunct(c) || _ismbbkana(c)); } + //iskana() :(0xA1 <= c <= 0xDF) + //iskpun() :(0xA1 <= c <= 0xA6) + //iskmoji() :(0xA7 <= c <= 0xDF) diff --git a/reactos/lib/msvcrt/mbstring/mbsncat.c b/reactos/lib/msvcrt/mbstring/mbsncat.c index 146842bb82d..329b94c0536 100644 --- a/reactos/lib/msvcrt/mbstring/mbsncat.c +++ b/reactos/lib/msvcrt/mbstring/mbsncat.c @@ -56,4 +56,3 @@ unsigned char * _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t n } return dst; } - diff --git a/reactos/lib/msvcrt/mbstring/mbsncpy.c b/reactos/lib/msvcrt/mbstring/mbsncpy.c index d1cde620017..96d600f296b 100644 --- a/reactos/lib/msvcrt/mbstring/mbsncpy.c +++ b/reactos/lib/msvcrt/mbstring/mbsncpy.c @@ -10,7 +10,8 @@ #include -unsigned char *_mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n) + +unsigned char* _mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n) { unsigned char *s1 = (unsigned char *)str1; unsigned char *s2 = (unsigned char *)str2; @@ -43,6 +44,13 @@ unsigned char *_mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n return str1; } + +// +//The _mbsnbcpy function copies count bytes from src to dest. If src is shorter +//than dest, the string is padded with null characters. If dest is less than or +//equal to count it is not terminated with a null character. +// + unsigned char * _mbsnbcpy(unsigned char *str1, const unsigned char *str2, size_t n) { unsigned char *s1 = (unsigned char *)str1; @@ -54,8 +62,10 @@ unsigned char * _mbsnbcpy(unsigned char *str1, const unsigned char *str2, size_t return 0; do { - if (*s2 == 0) + if (*s2 == 0) { + *s1 = *s2; break; + } if ( !_ismbblead(*s2) ) { diff --git a/reactos/lib/msvcrt/mbstring/mbsnicmp.c b/reactos/lib/msvcrt/mbstring/mbsnicmp.c index ef34bd15959..27bfbfd4d49 100644 --- a/reactos/lib/msvcrt/mbstring/mbsnicmp.c +++ b/reactos/lib/msvcrt/mbstring/mbsnicmp.c @@ -1,8 +1,10 @@ #include + size_t _mbclen2(const unsigned int s); unsigned int _mbbtoupper(unsigned int c); + int _mbsnicmp(const unsigned char *s1, const unsigned char *s2, size_t n) { if (n == 0) @@ -37,4 +39,3 @@ int _mbsnbicmp(const unsigned char *s1, const unsigned char *s2, size_t n) } while (n > 0); return 0; } - diff --git a/reactos/lib/msvcrt/mbstring/mbspbrk.c b/reactos/lib/msvcrt/mbstring/mbspbrk.c index f9566e7dd26..0e36d10e1fc 100644 --- a/reactos/lib/msvcrt/mbstring/mbspbrk.c +++ b/reactos/lib/msvcrt/mbstring/mbspbrk.c @@ -1,5 +1,4 @@ #include - // not correct unsigned char * _mbspbrk(const unsigned char *s1, const unsigned char *s2) { diff --git a/reactos/lib/msvcrt/mbstring/mbsupr.c b/reactos/lib/msvcrt/mbstring/mbsupr.c index 8f8ac5b755f..6027eef714c 100644 --- a/reactos/lib/msvcrt/mbstring/mbsupr.c +++ b/reactos/lib/msvcrt/mbstring/mbsupr.c @@ -48,4 +48,3 @@ unsigned char * _mbsupr(unsigned char *x) } return x; } - diff --git a/reactos/lib/msvcrt/misc/assert.c b/reactos/lib/msvcrt/misc/assert.c index 59b3bbdafa6..31704ea5e67 100644 --- a/reactos/lib/msvcrt/misc/assert.c +++ b/reactos/lib/msvcrt/misc/assert.c @@ -4,6 +4,7 @@ #include #include + void _assert(const char *msg, const char *file, int line) { /* Assertion failed at foo.c line 45: x #include + int _cwait(int* pnStatus, int hProc, int nAction) { - DWORD ExitCode; + DWORD ExitCode; - nAction = 0; - if (WaitForSingleObject((void *)hProc,INFINITE) != WAIT_OBJECT_0) { - __set_errno(ECHILD); - return -1; - } + nAction = 0; + if (WaitForSingleObject((void*)hProc, INFINITE) != WAIT_OBJECT_0) { + __set_errno(ECHILD); + return -1; + } - if (!GetExitCodeProcess((void *)hProc,&ExitCode)) - return -1; - if (pnStatus != NULL) - *pnStatus = (int)ExitCode; - CloseHandle((HANDLE)hProc); - return hProc; + if (!GetExitCodeProcess((void*)hProc, &ExitCode)) + return -1; + if (pnStatus != NULL) + *pnStatus = (int)ExitCode; + CloseHandle((HANDLE)hProc); + return hProc; } diff --git a/reactos/lib/msvcrt/process/dll.c b/reactos/lib/msvcrt/process/dll.c index ccb3c2ab1c2..565e4662697 100644 --- a/reactos/lib/msvcrt/process/dll.c +++ b/reactos/lib/msvcrt/process/dll.c @@ -11,21 +11,22 @@ #include #include -void *_loaddll (char *name) + +void* _loaddll(char* name) { return LoadLibraryA(name); } -int _unloaddll(void *handle) +int _unloaddll(void* handle) { return FreeLibrary(handle); } -FARPROC _getdllprocaddr(void *hModule,char * lpProcName, int iOrdinal) +FARPROC _getdllprocaddr(void* hModule, char* lpProcName, int iOrdinal) { - if ( lpProcName != NULL ) + if (lpProcName != NULL) return GetProcAddress(hModule, lpProcName); else return GetProcAddress(hModule, (LPSTR)iOrdinal); - return (NULL); + return (NULL); } diff --git a/reactos/lib/msvcrt/process/thread.c b/reactos/lib/msvcrt/process/thread.c index d904bfc8c19..373d5351f1b 100644 --- a/reactos/lib/msvcrt/process/thread.c +++ b/reactos/lib/msvcrt/process/thread.c @@ -1,45 +1,22 @@ -/* $Id: thread.c,v 1.4 2002/09/08 10:22:54 chorns Exp $ +/* $Id: thread.c,v 1.5 2002/11/29 15:59:04 robd Exp $ * */ #include #include #include -unsigned long -_beginthread ( - void ( __cdecl * start_address ) (void *), - unsigned stack_size, - void * arglist - ) -{ - errno = ENOSYS; - return (unsigned long) -1; -} - -unsigned long -_beginthreadex ( - void * security, - unsigned stack_size, - unsigned ( __stdcall * start_address ) (void *), - void * arglist, - unsigned initflag, - unsigned * thrdaddr - ) +unsigned long _beginthread( + void (__cdecl *start_address)(void*), + unsigned stack_size, + void* arglist) { - errno = ENOSYS; - return (unsigned long) -1; + errno = ENOSYS; + return (unsigned long)-1; } - -void _endthread (void) +void _endthread(void) { } - -void _endthreadex (unsigned retval) -{ -} - - /* EOF */ diff --git a/reactos/lib/msvcrt/search/lfind.c b/reactos/lib/msvcrt/search/lfind.c index 4aba8d366f2..8bfa4584477 100644 --- a/reactos/lib/msvcrt/search/lfind.c +++ b/reactos/lib/msvcrt/search/lfind.c @@ -5,14 +5,14 @@ void *_lfind(const void *key, const void *base, size_t *nelp, size_t width, int (*compar)(const void *, const void *)) { - char *char_base = (char *)base; - int i; + char* char_base = (char*)base; + int i; - for (i = 0; i < *nelp; i++) { - if (compar(key,char_base) == 0) - return char_base; - char_base += width; - } - return NULL; + for (i = 0; i < *nelp; i++) { + if (compar(key, char_base) == 0) + return char_base; + char_base += width; + } + return NULL; } diff --git a/reactos/lib/msvcrt/stdlib/mbstowcs.c b/reactos/lib/msvcrt/stdlib/mbstowcs.c index 840662c6ea4..39923b6390e 100644 --- a/reactos/lib/msvcrt/stdlib/mbstowcs.c +++ b/reactos/lib/msvcrt/stdlib/mbstowcs.c @@ -3,6 +3,9 @@ size_t mbstowcs( wchar_t *wcstr, const char *mbstr, size_t count ) { size_t Size; + return (size_t)Size; +} + /* NTSTATUS Status; ULONG Size; @@ -27,8 +30,6 @@ size_t mbstowcs( wchar_t *wcstr, const char *mbstr, size_t count ) if (!NT_SUCCESS(Status)) return -1; */ - return (size_t)Size; -} //int mbtowc( wchar_t *wchar, const char *mbchar, size_t count ) //{ diff --git a/reactos/lib/msvcrt/stdlib/mbtowc.c b/reactos/lib/msvcrt/stdlib/mbtowc.c index e808ed97868..e7f0d025ccc 100644 --- a/reactos/lib/msvcrt/stdlib/mbtowc.c +++ b/reactos/lib/msvcrt/stdlib/mbtowc.c @@ -1,16 +1,6 @@ #include -//int mblen (const char* mbs, size_t sizeString) -//{ -// return 0; -//} - -//size_t mbstowcs (wchar_t* wcaDest, const char* mbsConvert, size_t size) -//{ -// return 0; -//} - //int mbtowc(wchar_t* wcDest, const char* mbConvert, size_t size) int mbtowc(wchar_t *wchar, const char *mbchar, size_t count) { @@ -19,31 +9,4 @@ int mbtowc(wchar_t *wchar, const char *mbchar, size_t count) // WideCharToMultiByte // MultiByteToWideChar -/* -int MultiByteToWideChar( - UINT CodePage, // code page - DWORD dwFlags, // character-type options - LPCSTR lpMultiByteStr, // string to map - int cbMultiByte, // number of bytes in string - LPWSTR lpWideCharStr, // wide-character buffer - int cchWideChar // size of buffer -); - */ -/* - NTSTATUS Status; - ULONG Size; - - if (wchar == NULL) - return 0; - - Status = RtlMultiByteToUnicodeN (wchar, - sizeof(WCHAR), - &Size, - (char *)mbchar, - count); - if (!NT_SUCCESS(Status)) - return -1; - - return (int)Size; - */ } diff --git a/reactos/lib/msvcrt/string/memcpy.c b/reactos/lib/msvcrt/string/memcpy.c index ebad8d92343..7b2dd74fcd3 100644 --- a/reactos/lib/msvcrt/string/memcpy.c +++ b/reactos/lib/msvcrt/string/memcpy.c @@ -3,11 +3,10 @@ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ -void * -memcpy (void *to, const void *from, size_t count) +void* memcpy(void* to, const void* from, size_t count) { - register char *f = (char *)from; - register char *t = (char *)to; + register char* f = (char*)from; + register char* t = (char*)to; register int i = count; while (i-- > 0) diff --git a/reactos/lib/msvcrt/string/memset.c b/reactos/lib/msvcrt/string/memset.c index 124b3a6fbd1..01164bf033f 100644 --- a/reactos/lib/msvcrt/string/memset.c +++ b/reactos/lib/msvcrt/string/memset.c @@ -1,11 +1,11 @@ #include -void * memset(void *src,int val,size_t count) +void* memset(void* src, int val, size_t count) { - char *char_src = (char *)src; + char* char_src = (char*)src; - while(count>0) { + while (count>0) { *char_src = val; char_src++; count--; diff --git a/reactos/lib/msvcrt/string/strcmp.c b/reactos/lib/msvcrt/string/strcmp.c index 9a0b8e7a357..52d3448f1d0 100644 --- a/reactos/lib/msvcrt/string/strcmp.c +++ b/reactos/lib/msvcrt/string/strcmp.c @@ -2,7 +2,7 @@ #include -int strcmp(const char *s1, const char *s2) +int strcmp(const char* s1, const char* s2) { while (*s1 == *s2) { @@ -11,5 +11,5 @@ int strcmp(const char *s1, const char *s2) s1++; s2++; } - return *(unsigned const char *)s1 - *(unsigned const char *)(s2); + return *(unsigned const char*)s1 - *(unsigned const char*)(s2); } diff --git a/reactos/lib/msvcrt/string/strlen.c b/reactos/lib/msvcrt/string/strlen.c index 808d96c8f62..a2995f87dd6 100644 --- a/reactos/lib/msvcrt/string/strlen.c +++ b/reactos/lib/msvcrt/string/strlen.c @@ -1,10 +1,10 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include -size_t -strlen(const char *str) + +size_t strlen(const char* str) { - const char *s; + const char* s; if (str == 0) return 0; diff --git a/reactos/lib/msvcrt/string/strxfrm.c b/reactos/lib/msvcrt/string/strxfrm.c index eca0b2d32f3..ce76f9987a2 100644 --- a/reactos/lib/msvcrt/string/strxfrm.c +++ b/reactos/lib/msvcrt/string/strxfrm.c @@ -11,8 +11,7 @@ size_t strxfrm( char *dest, const char *src, size_t n ) size_t strxfrm( char *dest, const char *src, size_t n ) { int ret = LCMapStringA(LOCALE_USER_DEFAULT,LCMAP_LOWERCASE, - src, strlen(src), - dest, strlen(dest) ); + src, strlen(src), dest, strlen(dest)); if ( ret == 0 ) return -1; diff --git a/reactos/lib/msvcrt/sys_stat/fstat.c b/reactos/lib/msvcrt/sys_stat/fstat.c index 31ae819a4dd..a4a99d5e4f7 100644 --- a/reactos/lib/msvcrt/sys_stat/fstat.c +++ b/reactos/lib/msvcrt/sys_stat/fstat.c @@ -1,4 +1,4 @@ -/* $Id: fstat.c,v 1.13 2002/11/24 18:42:25 robd Exp $ +/* $Id: fstat.c,v 1.14 2002/11/29 15:59:05 robd Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -23,8 +23,7 @@ int _fstat(int fd, struct stat* statbuf) DWORD dwFileType; void* handle; - if (!statbuf) - { + if (!statbuf) { __set_errno(EINVAL); return -1; } diff --git a/reactos/lib/msvcrt/sys_stat/futime.c b/reactos/lib/msvcrt/sys_stat/futime.c index 91403381096..399902c3ad2 100644 --- a/reactos/lib/msvcrt/sys_stat/futime.c +++ b/reactos/lib/msvcrt/sys_stat/futime.c @@ -6,6 +6,7 @@ #include #include + int _futime (int nHandle, struct _utimbuf *pTimes) { FILETIME LastAccessTime; diff --git a/reactos/lib/msvcrt/time/ctime.c b/reactos/lib/msvcrt/time/ctime.c index a41a73b8df7..307ebf5f84d 100644 --- a/reactos/lib/msvcrt/time/ctime.c +++ b/reactos/lib/msvcrt/time/ctime.c @@ -29,10 +29,6 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; -#endif /* LIBC_SCCS and not lint */ - /* ** Leap second handling from Bradley White (bww@k.gp.cs.cmu.edu). ** POSIX-style TZ environment variable handling from Guy Harris @@ -53,6 +49,7 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; #include "posixrul.h" + #ifdef __cplusplus #define CPP_CONST const #else @@ -88,13 +85,9 @@ static char sccsid[] = "@(#)ctime.c 5.23 (Berkeley) 6/22/90"; ** that tzname[0] has the "normal" length of three characters). */ -#ifdef _MSVCRT_LIB_ -int _daylight; -int _timezone; -#else -int _daylight_dll; -int _timezone_dll; -#endif /*_MSVCRT_LIB_*/ +void _set_daylight_export(int); +void _set_timezone_export(int); + static char WILDABBR[] = " "; @@ -228,12 +221,17 @@ settzname(void) _tzname[ttisp->tt_isdst] = (char *)&sp->chars[ttisp->tt_abbrind]; #if 0 - if (ttisp->tt_isdst) - _daylight = 1; - if (i == 0 || !ttisp->tt_isdst) - _timezone_dll = -(ttisp->tt_gmtoff); - if (i == 0 || ttisp->tt_isdst) + if (ttisp->tt_isdst) { + //_daylight = 1; + _set_daylight_export(1); + } + if (i == 0 || !ttisp->tt_isdst) { + //_timezone_dll = -(ttisp->tt_gmtoff); + _set_timezone_export(-(ttisp->tt_gmtoff)); + } + if (i == 0 || ttisp->tt_isdst) { _altzone = -(ttisp->tt_gmtoff); + } #endif } /* diff --git a/reactos/lib/msvcrt/time/strftime.c b/reactos/lib/msvcrt/time/strftime.c index 96831ed6e63..7a39f63134b 100644 --- a/reactos/lib/msvcrt/time/strftime.c +++ b/reactos/lib/msvcrt/time/strftime.c @@ -4,6 +4,7 @@ #include #include + #define TM_YEAR_BASE 1900 static const char *afmt[] = { @@ -25,8 +26,8 @@ static const char *Bfmt[] = { static size_t gsize; static char *pt; -static int -_add(const char *str) + +static int _add(const char* str) { for (;; ++pt, --gsize) { @@ -37,8 +38,7 @@ _add(const char *str) } } -static int -_conv(int n, int digits, char pad) +static int _conv(int n, int digits, char pad) { static char buf[10]; char *p; @@ -50,16 +50,14 @@ _conv(int n, int digits, char pad) return _add(++p); } -static size_t -_fmt(const char *format, const struct tm *t) +static size_t _fmt(const char* format, const struct tm* t) { for (; *format; ++format) { if (*format == '%') { if (*(format+1) == '#' ) {format++;} - switch(*++format) - { + switch(*++format) { case '\0': --format; break; @@ -113,8 +111,7 @@ _fmt(const char *format, const struct tm *t) return 0; continue; case 'I': - if (!_conv(t->tm_hour % 12 ? - t->tm_hour % 12 : 12, 2, '0')) + if (!_conv(t->tm_hour % 12 ? t->tm_hour % 12 : 12, 2, '0')) return 0; continue; case 'j': @@ -126,8 +123,7 @@ _fmt(const char *format, const struct tm *t) return 0; continue; case 'l': - if (!_conv(t->tm_hour % 12 ? - t->tm_hour % 12 : 12, 2, ' ')) + if (!_conv(t->tm_hour % 12 ? t->tm_hour % 12 : 12, 2, ' ')) return 0; continue; case 'M': @@ -168,14 +164,11 @@ _fmt(const char *format, const struct tm *t) return 0; continue; case 'U': - if (!_conv((t->tm_yday + 7 - t->tm_wday) / 7, - 2, '0')) + if (!_conv((t->tm_yday + 7 - t->tm_wday) / 7, 2, '0')) return 0; continue; case 'W': - if (!_conv((t->tm_yday + 7 - - (t->tm_wday ? (t->tm_wday - 1) : 6)) - / 7, 2, '0')) + if (!_conv((t->tm_yday + 7 - (t->tm_wday ? (t->tm_wday - 1) : 6)) / 7, 2, '0')) return 0; continue; case 'w': @@ -187,8 +180,7 @@ _fmt(const char *format, const struct tm *t) return 0; continue; case 'y': - if (!_conv((t->tm_year + TM_YEAR_BASE) - % 100, 2, '0')) + if (!_conv((t->tm_year + TM_YEAR_BASE) % 100, 2, '0')) return 0; continue; case 'Y': @@ -230,8 +222,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *t) return 0; } -size_t -wcsftime(wchar_t *s, size_t maxsize, const wchar_t *format, const struct tm *t) +size_t wcsftime(wchar_t* s, size_t maxsize, const wchar_t* format, const struct tm* t) { char *x; char *f; @@ -245,8 +236,7 @@ wcsftime(wchar_t *s, size_t maxsize, const wchar_t *format, const struct tm *t) pt = x; if ((gsize = maxsize) < 1) return 0; - if (_fmt(f, t)) - { + if (_fmt(f, t)) { *pt = '\0'; free(f); for(i=0;i #include -VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime ); -time_t -time(time_t *t) +VOID STDCALL GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime); + +time_t time(time_t* t) { FILETIME SystemTime; DWORD Remainder; time_t tt; GetSystemTimeAsFileTime(&SystemTime); - tt = FileTimeToUnixTime( &SystemTime,&Remainder ); + tt = FileTimeToUnixTime(&SystemTime,&Remainder); if (t) *t = tt; return tt; -- 2.17.1