From 2ebbba0d7df3afd122f88056ecb7f5d2ecc9ac48 Mon Sep 17 00:00:00 2001 From: Robert Dickenson Date: Fri, 29 Nov 2002 11:26:58 +0000 Subject: [PATCH] Updating files somehow confused by CVS. Old tree cvs reports up-to-date. New tree - different ??? more to come... svn path=/trunk/; revision=3807 --- reactos/lib/crtdll/ctype/isalnum.c | 6 +++--- reactos/lib/crtdll/ctype/isalpha.c | 6 +++--- reactos/lib/crtdll/ctype/iscntrl.c | 7 +++--- reactos/lib/crtdll/ctype/iscsym.c | 2 +- reactos/lib/crtdll/ctype/isdigit.c | 7 +++--- reactos/lib/crtdll/ctype/islower.c | 7 +++--- reactos/lib/crtdll/ctype/ispunct.c | 7 +++--- reactos/lib/crtdll/ctype/isupper.c | 7 +++--- reactos/lib/crtdll/ctype/isxdigit.c | 7 +++--- reactos/lib/crtdll/ctype/toascii.c | 4 ++-- reactos/lib/crtdll/float/chgsign.c | 12 ++++++----- reactos/lib/crtdll/float/fpclass.c | 30 ++++++++++++-------------- reactos/lib/crtdll/float/fpreset.c | 5 +++-- reactos/lib/crtdll/float/isnan.c | 33 ++++++++++++----------------- reactos/lib/crtdll/float/nafter.c | 9 ++++---- reactos/lib/crtdll/io/locking.c | 7 +++--- 16 files changed, 80 insertions(+), 76 deletions(-) diff --git a/reactos/lib/crtdll/ctype/isalnum.c b/reactos/lib/crtdll/ctype/isalnum.c index 66a591b2c46..64de232da21 100644 --- a/reactos/lib/crtdll/ctype/isalnum.c +++ b/reactos/lib/crtdll/ctype/isalnum.c @@ -7,17 +7,17 @@ * UPDATE HISTORY: * 28/12/98: Created */ -#include +#include #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 3e0c4968c20..3aece4abb3a 100644 --- a/reactos/lib/crtdll/ctype/isalpha.c +++ b/reactos/lib/crtdll/ctype/isalpha.c @@ -7,17 +7,17 @@ * UPDATE HISTORY: * 28/12/98: Created */ +#include -#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/crtdll/ctype/iscntrl.c b/reactos/lib/crtdll/ctype/iscntrl.c index 4eef7f83cd0..cd51e8df5f6 100644 --- a/reactos/lib/crtdll/ctype/iscntrl.c +++ b/reactos/lib/crtdll/ctype/iscntrl.c @@ -1,14 +1,15 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#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/crtdll/ctype/iscsym.c b/reactos/lib/crtdll/ctype/iscsym.c index 4f1c1d60bd2..40352dcec60 100644 --- a/reactos/lib/crtdll/ctype/iscsym.c +++ b/reactos/lib/crtdll/ctype/iscsym.c @@ -7,8 +7,8 @@ * UPDATE HISTORY: * 28/12/98: Created */ +#include -#include int __iscsymf(int c) { diff --git a/reactos/lib/crtdll/ctype/isdigit.c b/reactos/lib/crtdll/ctype/isdigit.c index 93afd37f38d..e84881d49a6 100644 --- a/reactos/lib/crtdll/ctype/isdigit.c +++ b/reactos/lib/crtdll/ctype/isdigit.c @@ -1,14 +1,15 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#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/crtdll/ctype/islower.c b/reactos/lib/crtdll/ctype/islower.c index 4ce38e1fc94..34cc31af140 100644 --- a/reactos/lib/crtdll/ctype/islower.c +++ b/reactos/lib/crtdll/ctype/islower.c @@ -1,13 +1,14 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#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/crtdll/ctype/ispunct.c b/reactos/lib/crtdll/ctype/ispunct.c index 57f0ab1244a..5a06ae4a16a 100644 --- a/reactos/lib/crtdll/ctype/ispunct.c +++ b/reactos/lib/crtdll/ctype/ispunct.c @@ -1,14 +1,15 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#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/crtdll/ctype/isupper.c b/reactos/lib/crtdll/ctype/isupper.c index d0d95e02c1d..a7e67b242d2 100644 --- a/reactos/lib/crtdll/ctype/isupper.c +++ b/reactos/lib/crtdll/ctype/isupper.c @@ -1,13 +1,14 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#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/crtdll/ctype/isxdigit.c b/reactos/lib/crtdll/ctype/isxdigit.c index 02c8c63bdec..63f8464261a 100644 --- a/reactos/lib/crtdll/ctype/isxdigit.c +++ b/reactos/lib/crtdll/ctype/isxdigit.c @@ -1,15 +1,16 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#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/crtdll/ctype/toascii.c b/reactos/lib/crtdll/ctype/toascii.c index 86d8ff36874..f26d5afe3b6 100644 --- a/reactos/lib/crtdll/ctype/toascii.c +++ b/reactos/lib/crtdll/ctype/toascii.c @@ -1,9 +1,9 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include +#include int __toascii(int c) { - return ((unsigned)(c) & 0x7F ); + return((unsigned)(c) & 0x7F); } diff --git a/reactos/lib/crtdll/float/chgsign.c b/reactos/lib/crtdll/float/chgsign.c index 589cc40bfbe..40aaac2220a 100644 --- a/reactos/lib/crtdll/float/chgsign.c +++ b/reactos/lib/crtdll/float/chgsign.c @@ -1,10 +1,12 @@ -#include -#include +#include +#include -double _chgsign( double __x ) + +double _chgsign(double __x) { - double_t *x = (double_t *)&x; - if ( x->sign == 1 ) + double_t* x = (double_t*)&x; + + if (x->sign == 1) x->sign = 0; else x->sign = 1; diff --git a/reactos/lib/crtdll/float/fpclass.c b/reactos/lib/crtdll/float/fpclass.c index 06c404f5ead..512670a63c3 100644 --- a/reactos/lib/crtdll/float/fpclass.c +++ b/reactos/lib/crtdll/float/fpclass.c @@ -1,6 +1,7 @@ -#include -#include -#include +#include +#include +#include + #define _FPCLASS_SNAN 0x0001 /* signaling NaN */ #define _FPCLASS_QNAN 0x0002 /* quiet NaN */ @@ -28,38 +29,35 @@ typedef int fpclass_t; fpclass_t _fpclass(double __d) { - double_t *d = (double_t *)&__d; + double_t* d = (double_t*)&__d; - if ( d->exponent == 0 ) { - if ( d->mantissah == 0 && d->mantissal == 0 ) { - if ( d->sign ==0 ) + if (d->exponent == 0) { + if (d->mantissah == 0 && d->mantissal == 0) { + if (d->sign ==0) return FP_NZERO; else return FP_PZERO; } else { - if ( d->sign ==0 ) + if (d->sign ==0) return FP_NDENORM; else return FP_PDENORM; } } - if (d->exponent == 0x7ff ) { - if ( d->mantissah == 0 && d->mantissal == 0 ) { - if ( d->sign ==0 ) + if (d->exponent == 0x7ff) { + if (d->mantissah == 0 && d->mantissal == 0) { + if (d->sign ==0) return FP_NINF; else return FP_PINF; } - else if ( d->mantissah == 0 && d->mantissal != 0 ) { + else if (d->mantissah == 0 && d->mantissal != 0) { return FP_QNAN; } - else if ( d->mantissah == 0 && d->mantissal != 0 ) { + else if (d->mantissah == 0 && d->mantissal != 0) { return FP_SNAN; } } - return 0; } - - diff --git a/reactos/lib/crtdll/float/fpreset.c b/reactos/lib/crtdll/float/fpreset.c index 6e8dd3d24ca..46245b7ca69 100644 --- a/reactos/lib/crtdll/float/fpreset.c +++ b/reactos/lib/crtdll/float/fpreset.c @@ -1,6 +1,7 @@ -#include +#include -void _fpreset (void) + +void _fpreset(void) { /* FIXME: This causes an exception */ // __asm__ __volatile__("fninit\n\t"); diff --git a/reactos/lib/crtdll/float/isnan.c b/reactos/lib/crtdll/float/isnan.c index d6f4ac04e1a..3e64137a9f1 100644 --- a/reactos/lib/crtdll/float/isnan.c +++ b/reactos/lib/crtdll/float/isnan.c @@ -16,43 +16,40 @@ 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 +#include + int _isnan(double __x) { - double_t * x = (double_t *)&__x; - return ( x->exponent == 0x7ff && ( x->mantissah != 0 || x->mantissal != 0 )); + double_t* x = (double_t*)&__x; + return (x->exponent == 0x7ff && (x->mantissah != 0 || x->mantissal != 0)); } int _isnanl(long double __x) { - /* Intel's extended format has the normally implicit 1 explicit present. Sigh! */ - long_double_t * x = (long_double_t *)&__x; + long_double_t* x = (long_double_t*)&__x; /* IEEE 854 NaN's have the maximum possible exponent and a nonzero mantissa. */ return (( x->exponent == 0x7fff) - && ( (x->mantissah & 0x80000000) != 0) - && ( (x->mantissah & (unsigned int)0x7fffffff) != 0 || x->mantissal != 0 )); + && ((x->mantissah & 0x80000000) != 0) + && ((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 )); + double_t* x = (double_t*)&__x; + return (x->exponent == 0x7ff && (x->mantissah == 0 && x->mantissal == 0)); } - - -int _finite( double x ) +int _finite(double x) { return !_isinf(x); } @@ -62,16 +59,14 @@ int _isinfl(long double __x) /* Intel's extended format has the normally implicit 1 explicit present. Sigh! */ - long_double_t * x = (long_double_t *)&__x; + long_double_t* x = (long_double_t*)&__x; /* An IEEE 854 infinity has an exponent with the maximum possible value and a zero mantissa. */ - if ( x->exponent == 0x7fff && ( (x->mantissah == 0x80000000 ) && x->mantissal == 0 )) + if (x->exponent == 0x7fff && ((x->mantissah == 0x80000000) && x->mantissal == 0)) return x->sign ? -1 : 1; return 0; } - - diff --git a/reactos/lib/crtdll/float/nafter.c b/reactos/lib/crtdll/float/nafter.c index 5e2a2ad317f..9237716bc73 100644 --- a/reactos/lib/crtdll/float/nafter.c +++ b/reactos/lib/crtdll/float/nafter.c @@ -1,11 +1,12 @@ -#include +#include -double _nextafter( double x, double y ) + +double _nextafter(double x, double y) { - if ( x == y) + if (x == y) return x; - if ( isnan(x) || isnan(y) ) + if (isnan(x) || isnan(y)) return x; return x; diff --git a/reactos/lib/crtdll/io/locking.c b/reactos/lib/crtdll/io/locking.c index b846ef57e64..a3d79a71aa4 100644 --- a/reactos/lib/crtdll/io/locking.c +++ b/reactos/lib/crtdll/io/locking.c @@ -1,10 +1,11 @@ #include -#include +#include -int _locking( int _fd, int mode, long nbytes ) + +int _locking(int _fd, int mode, long nbytes) { long offset = _lseek(_fd, 0L, 1); - if ( !LockFile(_get_osfhandle(_fd),offset,0,nbytes,0) ) + if (!LockFile(_get_osfhandle(_fd),offset,0,nbytes,0)) return -1; return 0;