strip whitespace from end of lines Modified: trunk/reactos/lib/crt/conio/cgets.c Modified: trunk/reactos/lib/crt/conio/cprintf.c Modified: trunk/reactos/lib/crt/conio/getche.c Modified: trunk/reactos/lib/crt/conio/ungetch.c Modified: trunk/reactos/lib/crt/ctype/isctype.c Modified: trunk/reactos/lib/crt/direct/chdrive.c Modified: trunk/reactos/lib/crt/direct/getcwd.c Modified: trunk/reactos/lib/crt/direct/getdcwd.c Modified: trunk/reactos/lib/crt/float/chgsign.c Modified: trunk/reactos/lib/crt/float/cntrlfp.c Modified: trunk/reactos/lib/crt/float/copysign.c Modified: trunk/reactos/lib/crt/float/fpclass.c Modified: trunk/reactos/lib/crt/float/isnan.c Modified: trunk/reactos/lib/crt/float/scalb.c Modified: trunk/reactos/lib/crt/float/statfp.c Modified: trunk/reactos/lib/crt/include/float.h Modified: trunk/reactos/lib/crt/include/internal/debug.h Modified: trunk/reactos/lib/crt/include/internal/file.h Modified: trunk/reactos/lib/crt/io/access.c Modified: trunk/reactos/lib/crt/io/chmod.c Modified: trunk/reactos/lib/crt/io/close.c Modified: trunk/reactos/lib/crt/io/dup.c Modified: trunk/reactos/lib/crt/io/find.c Modified: trunk/reactos/lib/crt/io/locking.c Modified: trunk/reactos/lib/crt/io/lseeki64.c Modified: trunk/reactos/lib/crt/io/mktemp.c Modified: trunk/reactos/lib/crt/io/open.c Modified: trunk/reactos/lib/crt/io/read.c Modified: trunk/reactos/lib/crt/io/utime.c Modified: trunk/reactos/lib/crt/io/wmktemp.c Modified: trunk/reactos/lib/crt/io/wopen.c Modified: trunk/reactos/lib/crt/io/write.c Modified: trunk/reactos/lib/crt/io/wutime.c Modified: trunk/reactos/lib/crt/locale/locale.c Modified: trunk/reactos/lib/crt/math/frexp.c Modified: trunk/reactos/lib/crt/math/hypot.c Modified: trunk/reactos/lib/crt/math/j0_y0.c Modified: trunk/reactos/lib/crt/math/j1_y1.c Modified: trunk/reactos/lib/crt/math/jn_yn.c Modified: trunk/reactos/lib/crt/math/modf.c Modified: trunk/reactos/lib/crt/mbstring/hanzen.c Modified: trunk/reactos/lib/crt/mbstring/ischira.c Modified: trunk/reactos/lib/crt/mbstring/iskpun.c Modified: trunk/reactos/lib/crt/mbstring/islwr.c Modified: trunk/reactos/lib/crt/mbstring/ismbc.c Modified: trunk/reactos/lib/crt/mbstring/ismbkaln.c Modified: trunk/reactos/lib/crt/mbstring/ismblead.c Modified: trunk/reactos/lib/crt/mbstring/ismbtrl.c Modified: trunk/reactos/lib/crt/mbstring/isuppr.c Modified: trunk/reactos/lib/crt/mbstring/mbbtype.c Modified: trunk/reactos/lib/crt/mbstring/mbscoll.c Modified: trunk/reactos/lib/crt/mbstring/mbsdec.c Modified: trunk/reactos/lib/crt/mbstring/mbsicmp.c Modified: trunk/reactos/lib/crt/mbstring/mbsicoll.c Modified: trunk/reactos/lib/crt/mbstring/mbsinc.c Modified: trunk/reactos/lib/crt/mbstring/mbslen.c Modified: trunk/reactos/lib/crt/mbstring/mbsncat.c Modified: trunk/reactos/lib/crt/mbstring/mbsnccnt.c Modified: trunk/reactos/lib/crt/mbstring/mbsncmp.c Modified: trunk/reactos/lib/crt/mbstring/mbsncoll.c Modified: trunk/reactos/lib/crt/mbstring/mbsncpy.c Modified: trunk/reactos/lib/crt/mbstring/mbsnset.c Modified: trunk/reactos/lib/crt/mbstring/mbsrchr.c Modified: trunk/reactos/lib/crt/mbstring/mbsrev.c Modified: trunk/reactos/lib/crt/mbstring/mbsset.c Modified: trunk/reactos/lib/crt/mbstring/mbsupr.c Modified: trunk/reactos/lib/crt/misc/crtmain.c Modified: trunk/reactos/lib/crt/misc/environ.c Modified: trunk/reactos/lib/crt/process/_cwait.c Modified: trunk/reactos/lib/crt/process/_system.c Modified: trunk/reactos/lib/crt/process/dll.c Modified: trunk/reactos/lib/crt/process/process.c Modified: trunk/reactos/lib/crt/stdio/allocfil.c Modified: trunk/reactos/lib/crt/stdio/fclose.c Modified: trunk/reactos/lib/crt/stdio/fdopen.c Modified: trunk/reactos/lib/crt/stdio/fflush.c Modified: trunk/reactos/lib/crt/stdio/filbuf.c Modified: trunk/reactos/lib/crt/stdio/flsbuf.c Modified: trunk/reactos/lib/crt/stdio/fopen.c Modified: trunk/reactos/lib/crt/stdio/fprintf.c Modified: trunk/reactos/lib/crt/stdio/fread.c Modified: trunk/reactos/lib/crt/stdio/fseek.c Modified: trunk/reactos/lib/crt/stdio/fsopen.c Modified: trunk/reactos/lib/crt/stdio/fwalk.c Modified: trunk/reactos/lib/crt/stdio/gets.c Modified: trunk/reactos/lib/crt/stdio/getw.c Modified: trunk/reactos/lib/crt/stdio/popen.c Modified: trunk/reactos/lib/crt/stdio/putc.c Modified: trunk/reactos/lib/crt/stdio/puts.c Modified: trunk/reactos/lib/crt/stdio/putw.c Modified: trunk/reactos/lib/crt/stdio/rmtmp.c Modified: trunk/reactos/lib/crt/stdio/setvbuf.c Modified: trunk/reactos/lib/crt/stdio/ungetc.c Modified: trunk/reactos/lib/crt/stdio/vfprintf.c Modified: trunk/reactos/lib/crt/stdio/vsprintf.c Modified: trunk/reactos/lib/crt/stdlib/_exit.c Modified: trunk/reactos/lib/crt/stdlib/errno.c Modified: trunk/reactos/lib/crt/stdlib/itoa.c Modified: trunk/reactos/lib/crt/stdlib/itow.c Modified: trunk/reactos/lib/crt/stdlib/putenv.c [truncated at 100 lines; 22 more skipped] _____
Modified: trunk/reactos/lib/crt/conio/cgets.c --- trunk/reactos/lib/crt/conio/cgets.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/conio/cgets.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -26,7 +26,7 @@
return(NULL); maxlen_wanted = (unsigned int)((unsigned char)string[0]); sp = &(string[2]); - /* + /* * Should the string be shorter maxlen_wanted including or excluding * the trailing '\0' ? We don't take any risk. */ _____
Modified: trunk/reactos/lib/crt/conio/cprintf.c --- trunk/reactos/lib/crt/conio/cprintf.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/conio/cprintf.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -19,11 +19,11 @@
int cnt; char buf[ 2048 ]; /* this is buggy, because buffer might be too small. */ va_list ap; - + va_start(ap, fmt); cnt = vsprintf(buf, fmt, ap); va_end(ap); - + _cputs(buf); return cnt; } _____
Modified: trunk/reactos/lib/crt/conio/getche.c --- trunk/reactos/lib/crt/conio/getche.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/conio/getche.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -1,6 +1,6 @@
/* * COPYRIGHT: See COPYING in the top level directory - * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details + * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details * PROJECT: ReactOS system libraries * FILE: lib/msvcrt/conio/getche.c * PURPOSE: Reads a character from stdin @@ -25,7 +25,7 @@ * ungetch could have been called with a character that * hasn't been got by a conio function. * We don't echo again. - */ + */ return(_getch()); return (_putch(_getch())); } _____
Modified: trunk/reactos/lib/crt/conio/ungetch.c --- trunk/reactos/lib/crt/conio/ungetch.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/conio/ungetch.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -1,6 +1,6 @@
/* * COPYRIGHT: See COPYING in the top level directory - * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details + * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details * PROJECT: ReactOS system libraries * FILE: lib/msvcrt/conio/ungetch.c * PURPOSE: Ungets a character from stdin _____
Modified: trunk/reactos/lib/crt/ctype/isctype.c --- trunk/reactos/lib/crt/ctype/isctype.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/ctype/isctype.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -5,7 +5,7 @@
* PURPOSE: C Runtime * PROGRAMMER: Copyright (C) 1995 DJ Delorie */ - + #include <ctype.h>
_____
Modified: trunk/reactos/lib/crt/direct/chdrive.c --- trunk/reactos/lib/crt/direct/chdrive.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/direct/chdrive.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -7,7 +7,7 @@
/* - * @implemented + * @implemented * * _chdrive (MSVCRT.@) * _____
Modified: trunk/reactos/lib/crt/direct/getcwd.c --- trunk/reactos/lib/crt/direct/getcwd.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/direct/getcwd.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -23,13 +23,13 @@
{ return _tcsdup(dir); } - + if (dir_len >= size) { __set_errno(ERANGE); return NULL; /* buf too small */ } - + _tcscpy(buf,dir); return buf; } _____
Modified: trunk/reactos/lib/crt/direct/getdcwd.c --- trunk/reactos/lib/crt/direct/getdcwd.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/direct/getdcwd.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -11,7 +11,7 @@
* _getdcwd (MSVCRT.@) * * Get the current working directory on a given disk. - * + * * PARAMS * drive [I] Drive letter to get the current working directory from. * buf [O] Destination for the current working directory. _____
Modified: trunk/reactos/lib/crt/float/chgsign.c --- trunk/reactos/lib/crt/float/chgsign.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/float/chgsign.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -16,7 +16,7 @@
if ( u.x->sign == 1 ) u.x->sign = 0; - else + else u.x->sign = 1;
return __x; _____
Modified: trunk/reactos/lib/crt/float/cntrlfp.c --- trunk/reactos/lib/crt/float/cntrlfp.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/float/cntrlfp.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -37,11 +37,11 @@
{ unsigned int FpuCw; unsigned int DummyCw = 0; - + /* get the controlword */ asm volatile("fstcw %0\n\t" : "=m"(FpuCw)); FpuCw &= 0x0000ffff; - + /* translate it into _control87 format */ if (FpuCw & X87_CW_IM) DummyCw |= _EM_INVALID; @@ -88,10 +88,10 @@ /* unset (un)masked bits */ DummyCw &= ~unMask; unNew &= unMask; - + /* set new bits */ DummyCw |= unNew; - + /* translate back into x87 format * FIXME: translate infinity control! */ @@ -141,7 +141,7 @@
/* set controlword */ asm volatile("fldcw %0" : : "m"(FpuCw)); - + return DummyCw;
#if 0 /* The follwing is the original code, broken I think! -blight */ _____
Modified: trunk/reactos/lib/crt/float/copysign.c --- trunk/reactos/lib/crt/float/copysign.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/float/copysign.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -11,7 +11,7 @@
double* __d; double_t* d; } d; - union + union { double* __s; double_t* s; _____
Modified: trunk/reactos/lib/crt/float/fpclass.c --- trunk/reactos/lib/crt/float/fpclass.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/float/fpclass.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -36,7 +36,7 @@
* @implemented */ fpclass_t _fpclass(double __d) -{ +{ union { double* __d; @@ -63,14 +63,14 @@ return FP_NINF; else return FP_PINF; - } + } else if ( d.d->mantissah == 0 && d.d->mantissal != 0 ) { return FP_QNAN; } else if ( d.d->mantissah == 0 && d.d->mantissal != 0 ) { return FP_SNAN; } - + } return 0; } _____
Modified: trunk/reactos/lib/crt/float/isnan.c --- trunk/reactos/lib/crt/float/isnan.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/float/isnan.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -25,14 +25,14 @@
* @implemented */ int _isnan(double __x) -{ +{ union { double* __x; double_t* x; } x; x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 )); + return ( x.x->exponent == 0x7ff && ( x.x->mantissah != 0 || x.x->mantissal != 0 )); }
int _isnanl(long double __x) @@ -45,26 +45,26 @@ long_double_t* x; } x; x.__x = &__x; - - + + /* IEEE 854 NaN's have the maximum possible exponent and a nonzero mantissa. */ - - return (( x.x->exponent == 0x7fff) - && ( (x.x->mantissah & 0x80000000) != 0) - && ( (x.x->mantissah & (unsigned int)0x7fffffff) != 0 || x.x->mantissal != 0 )); + + return (( x.x->exponent == 0x7fff) + && ( (x.x->mantissah & 0x80000000) != 0) + && ( (x.x->mantissah & (unsigned int)0x7fffffff) != 0 || x.x->mantissal != 0 )); }
int _isinf(double __x) { union - { + { double* __x; double_t* x; } x; - + x.__x = &__x; - return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); + return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); }
/* @@ -84,14 +84,14 @@ long double* __x; long_double_t* x; } x; - + x.__x = &__x; - - + + /* An IEEE 854 infinity has an exponent with the maximum possible value and a zero mantissa. */ - - + + if ( x.x->exponent == 0x7fff && ( (x.x->mantissah == 0x80000000 ) && x.x->mantissal == 0 )) return x.x->sign ? -1 : 1; return 0; _____
Modified: trunk/reactos/lib/crt/float/scalb.c --- trunk/reactos/lib/crt/float/scalb.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/float/scalb.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -5,15 +5,15 @@
* @implemented */ double _scalb( double __x, long e ) -{ +{ union { double* __x; double_t* x; } x; - + x.__x = &__x; - + x.x->exponent += e;
return __x; _____
Modified: trunk/reactos/lib/crt/float/statfp.c --- trunk/reactos/lib/crt/float/statfp.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/float/statfp.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -4,7 +4,7 @@
* @implemented */ unsigned int _statusfp (void) -{ +{
register unsigned short __res; #ifdef __GNUC__ _____
Modified: trunk/reactos/lib/crt/include/float.h --- trunk/reactos/lib/crt/include/float.h 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/include/float.h 2005-05-09 01:41:26 UTC (rev 15166) @@ -1,4 +1,4 @@
-/* +/* * float.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -12,7 +12,7 @@ * NOTE: GCC provides float.h, but it doesn't include the non-standard * stuff for accessing the fp controller. We include_next the * GCC-supplied header and just define the MS-specific extensions - * here. + * here. * */
@@ -116,7 +116,7 @@ word to 0x37f (64 bit mantissa precison rather than 53 bit). By default, the mingw version of _fpreset sets fp control as per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when - building your application. + building your application. */ void __cdecl _fpreset (void); void __cdecl fpreset (void); _____
Modified: trunk/reactos/lib/crt/include/internal/debug.h --- trunk/reactos/lib/crt/include/internal/debug.h 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/include/internal/debug.h 2005-05-09 01:41:26 UTC (rev 15166) @@ -3,9 +3,9 @@
* PROJECT: ReactOS kernel * FILE: include/msvcrt/msvcrtdbg.h * PURPOSE: Useful debugging macros - * PROGRAMMER: - * UPDATE HISTORY: - * + * PROGRAMMER: + * UPDATE HISTORY: + * */
/* @@ -24,12 +24,12 @@
#ifdef _UNICODE #define sT "S" -#else +#else #define sT "s" #endif - - - + + + #define TRACE(...)
@@ -45,7 +45,7 @@ #define CHECKPOINT1 #endif
-#if !defined(NDEBUG) && defined(DBG) +#if !defined(NDEBUG) && defined(DBG) #define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); #define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); #else _____
Modified: trunk/reactos/lib/crt/include/internal/file.h --- trunk/reactos/lib/crt/include/internal/file.h 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/include/internal/file.h 2005-05-09 01:41:26 UTC (rev 15166) @@ -59,7 +59,7 @@
#define __FILE_REC_MAX 20 -typedef struct __file_rec +typedef struct __file_rec { struct __file_rec* next; int count; @@ -178,8 +178,8 @@ #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, +#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 */
_____
Modified: trunk/reactos/lib/crt/io/access.c --- trunk/reactos/lib/crt/io/access.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/access.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -32,7 +32,7 @@
return -1; } } - + return 0; }
@@ -50,8 +50,8 @@ _dosmaperr(GetLastError()); return -1; } - - if ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) + + if ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { __set_errno(EACCES); return -1; _____
Modified: trunk/reactos/lib/crt/io/chmod.c --- trunk/reactos/lib/crt/io/chmod.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/chmod.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -30,7 +30,7 @@
if ( mode == 0 ) return -1; - + if (mode & _S_IWRITE) { if (FileAttributes & FILE_ATTRIBUTE_READONLY) { FileAttributes &= ~FILE_ATTRIBUTE_READONLY; _____
Modified: trunk/reactos/lib/crt/io/close.c --- trunk/reactos/lib/crt/io/close.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/close.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -11,7 +11,7 @@
int _close(int _fd) { TRACE("_close(%i)", _fd); - + if (_fd == -1) return(-1); if (CloseHandle((HANDLE)_get_osfhandle(_fd)) == FALSE) _____
Modified: trunk/reactos/lib/crt/io/dup.c --- trunk/reactos/lib/crt/io/dup.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/dup.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -13,18 +13,18 @@
HANDLE hProcess = GetCurrentProcess(); BOOL result; int fd; - + hFile = (HANDLE)_get_osfhandle(handle); if (hFile == INVALID_HANDLE_VALUE) { __set_errno(EBADF); return -1; } - result = DuplicateHandle(hProcess, - hFile, - hProcess, - &hFile, - 0, - TRUE, + result = DuplicateHandle(hProcess, + hFile, + hProcess, + &hFile, + 0, + TRUE, DUPLICATE_SAME_ACCESS); if (result == FALSE) { _dosmaperr(GetLastError()); _____
Modified: trunk/reactos/lib/crt/io/find.c --- trunk/reactos/lib/crt/io/find.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/find.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -64,7 +64,7 @@
long handle, #else int handle, -#endif +#endif struct _tfinddata_t* result) { WIN32_FIND_DATA FindFileData; _____
Modified: trunk/reactos/lib/crt/io/locking.c --- trunk/reactos/lib/crt/io/locking.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/locking.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -15,6 +15,6 @@
_dosmaperr(GetLastError()); return -1; } - + return 0; } _____
Modified: trunk/reactos/lib/crt/io/lseeki64.c --- trunk/reactos/lib/crt/io/lseeki64.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/lseeki64.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -34,7 +34,7 @@
LARGE_INTEGER offset; offset.QuadPart = _offset;
- offset.u.LowPart = SetFilePointer((HANDLE)fdinfo(_fildes)->hFile, + offset.u.LowPart = SetFilePointer((HANDLE)fdinfo(_fildes)->hFile, offset.u.LowPart, &offset.u.HighPart, _whence); return ((((__int64)offset.u.HighPart) << 32) + offset.u.LowPart);
_____
Modified: trunk/reactos/lib/crt/io/mktemp.c --- trunk/reactos/lib/crt/io/mktemp.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/mktemp.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -1,6 +1,6 @@
/* * COPYRIGHT: See COPYING in the top level directory - * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details + * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details * PROJECT: ReactOS system libraries * FILE: lib/msvcrt/io/mktemp.c * PURPOSE: Makes a temp file based on a template _____
Modified: trunk/reactos/lib/crt/io/open.c --- trunk/reactos/lib/crt/io/open.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/open.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -31,7 +31,7 @@
* Copyright 2004 Eric Pouech * Copyright 2004 Juan Lang */ - + // rember to interlock the allocation of fileno when making this thread safe
// possibly store extra information at the handle @@ -97,13 +97,13 @@ inline BOOL is_valid_fd(int fd) { BOOL b = (fd >= 0 && fd < g_fdend && (fdinfo(fd)->fdflags & FOPEN)); - + if (!b){ DPRINT1("not valid fd %i, g_fdend %i, fdinfo %x, bucket %x, fdflags %x\n", fd,g_fdend,fdinfo(fd),fdinfo_bucket(fd),fdinfo(fd)->fdflags); - + } - + return b; }
@@ -115,12 +115,12 @@ char fdflags = 0;
if (oflags & _O_APPEND) fdflags |= FAPPEND; - + if (oflags & _O_BINARY) ; else if (oflags & _O_TEXT) fdflags |= FTEXT; else if (_fmode& _O_BINARY) ; else fdflags |= FTEXT; /* default to TEXT*/ - + if (oflags & _O_NOINHERIT) fdflags |= FNOINHERIT;
if (oflags & ~(_O_BINARY|_O_TEXT|_O_APPEND|_O_TRUNC| @@ -235,7 +235,7 @@
hFile = CreateFileA(_path, dwDesiredAccess, - dwShareMode, + dwShareMode, &sa, dwCreationDistribution, dwFlagsAndAttributes, @@ -259,9 +259,9 @@ static void init_bucket(FDINFO* entry) { int i; - - for(i=0; - i < FDINFO_ENTRIES_PER_BUCKET; + + for(i=0; + i < FDINFO_ENTRIES_PER_BUCKET; i++, entry++) { entry->hFile = INVALID_HANDLE_VALUE; @@ -278,29 +278,29 @@ { fdinfo_bucket(fd) = malloc(FDINFO_ENTRIES_PER_BUCKET * sizeof(FDINFO)); if (!fdinfo_bucket(fd)) return FALSE; - + init_bucket(fdinfo_bucket(fd)); - + return TRUE; }
-/* +/* * INTERNAL * Allocate an fd slot from a Win32 HANDLE, starting from fd * caller must hold the files lock */ static int alloc_fd_from(HANDLE hand, char flag, int fd) { - + if (fd >= FDINFO_ENTRIES) { DPRINT1("files exhausted!\n"); return -1; } - + if (!fdinfo_bucket(fd)) { if (!alloc_init_bucket(fd)){ @@ -308,10 +308,10 @@ return -1; } } - + fdinfo(fd)->hFile = hand; fdinfo(fd)->fdflags = FOPEN | (flag & (FNOINHERIT | FAPPEND | FTEXT)); - fdinfo(fd)->pipechar = LF; + fdinfo(fd)->pipechar = LF; fdinfo(fd)->lockinitflag = 0; //fdinfo(fd)->lock
@@ -342,9 +342,9 @@ { g_fdstart++; } -#endif +#endif } - + /* update last fd in use */ if (fd >= g_fdend) g_fdend = fd + 1; @@ -369,18 +369,18 @@ }
-/* - * INTERNAL: Allocate an fd slot from a Win32 HANDLE +/* + * INTERNAL: Allocate an fd slot from a Win32 HANDLE */ int alloc_fd(HANDLE hand, char flag) { int ret;
LOCK_FILES(); - + // TRACE(":handle (%p) allocating fd (%d)\n",hand,MSVCRT_fdstart); ret = alloc_fd_from(hand, flag, g_fdstart); - + UNLOCK_FILES(); return ret; } @@ -406,11 +406,11 @@ void free_fd(int fd) { LOCK_FILES(); - - + + fdinfo(fd)->hFile = INVALID_HANDLE_VALUE; fdinfo(fd)->fdflags = 0; - + if (fd < 3) /* don't use 0,1,2 for user files */ { switch (fd) @@ -424,12 +424,12 @@ { if (fd == g_fdend - 1) g_fdend--; - + if (fd < g_fdstart) g_fdstart = fd; }
- + UNLOCK_FILES(); }
@@ -443,10 +443,10 @@ The _open_osfhandle() function in MSVCRT is expected to take the absence of either _O_TEXT or _O_BINARY to mean _O_BINARY. Currently it defaults to _O_TEXT. - + An example of this is MFC's CStdioFile::Open in binary mode - it passes flags of 0 when it wants to write a binary file - under WINE we do text mode conversions! - + The attached patch ensures that _O_BINARY is set if neither is set in the passed-in flags.
@@ -485,7 +485,7 @@ long _get_osfhandle(int fd) { TRACE("_get_osfhandle(%i)",fd); - + if (!is_valid_fd(fd)) { return( -1 ); } @@ -501,29 +501,29 @@ { HANDLE hProcess; BOOL result; - + if (handle1 >= FDINFO_ENTRIES || handle1 < 0 || handle2 >= FDINFO_ENTRIES || handle2 < 0) { __set_errno(EBADF); return -1; } // if (_pioinfo[handle1]->fd == -1) { - if (fdinfo(handle1)->hFile == INVALID_HANDLE_VALUE) { + if (fdinfo(handle1)->hFile == INVALID_HANDLE_VALUE) { __set_errno(EBADF); return -1; } if (handle1 == handle2) return handle1; // if (_pioinfo[handle2]->fd != -1) { - if (fdinfo(handle2)->hFile != INVALID_HANDLE_VALUE) { + if (fdinfo(handle2)->hFile != INVALID_HANDLE_VALUE) { _close(handle2); } hProcess = GetCurrentProcess(); - result = DuplicateHandle(hProcess, - fdinfo(handle1)->hFile, - hProcess, - &fdinfo(handle2)->hFile, - 0, - TRUE, + result = DuplicateHandle(hProcess, + fdinfo(handle1)->hFile, + hProcess, + &fdinfo(handle2)->hFile, + 0, + TRUE, DUPLICATE_SAME_ACCESS); if (result) { // _pioinfo[handle2]->fd = handle2; @@ -539,7 +539,7 @@ SetStdHandle(STD_ERROR_HANDLE, fdinfo(handle2)->hFile); break; } - + return handle1; } else { __set_errno(EMFILE); // Is this the correct error no.? @@ -563,7 +563,7 @@ init_bucket(first_bucket);
GetStartupInfoA(&si); - + if (si.cbReserved2 != 0 && si.lpReserved2 != NULL) { char* fdflags_ptr; @@ -584,7 +584,7 @@ return FALSE; } } - + if ((*fdflags_ptr & FOPEN) && *handle_ptr != INVALID_HANDLE_VALUE) { fdinfo(i)->fdflags = *fdflags_ptr; @@ -596,13 +596,13 @@ fdinfo(i)->fdflags = 0; fdinfo(i)->hFile = INVALID_HANDLE_VALUE; } -*/ +*/ fdflags_ptr++; handle_ptr++; } for (g_fdstart = 3; g_fdstart < g_fdend; g_fdstart++) if (fdinfo(g_fdstart)->hFile == INVALID_HANDLE_VALUE) break; } - + InitializeCriticalSection(&g_file_cs);
@@ -653,7 +653,7 @@ HANDLE* handle_ptr;
TRACE("create_io_inherit_block(%x)",si); - + si->cbReserved2 = sizeof(unsigned) + (sizeof(char) + sizeof(HANDLE)) * g_fdend; si->lpReserved2 = calloc(si->cbReserved2, 1); if (!si->lpReserved2) @@ -679,7 +679,7 @@ *handle_ptr = INVALID_HANDLE_VALUE; } fdflags_ptr++; handle_ptr++; - } + } return( TRUE ); }
@@ -692,16 +692,16 @@ int _setmode(int fd, int newmode) { int prevmode; - + TRACE("_setmode(%d, %d)", fd, newmode); - + if (!is_valid_fd(fd)) { DPRINT1("_setmode: inval fd (%d)\n",fd); //errno = EBADF; return(-1); } - + if (newmode & ~(_O_TEXT|_O_BINARY)) { DPRINT1("_setmode: fd (%d) mode (0x%08x) unknown\n",fd,newmode); @@ -709,7 +709,7 @@ }
prevmode = fdinfo(fd)->fdflags & FTEXT ? _O_TEXT : _O_BINARY; - + if ((newmode & _O_TEXT) == _O_TEXT) { fdinfo(fd)->fdflags |= FTEXT; @@ -721,7 +721,7 @@ */ fdinfo(fd)->fdflags &= ~FTEXT; } - + return(prevmode); }
_____
Modified: trunk/reactos/lib/crt/io/read.c --- trunk/reactos/lib/crt/io/read.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/read.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -50,7 +50,7 @@
_dosmaperr(error); return -1; } - + /* text mode */ if (_rbyte && istext) { _____
Modified: trunk/reactos/lib/crt/io/utime.c --- trunk/reactos/lib/crt/io/utime.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/utime.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -12,7 +12,7 @@
{ int fn; int ret; - + fn = _open(filename, _O_RDWR); if (fn == -1) { __set_errno(EBADF); _____
Modified: trunk/reactos/lib/crt/io/wmktemp.c --- trunk/reactos/lib/crt/io/wmktemp.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/wmktemp.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -1,6 +1,6 @@
/* * COPYRIGHT: See COPYING in the top level directory - * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details + * Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details * PROJECT: ReactOS system libraries * FILE: lib/msvcrt/io/mktemp.c * PURPOSE: Makes a temp file based on a template _____
Modified: trunk/reactos/lib/crt/io/wopen.c --- trunk/reactos/lib/crt/io/wopen.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/wopen.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -62,7 +62,7 @@
* * _O_BINARY Opens file in binary (untranslated) mode. (See fopen for a description of binary mode.) * _O_TEXT Opens file in text (translated) mode. (For more information, see Text and Binary Mode File I/O and fopen.) - * + * * _O_APPEND Moves file pointer to end of file before every write operation. */ #if 0 _____
Modified: trunk/reactos/lib/crt/io/write.c --- trunk/reactos/lib/crt/io/write.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/write.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -47,7 +47,7 @@
DPRINT("_write(fd %d, buf %x, nbyte %d)\n", _fd, _buf, _nbyte); if (__fileno_getmode(_fd) & O_TEXT) { - result = _nbyte; + result = _nbyte; tmp = (char*) malloc(BUFSIZE); if (tmp == NULL) { __set_errno(ENOMEM); @@ -80,7 +80,7 @@ if (count == 0 || _nbyte == 0) { if (!WriteFile((HANDLE)_get_osfhandle(_fd), tmp, BUFSIZE - count, &wbyte, NULL)) { _dosmaperr(GetLastError()); - result = -1; + result = -1; break; } if (wbyte < (BUFSIZE - count)) { _____
Modified: trunk/reactos/lib/crt/io/wutime.c --- trunk/reactos/lib/crt/io/wutime.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/io/wutime.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -12,7 +12,7 @@
{ int fn; int ret; - + fn = _wopen(filename, _O_RDWR); if (fn == -1) { __set_errno(EBADF); _____
Modified: trunk/reactos/lib/crt/locale/locale.c --- trunk/reactos/lib/crt/locale/locale.c 2005-05-09 01:41:02 UTC (rev 15165) +++ trunk/reactos/lib/crt/locale/locale.c 2005-05-09 01:41:26 UTC (rev 15166) @@ -3,7 +3,7 @@
* * Copyright 2000 Jon Griffiths */ - + #include "precomp.h" #include <stdio.h> #include <locale.h> @@ -65,7 +65,7 @@ | ".code_page" | "" | NULL [truncated at 1000 lines; 2060 more skipped]