From d80446e3a9b007968a09b33af4a7c336b5a263af Mon Sep 17 00:00:00 2001 From: Steven Edwards Date: Sun, 27 Nov 2005 06:20:33 +0000 Subject: [PATCH] more crt, crtdll and msvcrt cleanup svn path=/trunk/; revision=19673 --- reactos/lib/crt/conio/cgets.c | 3 +- reactos/lib/crt/conio/cprintf.c | 2 - reactos/lib/crt/conio/cputs.c | 1 - reactos/lib/crt/conio/getch.c | 3 - reactos/lib/crt/conio/getche.c | 4 +- reactos/lib/crt/conio/kbhit.c | 3 - reactos/lib/crt/conio/putch.c | 1 - reactos/lib/crt/conio/ungetch.c | 5 -- reactos/lib/crt/direct/getcwd.c | 1 - reactos/lib/crt/direct/getdcwd.c | 1 - reactos/lib/crt/float/isnan.c | 4 +- reactos/lib/crt/include/float.h | 8 ++- reactos/lib/crt/include/internal/atexit.h | 3 + reactos/lib/crt/include/internal/console.h | 4 ++ reactos/lib/crt/include/internal/file.h | 19 ++---- reactos/lib/crt/include/internal/math.h | 4 +- reactos/lib/crt/include/internal/tls.h | 4 ++ reactos/lib/crt/io/access.c | 1 - reactos/lib/crt/io/open.c | 1 - reactos/lib/crt/math/hypot.c | 4 -- reactos/lib/crt/math/modf.c | 6 +- reactos/lib/crt/mbstring/mbscat.c | 1 + reactos/lib/crt/mbstring/mbscpy.c | 1 + reactos/lib/crt/mbstring/mbsdup.c | 1 + reactos/lib/crt/precomp.h | 11 ++++ reactos/lib/crt/process/_system.c | 1 - reactos/lib/crt/signal/signal.c | 1 - reactos/lib/crt/stdio/fgetchar.c | 1 - reactos/lib/crt/stdio/gets.c | 4 +- reactos/lib/crt/stdio/perror.c | 3 - reactos/lib/crt/stdio/vfwprint.c | 6 -- reactos/lib/crt/stdlib/atexit.c | 3 +- reactos/lib/crt/stdlib/errno.c | 2 - reactos/lib/crt/stdlib/makepath.c | 1 + reactos/lib/crt/stdlib/splitp.c | 5 +- reactos/lib/crt/stdlib/wsplitp.c | 2 + reactos/lib/crt/wine/heap.c | 1 - reactos/lib/crt/wine/scanf.c | 1 - reactos/lib/crtdll/dllmain.c | 3 - reactos/lib/crtdll/precomp.h | 8 +++ reactos/lib/msvcrt/dllmain.c | 3 - reactos/lib/msvcrt/precomp.h | 8 +++ reactos/lib/rtl/math.c | 72 +++++++++++----------- 43 files changed, 102 insertions(+), 119 deletions(-) diff --git a/reactos/lib/crt/conio/cgets.c b/reactos/lib/crt/conio/cgets.c index 6c25041f467..915f14b4882 100644 --- a/reactos/lib/crt/conio/cgets.c +++ b/reactos/lib/crt/conio/cgets.c @@ -6,8 +6,7 @@ * PROGRAMMER: Eric Kohl (Imported from DJGPP) */ -#include -#include +#include "precomp.h" /* * @implemented diff --git a/reactos/lib/crt/conio/cprintf.c b/reactos/lib/crt/conio/cprintf.c index 86e3fe66feb..756961bb144 100644 --- a/reactos/lib/crt/conio/cprintf.c +++ b/reactos/lib/crt/conio/cprintf.c @@ -8,8 +8,6 @@ #include "precomp.h" -#include - /* * @unimplemented */ diff --git a/reactos/lib/crt/conio/cputs.c b/reactos/lib/crt/conio/cputs.c index ab5911ab476..65e9fb2b3e9 100644 --- a/reactos/lib/crt/conio/cputs.c +++ b/reactos/lib/crt/conio/cputs.c @@ -9,7 +9,6 @@ */ #include "precomp.h" -#include /* * @implemented diff --git a/reactos/lib/crt/conio/getch.c b/reactos/lib/crt/conio/getch.c index 46821e13447..a5ad690a5d1 100644 --- a/reactos/lib/crt/conio/getch.c +++ b/reactos/lib/crt/conio/getch.c @@ -9,9 +9,6 @@ */ #include "precomp.h" -#include -#include - /* * @implemented diff --git a/reactos/lib/crt/conio/getche.c b/reactos/lib/crt/conio/getche.c index bae6e8493d5..c281ac01d18 100644 --- a/reactos/lib/crt/conio/getche.c +++ b/reactos/lib/crt/conio/getche.c @@ -10,9 +10,7 @@ * 28/12/98: Created */ -#include -#include - +#include "precomp.h" int _getche(void) { diff --git a/reactos/lib/crt/conio/kbhit.c b/reactos/lib/crt/conio/kbhit.c index 6f0c0add57c..617442f2874 100644 --- a/reactos/lib/crt/conio/kbhit.c +++ b/reactos/lib/crt/conio/kbhit.c @@ -9,9 +9,6 @@ */ #include "precomp.h" -#include -#include - /* * FIXME PeekConsoleInput returns more than keyboard hits diff --git a/reactos/lib/crt/conio/putch.c b/reactos/lib/crt/conio/putch.c index d6a91a609d4..8ecca074990 100644 --- a/reactos/lib/crt/conio/putch.c +++ b/reactos/lib/crt/conio/putch.c @@ -9,7 +9,6 @@ */ #include "precomp.h" -#include /* * @implemented diff --git a/reactos/lib/crt/conio/ungetch.c b/reactos/lib/crt/conio/ungetch.c index 9fb1e2bcf4c..cb5e710e35c 100644 --- a/reactos/lib/crt/conio/ungetch.c +++ b/reactos/lib/crt/conio/ungetch.c @@ -12,11 +12,6 @@ #include "precomp.h" -#include -#include - - - int char_avail = 0; int ungot_char = 0; diff --git a/reactos/lib/crt/direct/getcwd.c b/reactos/lib/crt/direct/getcwd.c index a01ba1d2f4b..196af47314d 100644 --- a/reactos/lib/crt/direct/getcwd.c +++ b/reactos/lib/crt/direct/getcwd.c @@ -1,7 +1,6 @@ #include "precomp.h" #include #include -#include #include /* diff --git a/reactos/lib/crt/direct/getdcwd.c b/reactos/lib/crt/direct/getdcwd.c index 229c4884689..c3a8d78ec8e 100644 --- a/reactos/lib/crt/direct/getdcwd.c +++ b/reactos/lib/crt/direct/getdcwd.c @@ -2,7 +2,6 @@ #include #include #include -#include /* * @implemented diff --git a/reactos/lib/crt/float/isnan.c b/reactos/lib/crt/float/isnan.c index 70fd6b2a4ae..4f33cf710fc 100644 --- a/reactos/lib/crt/float/isnan.c +++ b/reactos/lib/crt/float/isnan.c @@ -16,9 +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 -#include +#include "precomp.h" /* diff --git a/reactos/lib/crt/include/float.h b/reactos/lib/crt/include/float.h index 000faa08c0c..86b1b4dfded 100644 --- a/reactos/lib/crt/include/float.h +++ b/reactos/lib/crt/include/float.h @@ -91,9 +91,13 @@ #define _FPE_STACKUNDERFLOW 0x8b #define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */ -#ifndef __GNUC__ -#define DBL_MAX_10_EXP 308 +#ifndef DBL_MAX_10_EXP +#define DBL_MAX_10_EXP 308 +#endif +#ifndef S_IFIFO #define S_IFIFO -1 +#endif +#ifndef UINT64_MAX #define UINT64_MAX 0xffffffffffffffff #endif diff --git a/reactos/lib/crt/include/internal/atexit.h b/reactos/lib/crt/include/internal/atexit.h index ab036e60710..626e8869abb 100644 --- a/reactos/lib/crt/include/internal/atexit.h +++ b/reactos/lib/crt/include/internal/atexit.h @@ -2,6 +2,9 @@ #ifndef __CRT_INTERNAL_ATEXIT_H #define __CRT_INTERNAL_ATEXIT_H +#ifndef _CRT_PRECOMP_H +#error DO NOT INCLUDE THIS HEADER DIRECTLY +#endif struct __atexit { struct __atexit* __next; diff --git a/reactos/lib/crt/include/internal/console.h b/reactos/lib/crt/include/internal/console.h index c478c21aa68..351fe1668ba 100644 --- a/reactos/lib/crt/include/internal/console.h +++ b/reactos/lib/crt/include/internal/console.h @@ -3,6 +3,10 @@ #ifndef __CRT_INTERNAL_CONSOLE_H #define __CRT_INTERNAL_CONSOLE_H +#ifndef _CRT_PRECOMP_H +#error DO NOT INCLUDE THIS HEADER DIRECTLY +#endif + extern int char_avail; extern int ungot_char; diff --git a/reactos/lib/crt/include/internal/file.h b/reactos/lib/crt/include/internal/file.h index 9aeceb92ac0..de562e30de4 100644 --- a/reactos/lib/crt/include/internal/file.h +++ b/reactos/lib/crt/include/internal/file.h @@ -136,13 +136,11 @@ void _fwalk(void (*func)(FILE*)); // not exported #define MB_CUR_MAX __mb_cur_max -int _isnanl(double x); -int _isinfl(double x); +int _isnanl(long double x); +int _isinfl(long double x); int _isnan(double x); int _isinf(double x); - - /* Flags for the iobuf structure (for reference) */ #if 0 #define _IOREAD 1 /* currently reading */ @@ -150,24 +148,22 @@ int _isinf(double x); #define _IORW 0x0080 /* opened as "r+w" */ #endif +#ifndef W_OK +#define W_OK 2 /* Check for write permission */ +#endif + /* internal FILE->_flag flags */ #define _IOMYBUF 0x0008 /* stdio malloc()'d buffer */ #define _IOEOF 0x0010 /* EOF reached on read */ #define _IOERR 0x0020 /* I/O error from system */ #define _IOSTRG 0x0040 /* Strange or no file descriptor */ - #define _IOBINARY 0x040000 #define _IOTEXT 0x000000 - #define _IOCOMMIT 0x100000 - #define _IODIRTY 0x010000 #define _IOAHEAD 0x020000 - - - /* * The three possible buffering mode (nMode) values for setvbuf. * NOTE: _IOFBF works, but _IOLBF seems to work like unbuffered... @@ -176,12 +172,10 @@ int _isinf(double x); #define _IOFBF 0x0000 /* full buffered */ #define _IOLBF 0x0040 /* line buffered */ #define _IONBF 0x0004 /* not buffered */ - #define _IO_LBF 0x80000 /* this value is used insteat of _IOLBF within the structure FILE as value for _flags, because _IOLBF has the same value as _IOSTRG */ - wint_t _filwbuf(FILE *f); #if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 2 @@ -189,6 +183,5 @@ wint_t _filwbuf(FILE *f); int __cdecl _flsbuf (int, FILE*); #endif - #endif /* __dj_include_libc_file_h__ */ diff --git a/reactos/lib/crt/include/internal/math.h b/reactos/lib/crt/include/internal/math.h index c08defdb772..7f743072737 100644 --- a/reactos/lib/crt/include/internal/math.h +++ b/reactos/lib/crt/include/internal/math.h @@ -1,7 +1,9 @@ - #ifndef __CRT_INTERNAL_MATH_H #define __CRT_INTERNAL_MATH_H +#ifndef _CRT_PRECOMP_H +#error DO NOT INCLUDE THIS HEADER DIRECTLY +#endif int _isinf (double); /* not exported */ int _isnanl (long double); /* not exported */ diff --git a/reactos/lib/crt/include/internal/tls.h b/reactos/lib/crt/include/internal/tls.h index 1ad72f2ba3f..4adcc83f236 100644 --- a/reactos/lib/crt/include/internal/tls.h +++ b/reactos/lib/crt/include/internal/tls.h @@ -3,6 +3,10 @@ #ifndef __CRT_INTERNAL_TLS_H #define __CRT_INTERNAL_TLS_H +#ifndef _CRT_PRECOMP_H +#error DO NOT INCLUDE THIS HEADER DIRECTLY +#endif + #include #include diff --git a/reactos/lib/crt/io/access.c b/reactos/lib/crt/io/access.c index 6b9b0903cdb..ad8dfb6bd07 100644 --- a/reactos/lib/crt/io/access.c +++ b/reactos/lib/crt/io/access.c @@ -1,5 +1,4 @@ #include "precomp.h" -#include #include #define NDEBUG diff --git a/reactos/lib/crt/io/open.c b/reactos/lib/crt/io/open.c index 226b69f614e..560faee9943 100644 --- a/reactos/lib/crt/io/open.c +++ b/reactos/lib/crt/io/open.c @@ -42,7 +42,6 @@ #include #endif -#include #include #include #include diff --git a/reactos/lib/crt/math/hypot.c b/reactos/lib/crt/math/hypot.c index 15636e12149..fb84bf1eb7f 100644 --- a/reactos/lib/crt/math/hypot.c +++ b/reactos/lib/crt/math/hypot.c @@ -17,10 +17,6 @@ */ #include "precomp.h" -#include -#include -#include - /* Approximate square roots of DBL_MAX and DBL_MIN. Numbers between these two shouldn't neither overflow nor underflow when squared. */ diff --git a/reactos/lib/crt/math/modf.c b/reactos/lib/crt/math/modf.c index 2505cc6935b..2b8cc659f6e 100644 --- a/reactos/lib/crt/math/modf.c +++ b/reactos/lib/crt/math/modf.c @@ -10,11 +10,7 @@ * ==================================================== */ -#include -#include -#include -#include - +#include "precomp.h" //static const double one = 1.0; diff --git a/reactos/lib/crt/mbstring/mbscat.c b/reactos/lib/crt/mbstring/mbscat.c index 65b481b7f55..880880d1e77 100644 --- a/reactos/lib/crt/mbstring/mbscat.c +++ b/reactos/lib/crt/mbstring/mbscat.c @@ -1,3 +1,4 @@ +#include "precomp.h" #include /* diff --git a/reactos/lib/crt/mbstring/mbscpy.c b/reactos/lib/crt/mbstring/mbscpy.c index 76abf442c73..980a02a2288 100644 --- a/reactos/lib/crt/mbstring/mbscpy.c +++ b/reactos/lib/crt/mbstring/mbscpy.c @@ -1,3 +1,4 @@ +#include "precomp.h" #include #include diff --git a/reactos/lib/crt/mbstring/mbsdup.c b/reactos/lib/crt/mbstring/mbsdup.c index 2c3617b5ae8..bcae2901b6b 100644 --- a/reactos/lib/crt/mbstring/mbsdup.c +++ b/reactos/lib/crt/mbstring/mbsdup.c @@ -9,6 +9,7 @@ * 12/04/99: Created */ +#include "precomp.h" #include #include diff --git a/reactos/lib/crt/precomp.h b/reactos/lib/crt/precomp.h index 6af39a15eea..2f7e9de9ef9 100644 --- a/reactos/lib/crt/precomp.h +++ b/reactos/lib/crt/precomp.h @@ -2,13 +2,18 @@ #define _CRT_PRECOMP_H /* Some global constants to hack around the msvc build */ +/* These will go away or be moved soon enough */ +#define _CRT_NON_CONFORMING_SWPRINTFS #define _CRT_SECURE_NO_DEPRECATE #define _INC_WTIME_INL #define _INC_UTIME_INL #define _INC_TIME_INL /* Headers to be compiled */ +#include #include +#include +#include #include #include #include @@ -16,6 +21,9 @@ #include #include +#include +#include + /* PSDK/NDK Headers */ #define WIN32_NO_STATUS #include @@ -27,7 +35,10 @@ #endif /* CRT Internal data */ +#include +#include #include #include +#include #endif /* _CRT_PRECOMP_H */ diff --git a/reactos/lib/crt/process/_system.c b/reactos/lib/crt/process/_system.c index 7a917b8a8c6..e0cbae7c81d 100644 --- a/reactos/lib/crt/process/_system.c +++ b/reactos/lib/crt/process/_system.c @@ -13,7 +13,6 @@ #include #include #include -#include /* * @implemented diff --git a/reactos/lib/crt/signal/signal.c b/reactos/lib/crt/signal/signal.c index d5d251085db..ef9e46767f1 100644 --- a/reactos/lib/crt/signal/signal.c +++ b/reactos/lib/crt/signal/signal.c @@ -2,7 +2,6 @@ #include #include -#include #include void _default_handler(int signal); diff --git a/reactos/lib/crt/stdio/fgetchar.c b/reactos/lib/crt/stdio/fgetchar.c index bc0926e10cf..32c8c71b44f 100644 --- a/reactos/lib/crt/stdio/fgetchar.c +++ b/reactos/lib/crt/stdio/fgetchar.c @@ -22,7 +22,6 @@ */ #include "precomp.h" -#include int _fgetchar(void) { diff --git a/reactos/lib/crt/stdio/gets.c b/reactos/lib/crt/stdio/gets.c index 177e2197ccc..3e2ad2a03bd 100644 --- a/reactos/lib/crt/stdio/gets.c +++ b/reactos/lib/crt/stdio/gets.c @@ -83,9 +83,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 "precomp.h" link_warning (gets, "the `gets' function is dangerous and should not be used.") diff --git a/reactos/lib/crt/stdio/perror.c b/reactos/lib/crt/stdio/perror.c index 36edbc555d7..95716dd20f8 100644 --- a/reactos/lib/crt/stdio/perror.c +++ b/reactos/lib/crt/stdio/perror.c @@ -1,9 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include "precomp.h" -#include - - #ifdef perror #undef perror void perror(const char *s); diff --git a/reactos/lib/crt/stdio/vfwprint.c b/reactos/lib/crt/stdio/vfwprint.c index 8422811e260..be2f15dd5be 100644 --- a/reactos/lib/crt/stdio/vfwprint.c +++ b/reactos/lib/crt/stdio/vfwprint.c @@ -2,12 +2,6 @@ #include "precomp.h" -int _isnanl(double x); -int _isinfl(double x); -int _isnan(double x); -int _isinf(double x); - - int __vfwprintf(FILE *fp, const wchar_t *fmt0, va_list argp); diff --git a/reactos/lib/crt/stdlib/atexit.c b/reactos/lib/crt/stdlib/atexit.c index d6c105c4b1f..9320d9b4cee 100644 --- a/reactos/lib/crt/stdlib/atexit.c +++ b/reactos/lib/crt/stdlib/atexit.c @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include -#include +#include "precomp.h" void _atexit_cleanup(void) { diff --git a/reactos/lib/crt/stdlib/errno.c b/reactos/lib/crt/stdlib/errno.c index e2ae388324f..7b74bdb4a83 100644 --- a/reactos/lib/crt/stdlib/errno.c +++ b/reactos/lib/crt/stdlib/errno.c @@ -2,8 +2,6 @@ * */ #include "precomp.h" -#include - #include "doserrmap.h" /* diff --git a/reactos/lib/crt/stdlib/makepath.c b/reactos/lib/crt/stdlib/makepath.c index 8db6a6794f9..32449bf5930 100644 --- a/reactos/lib/crt/stdlib/makepath.c +++ b/reactos/lib/crt/stdlib/makepath.c @@ -1,5 +1,6 @@ /* $Id$ */ +#include "precomp.h" #include #include diff --git a/reactos/lib/crt/stdlib/splitp.c b/reactos/lib/crt/stdlib/splitp.c index bb00b4cb911..e09457fd9c4 100644 --- a/reactos/lib/crt/stdlib/splitp.c +++ b/reactos/lib/crt/stdlib/splitp.c @@ -1,7 +1,4 @@ -#include -#include -#include - +#include "precomp.h" /* * @implemented diff --git a/reactos/lib/crt/stdlib/wsplitp.c b/reactos/lib/crt/stdlib/wsplitp.c index 0b5a3cade62..4655be577bd 100644 --- a/reactos/lib/crt/stdlib/wsplitp.c +++ b/reactos/lib/crt/stdlib/wsplitp.c @@ -2,4 +2,6 @@ #define _UNICODE #define UNICODE +#include + #include "splitp.c" diff --git a/reactos/lib/crt/wine/heap.c b/reactos/lib/crt/wine/heap.c index a9ccba4a003..f130b9f7304 100644 --- a/reactos/lib/crt/wine/heap.c +++ b/reactos/lib/crt/wine/heap.c @@ -23,7 +23,6 @@ #include "precomp.h" -#include #include #include #include diff --git a/reactos/lib/crt/wine/scanf.c b/reactos/lib/crt/wine/scanf.c index 571dc269786..827e8f5f9f6 100644 --- a/reactos/lib/crt/wine/scanf.c +++ b/reactos/lib/crt/wine/scanf.c @@ -26,7 +26,6 @@ #include "precomp.h" #include -#include #include #define NDEBUG diff --git a/reactos/lib/crtdll/dllmain.c b/reactos/lib/crtdll/dllmain.c index f1aa0a760b4..93939db914f 100644 --- a/reactos/lib/crtdll/dllmain.c +++ b/reactos/lib/crtdll/dllmain.c @@ -21,9 +21,6 @@ */ #include -#include -#include -#include #include #include diff --git a/reactos/lib/crtdll/precomp.h b/reactos/lib/crtdll/precomp.h index 776a87ce358..d30dfa7109e 100644 --- a/reactos/lib/crtdll/precomp.h +++ b/reactos/lib/crtdll/precomp.h @@ -1 +1,9 @@ +#ifndef _CRT_PRECOMP_H +#define _CRT_PRECOMP_H + +#include #include +#include +#include + +#endif /* _CRT_PRECOMP_H */ diff --git a/reactos/lib/msvcrt/dllmain.c b/reactos/lib/msvcrt/dllmain.c index bae034d040e..a2b30a71c2c 100644 --- a/reactos/lib/msvcrt/dllmain.c +++ b/reactos/lib/msvcrt/dllmain.c @@ -21,9 +21,6 @@ */ #include -#include -#include -#include #include #define NDEBUG diff --git a/reactos/lib/msvcrt/precomp.h b/reactos/lib/msvcrt/precomp.h index 776a87ce358..acfc877e21c 100644 --- a/reactos/lib/msvcrt/precomp.h +++ b/reactos/lib/msvcrt/precomp.h @@ -1 +1,9 @@ +#ifndef _CRT_PRECOMP_H +#define _CRT_PRECOMP_H + +#include +#include +#include #include + +#endif /* _CRT_PRECOMP_H */ diff --git a/reactos/lib/rtl/math.c b/reactos/lib/rtl/math.c index 86c789f6963..f292e5c4e9b 100644 --- a/reactos/lib/rtl/math.c +++ b/reactos/lib/rtl/math.c @@ -31,13 +31,13 @@ int _fltused = 0x9875; double atan (double __x) { - register double __value; + register double __val; __asm __volatile__ ("fld1\n\t" "fpatan" - : "=t" (__value) : "0" (__x)); + : "=t" (__val) : "0" (__x)); - return __value; + return __val; } /* @@ -45,16 +45,16 @@ double atan (double __x) */ double ceil (double __x) { - register double __value; + register double __val; __volatile unsigned short int __cw, __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); - __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); + __asm __volatile ("frndint" : "=t" (__val) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); - return __value; + return __val; } /* @@ -62,12 +62,12 @@ double ceil (double __x) */ double cos (double __x) { - register double __value; + register double __val; __asm __volatile__ ("fcos" - : "=t" (__value): "0" (__x)); + : "=t" (__val): "0" (__x)); - return __value; + return __val; } /* @@ -75,12 +75,12 @@ double cos (double __x) */ double fabs (double __x) { - register double __value; + register double __val; __asm __volatile__ ("fabs" - : "=t" (__value) : "0" (__x)); + : "=t" (__val) : "0" (__x)); - return __value; + return __val; } /* @@ -88,16 +88,16 @@ double fabs (double __x) */ double floor (double __x) { - register double __value; + register double __val; __volatile unsigned short int __cw, __cwtmp; __asm __volatile ("fnstcw %0" : "=m" (__cw)); __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); - __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); + __asm __volatile ("frndint" : "=t" (__val) : "0" (__x)); __asm __volatile ("fldcw %0" : : "m" (__cw)); - return __value; + return __val; } /* @@ -105,26 +105,26 @@ double floor (double __x) */ double log (double __x) { - register double __value; + register double __val; __asm __volatile__ ("fldln2\n\t" "fxch\n\t" "fyl2x" - : "=t" (__value) : "0" (__x)); + : "=t" (__val) : "0" (__x)); - return __value; + return __val; } double __log2 (double __x) { - register double __value; + register double __val; __asm __volatile__ ("fld1\n\t" "fxch\n\t" "fyl2x" - : "=t" (__value) : "0" (__x)); + : "=t" (__val) : "0" (__x)); - return __value; + return __val; } /* @@ -132,7 +132,7 @@ double __log2 (double __x) */ double pow (double __x, double __y) { - register double __value, __exponent; + register double __val, __exponent; long __p = (long) __y; if (__x == 0.0 && __y > 0.0) @@ -165,13 +165,13 @@ double pow (double __x, double __y) "fxch\n\t" "fsub %%st(1) # fract(y * log2(x))\n\t" "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t" - : "=t" (__value), "=u" (__exponent) : "0" (__log2 (__x)), "1" (__y)); - __value += 1.0; + : "=t" (__val), "=u" (__exponent) : "0" (__log2 (__x)), "1" (__y)); + __val += 1.0; __asm __volatile__ ("fscale" - : "=t" (__value) : "0" (__value), "u" (__exponent)); + : "=t" (__val) : "0" (__val), "u" (__exponent)); - return __value; + return __val; } /* @@ -179,12 +179,12 @@ double pow (double __x, double __y) */ double sin (double __x) { - register double __value; + register double __val; __asm __volatile__ ("fsin" - : "=t" (__value) : "0" (__x)); + : "=t" (__val) : "0" (__x)); - return __value; + return __val; } /* @@ -192,12 +192,12 @@ double sin (double __x) */ double sqrt (double __x) { - register double __value; + register double __val; __asm __volatile__ ("fsqrt" - : "=t" (__value) : "0" (__x)); + : "=t" (__val) : "0" (__x)); - return __value; + return __val; } /* @@ -205,11 +205,11 @@ double sqrt (double __x) */ double tan (double __x) { - register double __value; - register double __value2 __attribute__ ((unused)); + register double __val; + register double __val2 __attribute__ ((unused)); __asm __volatile__ ("fptan" - : "=t" (__value2), "=u" (__value) : "0" (__x)); + : "=t" (__val2), "=u" (__val) : "0" (__x)); - return __value; + return __val; } -- 2.17.1