strip whitespace from end of lines

svn path=/trunk/; revision=15166
This commit is contained in:
Steven Edwards 2005-05-09 01:41:26 +00:00
parent eace72f07c
commit ae4b8f6e93
122 changed files with 366 additions and 366 deletions

View file

@ -26,7 +26,7 @@ char *_cgets(char *string)
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.
*/

View file

@ -19,11 +19,11 @@ _cprintf(const char *fmt, ...)
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;
}

View file

@ -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 @@ int _getche(void)
* 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()));
}

View file

@ -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

View file

@ -5,7 +5,7 @@
* PURPOSE: C Runtime
* PROGRAMMER: Copyright (C) 1995 DJ Delorie
*/
#include <ctype.h>

View file

@ -7,7 +7,7 @@
/*
* @implemented
* @implemented
*
* _chdrive (MSVCRT.@)
*

View file

@ -23,13 +23,13 @@ _TCHAR* _tgetcwd(_TCHAR* buf, int size)
{
return _tcsdup(dir);
}
if (dir_len >= size)
{
__set_errno(ERANGE);
return NULL; /* buf too small */
}
_tcscpy(buf,dir);
return buf;
}

View file

@ -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.

View file

@ -16,7 +16,7 @@ double _chgsign( double __x )
if ( u.x->sign == 1 )
u.x->sign = 0;
else
else
u.x->sign = 1;
return __x;

View file

@ -37,11 +37,11 @@ unsigned int _control87(unsigned int unNew, unsigned int unMask)
{
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 @@ unsigned int _control87(unsigned int unNew, unsigned int unMask)
/* 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 @@ unsigned int _control87(unsigned int unNew, unsigned int unMask)
/* set controlword */
asm volatile("fldcw %0" : : "m"(FpuCw));
return DummyCw;
#if 0 /* The follwing is the original code, broken I think! -blight */

View file

@ -11,7 +11,7 @@ double _copysign (double __d, double __s)
double* __d;
double_t* d;
} d;
union
union
{
double* __s;
double_t* s;

View file

@ -36,7 +36,7 @@ typedef int fpclass_t;
* @implemented
*/
fpclass_t _fpclass(double __d)
{
{
union
{
double* __d;
@ -63,14 +63,14 @@ fpclass_t _fpclass(double __d)
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;
}

View file

@ -25,14 +25,14 @@ Cambridge, MA 02139, USA. */
* @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 @@ int _isnanl(long double __x)
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 @@ int _isinfl(long double __x)
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;

View file

@ -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;

View file

@ -4,7 +4,7 @@
* @implemented
*/
unsigned int _statusfp (void)
{
{
register unsigned short __res;
#ifdef __GNUC__

View file

@ -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 @@ _CRTIMP unsigned int __cdecl _statusfp (void); /* Report the FPU status word */
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);

View file

@ -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

View file

@ -59,7 +59,7 @@ time_t FileTimeToUnixTime(const FILETIME* filetime, DWORD *remainder);
#define __FILE_REC_MAX 20
typedef struct __file_rec
typedef struct __file_rec
{
struct __file_rec* next;
int count;
@ -178,8 +178,8 @@ int _isinf(double x);
#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 */

View file

@ -32,7 +32,7 @@ int _taccess( const _TCHAR *_path, int _amode )
return -1;
}
}
return 0;
}
@ -50,8 +50,8 @@ int access_dirT(const _TCHAR *_path)
_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;

View file

@ -30,7 +30,7 @@ int _tchmod(const _TCHAR* filename, mode_t mode)
if ( mode == 0 )
return -1;
if (mode & _S_IWRITE) {
if (FileAttributes & FILE_ATTRIBUTE_READONLY) {
FileAttributes &= ~FILE_ATTRIBUTE_READONLY;

View file

@ -11,7 +11,7 @@
int _close(int _fd)
{
TRACE("_close(%i)", _fd);
if (_fd == -1)
return(-1);
if (CloseHandle((HANDLE)_get_osfhandle(_fd)) == FALSE)

View file

@ -13,18 +13,18 @@ int _dup(int handle)
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());

View file

@ -64,7 +64,7 @@ int _tfindnext(
long handle,
#else
int handle,
#endif
#endif
struct _tfinddata_t* result)
{
WIN32_FIND_DATA FindFileData;

View file

@ -15,6 +15,6 @@ int _locking(int _fd, int mode, long nbytes)
_dosmaperr(GetLastError());
return -1;
}
return 0;
}

View file

@ -34,7 +34,7 @@ __int64 _lseeki64(int _fildes, __int64 _offset, int _whence)
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);

View file

@ -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

View file

@ -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 @@ static inline FD_INFO* fdinfo(int fd)
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 split_oflags(int oflags)
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 @@ int _open(const char* _path, int _oflag,...)
hFile = CreateFileA(_path,
dwDesiredAccess,
dwShareMode,
dwShareMode,
&sa,
dwCreationDistribution,
dwFlagsAndAttributes,
@ -259,9 +259,9 @@ int _open(const char* _path, int _oflag,...)
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 @@ static BOOL alloc_init_bucket(int fd)
{
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 @@ static int alloc_fd_from(HANDLE hand, char flag, int fd)
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 @@ static int alloc_fd_from(HANDLE hand, char flag, int fd)
{
g_fdstart++;
}
#endif
#endif
}
/* update last fd in use */
if (fd >= g_fdend)
g_fdend = fd + 1;
@ -369,18 +369,18 @@ static int alloc_fd_from(HANDLE hand, char flag, int fd)
}
/*
* 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 @@ char __fileno_getmode(int fd)
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 @@ void free_fd(int fd)
{
if (fd == g_fdend - 1)
g_fdend--;
if (fd < g_fdstart)
g_fdstart = fd;
}
UNLOCK_FILES();
}
@ -443,10 +443,10 @@ int _open_osfhandle(long osfhandle, int oflags)
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 @@ flags.
long _get_osfhandle(int fd)
{
TRACE("_get_osfhandle(%i)",fd);
if (!is_valid_fd(fd)) {
return( -1 );
}
@ -501,29 +501,29 @@ int __fileno_dup2(int handle1, int handle2)
{
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 @@ int __fileno_dup2(int handle1, int handle2)
SetStdHandle(STD_ERROR_HANDLE, fdinfo(handle2)->hFile);
break;
}
return handle1;
} else {
__set_errno(EMFILE); // Is this the correct error no.?
@ -563,7 +563,7 @@ BOOL __fileno_init(void)
init_bucket(first_bucket);
GetStartupInfoA(&si);
if (si.cbReserved2 != 0 && si.lpReserved2 != NULL)
{
char* fdflags_ptr;
@ -584,7 +584,7 @@ BOOL __fileno_init(void)
return FALSE;
}
}
if ((*fdflags_ptr & FOPEN) && *handle_ptr != INVALID_HANDLE_VALUE)
{
fdinfo(i)->fdflags = *fdflags_ptr;
@ -596,13 +596,13 @@ BOOL __fileno_init(void)
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 @@ unsigned create_io_inherit_block(STARTUPINFOA* si)
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 @@ unsigned create_io_inherit_block(STARTUPINFOA* si)
*handle_ptr = INVALID_HANDLE_VALUE;
}
fdflags_ptr++; handle_ptr++;
}
}
return( TRUE );
}
@ -692,16 +692,16 @@ unsigned create_io_inherit_block(STARTUPINFOA* si)
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 @@ int _setmode(int fd, int newmode)
}
prevmode = fdinfo(fd)->fdflags & FTEXT ? _O_TEXT : _O_BINARY;
if ((newmode & _O_TEXT) == _O_TEXT)
{
fdinfo(fd)->fdflags |= FTEXT;
@ -721,7 +721,7 @@ int _setmode(int fd, int newmode)
*/
fdinfo(fd)->fdflags &= ~FTEXT;
}
return(prevmode);
}

View file

@ -50,7 +50,7 @@ int _read(int _fd, void *_buf, unsigned int _nbyte)
_dosmaperr(error);
return -1;
}
/* text mode */
if (_rbyte && istext)
{

View file

@ -12,7 +12,7 @@ int _utime(const char* filename, struct _utimbuf* buf)
{
int fn;
int ret;
fn = _open(filename, _O_RDWR);
if (fn == -1) {
__set_errno(EBADF);

View file

@ -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

View file

@ -62,7 +62,7 @@ int _wopen(const wchar_t* _path, int _oflag, ...)
*
* _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

View file

@ -47,7 +47,7 @@ int _write(int _fd, const void* _buf, unsigned int _nbyte)
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 @@ int _write(int _fd, const void* _buf, unsigned int _nbyte)
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)) {

View file

@ -12,7 +12,7 @@ int _wutime(const wchar_t* filename, struct _utimbuf* buf)
{
int fn;
int ret;
fn = _wopen(filename, _O_RDWR);
if (fn == -1) {
__set_errno(EBADF);

View file

@ -3,7 +3,7 @@
*
* Copyright 2000 Jon Griffiths
*/
#include "precomp.h"
#include <stdio.h>
#include <locale.h>
@ -65,7 +65,7 @@ locale "lang[_country[.code_page]]"
| ".code_page"
| ""
| NULL
*/
int parse_locale(char *locale, char *lang, char *country, char *code_page)
{
@ -86,8 +86,8 @@ int parse_locale(char *locale, char *lang, char *country, char *code_page)
}
}
*country = 0;
if ( *locale == '.' ) {
locale++;
while ( *locale != 0 && *locale != '.' )
@ -97,9 +97,9 @@ int parse_locale(char *locale, char *lang, char *country, char *code_page)
locale++;
}
}
*code_page = 0;
return 0;
return 0;
}
const struct map_lcid2str {
@ -110,7 +110,7 @@ const struct map_lcid2str {
{0x0409,"English", "United States"},
{0x0809,"English", "United Kingdom"},
{0x0000,"Unknown", "Unknown"}
};
const struct map_cntr {

View file

@ -13,16 +13,16 @@ frexp(double __x, int *exptr)
double* __x;
double_t* x;
} x;
x.__x = &__x;
if ( exptr != NULL )
*exptr = x.x->exponent - 0x3FE;
x.x->exponent = 0x3FE;
return __x;
return __x;
}

View file

@ -15,17 +15,17 @@
* inflicting too much of a performance hit.
*
*/
#include <float.h>
#include <math.h>
#include <errno.h>
/* Approximate square roots of DBL_MAX and DBL_MIN. Numbers
between these two shouldn't neither overflow nor underflow
when squared. */
#define __SQRT_DBL_MAX 1.3e+154
#define __SQRT_DBL_MIN 2.3e-162
/*
* @implemented
*/
@ -34,26 +34,26 @@ _hypot(double x, double y)
{
double abig = fabs(x), asmall = fabs(y);
double ratio;
/* Make abig = max(|x|, |y|), asmall = min(|x|, |y|). */
if (abig < asmall)
{
double temp = abig;
abig = asmall;
asmall = temp;
}
/* Trivial case. */
if (asmall == 0.)
return abig;
/* Scale the numbers as much as possible by using its ratio.
For example, if both ABIG and ASMALL are VERY small, then
X^2 + Y^2 might be VERY inaccurate due to loss of
significant digits. Dividing ASMALL by ABIG scales them
to a certain degree, so that accuracy is better. */
if ((ratio = asmall / abig) > __SQRT_DBL_MIN && abig < __SQRT_DBL_MAX)
return abig * sqrt(1.0 + ratio*ratio);
else
@ -62,9 +62,9 @@ _hypot(double x, double y)
produces any intermediate result greater than roughly the
larger of X and Y. Should converge to machine-precision
accuracy in 3 iterations. */
double r = ratio*ratio, t, s, p = abig, q = asmall;
do {
t = 4. + r;
if (t == 4.)
@ -74,15 +74,15 @@ _hypot(double x, double y)
q *= s;
r = (q / p) * (q / p);
} while (1);
return p;
}
}
#ifdef TEST
#include <msvcrt/stdio.h>
int
main(void)
{
@ -94,8 +94,8 @@ main(void)
printf("hypot(DBL_MAX, 1.0) =\t\t %25.17g\n", _hypot(DBL_MAX, 1.0));
printf("hypot(1.0, DBL_MAX) =\t\t %25.17g\n", _hypot(1.0, DBL_MAX));
printf("hypot(0.0, DBL_MAX) =\t\t %25.17g\n", _hypot(0.0, DBL_MAX));
return 0;
}
#endif

View file

@ -4,7 +4,7 @@
/*
* @unimplemented
*/
double _j0(double x)
double _j0(double x)
{
return x;
}
@ -12,7 +12,7 @@ double _j0(double x)
/*
* @unimplemented
*/
double _y0(double x)
double _y0(double x)
{
return x;
}

View file

@ -4,7 +4,7 @@
/*
* @unimplemented
*/
double _j1(double x)
double _j1(double x)
{
return x;
}
@ -12,7 +12,7 @@ double _j1(double x)
/*
* @unimplemented
*/
double _y1(double x)
double _y1(double x)
{
return x;
}

View file

@ -12,7 +12,7 @@ double _jn(int n, double x)
/*
* @unimplemented
*/
double _yn(int n, double x)
double _yn(int n, double x)
{
return x;
}

View file

@ -5,7 +5,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@ -38,7 +38,7 @@ double modf(double __x, double *__i)
iptr.__i = __i;
j0 = x.x->exponent - 0x3ff; /* exponent of x */
j0 = x.x->exponent - 0x3ff; /* exponent of x */
if(j0<20) { /* integer part in high x */
if(j0<0) { /* |x|<1 */
*__i = 0.0;
@ -128,7 +128,7 @@ long double modfl(long double __x, long double *__i)
iptr.iptr->exponent = x.x->exponent;
iptr.iptr->mantissah = x.x->mantissah&((~i));
iptr.iptr->mantissal = 0;
return __x - *__i;
}
} else if (j0>63) { /* no fraction part */
@ -152,7 +152,7 @@ long double modfl(long double __x, long double *__i)
iptr.iptr->exponent = x.x->exponent;
iptr.iptr->mantissah = x.x->mantissah;
iptr.iptr->mantissal = x.x->mantissal&(~i);
return __x - *__i;
}
}

View file

@ -60,7 +60,7 @@ static unsigned char zen_to_han_symbol_table_2[ZTOH_SYMBOLS] = {
#define JISKANA(c) ((c) >= 0x8340 && (c) <= 0x8396 && (c) != 0x837f)
#define JTOKANA(c) ((c) <= 0x82dd ? (c) + 0xa1 : (c) + 0xa2)
/*
* @implemented
*/

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/ischira.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/iskpun.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/islwr.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created

View file

@ -32,7 +32,7 @@ int _ismbcalpha( unsigned int c )
return 0;
}
/*
* @implemented
*/

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/ismbkaln.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/ismblead.c
* PURPOSE: Checks for a lead byte
* PURPOSE: Checks for a lead byte
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* Modified from Taiji Yamada japanese code system utilities
@ -47,7 +47,7 @@ int _ismbblead(unsigned int c)
//int _ismbblead(unsigned int byte)
//{
//
// return (int)IsDBCSLeadByte(byte)
// return (int)IsDBCSLeadByte(byte)
//}
/*
@ -56,11 +56,11 @@ int _ismbblead(unsigned int c)
int _ismbslead( const unsigned char *str, const unsigned char *t)
{
unsigned char *s = (unsigned char *)str;
while(*s != 0 && s != t)
while(*s != 0 && s != t)
{
s+= _mbclen2(*s);
}
}
return _ismbblead( *s);
}

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/ismbtrl.c
* PURPOSE: Checks for a trailing byte
* PURPOSE: Checks for a trailing byte
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created
@ -14,7 +14,7 @@
size_t _mbclen2(const unsigned int s);
// iskanji2() : (0x40 <= c <= 0x7E 0x80 <= c <= 0xFC)
// iskanji2() : (0x40 <= c <= 0x7E 0x80 <= c <= 0xFC)
/*
* @implemented
@ -36,11 +36,11 @@ int _ismbbtrail(unsigned int c)
int _ismbstrail( const unsigned char *str, const unsigned char *t)
{
unsigned char *s = (unsigned char *)str;
while(*s != 0 && s != t)
while(*s != 0 && s != t)
{
s+= _mbclen2(*s);
}
return _ismbbtrail(*s);
}

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/isuppr.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created

View file

@ -22,7 +22,7 @@ int _mbbtype(unsigned char c , int type)
{
return _MBC_TRAIL;
}
else if (( c >= 0x20 && c >= 0x7E ) || ( c >= 0xA1 && c <= 0xDF ) ||
else if (( c >= 0x20 && c >= 0x7E ) || ( c >= 0xA1 && c <= 0xDF ) ||
( c >= 0x81 && c <= 0x9F ) || ( c >= 0xE0 && c <= 0xFC ) )
return _MBC_ILLEGAL;
else
@ -33,13 +33,13 @@ int _mbbtype(unsigned char c , int type)
}
else if ( (c >= 0x81 && c <= 0x9F ) || ( c >= 0xE0 && c <= 0xFC) )
return _MBC_LEAD;
else if (( c >= 0x20 && c >= 0x7E ) || ( c >= 0xA1 && c <= 0xDF ) ||
else if (( c >= 0x20 && c >= 0x7E ) || ( c >= 0xA1 && c <= 0xDF ) ||
( c >= 0x81 && c <= 0x9F ) || ( c >= 0xE0 && c <= 0xFC ) )
return _MBC_ILLEGAL;
else
return 0;
}
return 0;
return 0;
}
/*

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbscoll.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created
@ -25,9 +25,9 @@ int _mbscoll(const unsigned char *str1, const unsigned char *str2)
int l1, l2;
while ( *s1 != 0 ) {
if (*s1 == 0)
break;
break;
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);
@ -69,7 +69,7 @@ int _mbsbcoll(const unsigned char *str1, const unsigned char *str2)
while ( *s1 != 0 ) {
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);

View file

@ -14,5 +14,5 @@ unsigned char * _mbsdec(const unsigned char *str, const unsigned char *cur)
if (_ismbblead(*(s-1)) )
s--;
return s;
return s;
}

View file

@ -24,9 +24,9 @@ int _mbsicmp(const unsigned char *str1, const unsigned char *str2)
int l1, l2;
do {
if (*s1 == 0)
break;
break;
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbsicoll.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created
@ -25,9 +25,9 @@ int _mbsicoll(const unsigned char *str1, const unsigned char *str2)
int l1, l2;
while ( *s1 != 0 ) {
if (*s1 == 0)
break;
break;
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);

View file

@ -6,7 +6,7 @@
unsigned char * _mbsinc(const unsigned char *s)
{
unsigned char *c = (unsigned char *)s;
if (_ismbblead(*s) )
if (_ismbblead(*s) )
c++;
c++;
return c;

View file

@ -12,7 +12,7 @@ size_t _mbslen(const unsigned char *str)
if (str == 0)
return 0;
for (s = (unsigned char *)str; *s; s+=_mbclen2(*s),i++);
return i;
}

View file

@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbsncat.c
* FILE: lib/msvcrt/mbstring/mbsncat.c
* PURPOSE: Concatenate two multi byte string to maximum of n characters or bytes
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
@ -21,7 +21,7 @@ unsigned char * _mbsncat(unsigned char *dst, const unsigned char *src, size_t n)
unsigned char *d = dst;
const unsigned char *s = src;
if (n != 0) {
d = dst + _mbslen(dst); // get the end of string
d = dst + _mbslen(dst); // get the end of string
d += _mbclen2(*d); // move 1 or 2 up
do {
@ -43,10 +43,10 @@ unsigned char * _mbsncat(unsigned char *dst, const unsigned char *src, size_t n)
*/
unsigned char * _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t n)
{
unsigned char *d;
unsigned char *d;
const unsigned char *s = src;
if (n != 0) {
d = dst + _mbslen(dst); // get the end of string
d = dst + _mbslen(dst); // get the end of string
d += _mbclen2(*d); // move 1 or 2 up
do {

View file

@ -8,14 +8,14 @@ size_t _mbsnccnt(const unsigned char *str, size_t n)
unsigned char *s = (unsigned char *)str;
size_t cnt = 0;
while(*s != 0 && n > 0) {
if (_ismbblead(*s) )
if (_ismbblead(*s) )
s++;
else
n--;
s++;
cnt++;
}
return cnt;
}
@ -30,6 +30,6 @@ size_t _mbsnbcnt(const unsigned char *str, size_t n)
n--;
s++;
}
return (size_t)(s - str);
}

View file

@ -25,9 +25,9 @@ int _mbsncmp(const unsigned char *str1, const unsigned char *str2, size_t n)
if (n == 0)
return 0;
do {
if (*s1 == 0)
break;
break;
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);
@ -74,9 +74,9 @@ int _mbsnbcmp(const unsigned char *str1, const unsigned char *str2, size_t n)
if (n == 0)
return 0;
do {
if (*s1 == 0)
break;
break;
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbsncoll.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created
@ -26,9 +26,9 @@ int _mbsncoll(const unsigned char *str1, const unsigned char *str2, size_t n)
if (n == 0)
return 0;
do {
if (*s1 == 0)
break;
break;
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);
@ -75,9 +75,9 @@ int _mbsnbcoll(const unsigned char *str1, const unsigned char *str2, size_t n)
if (n == 0)
return 0;
do {
if (*s1 == 0)
break;
break;
l1 = _ismbblead(*s1);
l2 = _ismbblead(*s2);

View file

@ -24,9 +24,9 @@ unsigned char* _mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n
if (n == 0)
return 0;
do {
if (*s2 == 0)
break;
break;
if ( !_ismbblead(*s2) ) {
@ -49,8 +49,8 @@ unsigned char* _mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n
/*
* 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
* 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.
*
* @implemented
@ -65,10 +65,10 @@ unsigned char * _mbsnbcpy(unsigned char *str1, const unsigned char *str2, size_t
if (n == 0)
return 0;
do {
if (*s2 == 0) {
*s1 = *s2;
break;
break;
}
if ( !_ismbblead(*s2) ) {

View file

@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbsnset.c
* FILE: lib/msvcrt/mbstring/mbsnset.c
* PURPOSE: Fills a string with a multibyte character
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
@ -20,7 +20,7 @@ unsigned char * _mbsnset(unsigned char *src, unsigned int val, size_t count)
unsigned short *short_src = (unsigned short *)src;
if ( _mbclen2(val) == 1 ) {
while(count > 0) {
*char_src = val;
char_src++;
@ -49,7 +49,7 @@ unsigned char * _mbsnbset(unsigned char *src, unsigned int val, size_t count)
unsigned short *short_src = (unsigned short *)src;
if ( _mbclen2(val) == 1 ) {
while(count > 0) {
*char_src = val;
char_src++;

View file

@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbsrchr.c
* FILE: lib/msvcrt/mbstring/mbsrchr.c
* PURPOSE: Searches for a character in reverse
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:

View file

@ -17,7 +17,7 @@ unsigned char * _mbsrev(unsigned char *s)
if ( *e == 0 )
break;
*e = a;
}
}
e++;
}
while (s<e) {
@ -27,7 +27,7 @@ unsigned char * _mbsrev(unsigned char *s)
s++;
e--;
}
return s;
}

View file

@ -1,7 +1,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbsset.c
* FILE: lib/msvcrt/mbstring/mbsset.c
* PURPOSE: Fills a string with a multibyte character
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
@ -21,7 +21,7 @@ unsigned char * _mbsset(unsigned char *src, unsigned int c)
unsigned short *short_src = (unsigned short *)src;
if ( _mbclen2(c) == 1 ) {
while(*char_src != 0) {
*char_src = c;
char_src++;

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/mbstring/mbsupr.c
* PURPOSE:
* PURPOSE:
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 12/04/99: Created
@ -14,7 +14,7 @@ unsigned int _mbbtoupper(unsigned int c)
{
if (!_ismbblead(c) )
return toupper(c);
return c;
}

View file

@ -20,7 +20,7 @@ int _fltused;
/*
* @unimplemented
*/
int
int
STDCALL
_except_handler3(void)
{
@ -83,7 +83,7 @@ int STDCALL _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lp
//result = DllMain(hInst, ul_reason_for_call, lpReserved);
result = DllMain(hInst, DLL_PROCESS_ATTACH, lpReserved);
return (result ? 1 : 0);
}

View file

@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include <internal/file.h>
#define NDEBUG
#include <internal/debug.h>
@ -19,7 +19,7 @@ unsigned int _osver = 0;
unsigned int _winminor = 0;
unsigned int _winmajor = 0;
unsigned int _winver = 0;
char *_acmdln = NULL; /* pointer to ascii command line */
wchar_t *_wcmdln = NULL; /* pointer to wide character command line */
@ -29,7 +29,7 @@ char **_environ = NULL; /* pointer to environment block */
wchar_t **_wenviron = NULL; /* pointer to environment block */
char **__initenv = NULL; /* pointer to initial environment block */
wchar_t **__winitenv = NULL; /* pointer to initial environment block */
#undef _pgmptr
#undef _pgmptr
char *_pgmptr = NULL; /* pointer to program name */
int __app_type = 0; //_UNKNOWN_APP; /* application type */
int __mb_cur_max = 1;
@ -83,7 +83,7 @@ int BlockEnvToEnvironA(void)
/* Add terminating NULL entry. */
*envptr = NULL;
}
FreeEnvironmentStringsA(environment_strings);
return _environ ? 0 : -1;
}
@ -134,7 +134,7 @@ int BlockEnvToEnvironW(void)
/* Add terminating NULL entry. */
*envptr = NULL;
}
FreeEnvironmentStringsW(environment_strings);
return _wenviron ? 0 : -1;
}
@ -176,8 +176,8 @@ char **DuplicateEnvironment(char **original_environment, int wide)
free(*newenvptr);
free(newenv);
return original_environment;
}
}
}
}
return newenv;
}

View file

@ -2,7 +2,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/process/cwait.c
* PURPOSE: Waits for a process to exit
* PURPOSE: Waits for a process to exit
* PROGRAMER: Boudewijn Dekker
* UPDATE HISTORY:
* 04/03/99: Created

View file

@ -61,7 +61,7 @@ int system(const char *command)
else
s++;
szCmdLine = malloc(strlen(s) + 4 + strlen(command) + 1);
szCmdLine = malloc(strlen(s) + 4 + strlen(command) + 1);
if (szCmdLine == NULL)
{
free (szComSpec);
@ -111,7 +111,7 @@ int system(const char *command)
_dosmaperr(GetLastError());
return -1;
}
CloseHandle(ProcessInformation.hThread);
// system should wait untill the calling process is finished

View file

@ -33,7 +33,7 @@ int _unloaddll(void* handle)
*/
FARPROC _getdllprocaddr(void* hModule, char* lpProcName, int iOrdinal)
{
if (lpProcName != NULL)
if (lpProcName != NULL)
return GetProcAddress(hModule, lpProcName);
else
return GetProcAddress(hModule, (LPSTR)iOrdinal);

View file

@ -14,7 +14,7 @@
#define argvtosT argvtosW
#define do_spawnT do_spawnW
#define valisttosT valisttosW
#define extT extW
#define extT extW
#else
#define find_execT find_execA
#define argvtosT argvtosA
@ -190,7 +190,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env
DWORD dwError;
TRACE(MK_STR(do_spawnT)"(%i,'%"sT"','%"sT"','%"sT"')",mode,cmdname,args,envp);
if (mode != _P_NOWAIT && mode != _P_NOWAITO && mode != _P_WAIT && mode != _P_DETACH && mode != _P_OVERLAY)
{
@ -208,10 +208,10 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env
__set_errno ( EISDIR );
return(-1);
}
//memset (&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
#if 0
for (last = i = 0; i < FDINFO_FD_MAX; i++)
@ -240,7 +240,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env
int _mode = __fileno_getmode(i);
HANDLE h = _get_osfhandle(i);
/* FIXME: The test of console handles (((ULONG)Handle) & 0x10000003) == 0x3)
* is possible wrong
* is possible wrong
*/
if ((((ULONG)h) & 0x10000003) == 0x3 || _mode & _O_NOINHERIT || (i < 3 && mode == _P_DETACH))
{
@ -270,7 +270,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env
#endif
create_io_inherit_block((STARTUPINFOA*) &StartupInfo);
bResult = CreateProcess((_TCHAR *)cmdname,
(_TCHAR *)args,
NULL,
@ -281,7 +281,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env
NULL,
&StartupInfo,
&ProcessInformation);
if (StartupInfo.lpReserved2)
{
free(StartupInfo.lpReserved2);

View file

@ -25,7 +25,7 @@ FILE *__alloc_file(void)
__file_rec **last_fr = &__file_rec_list;
FILE *rv=0;
int i;
/* Try to find an empty slot */
while (fr)
{
@ -73,7 +73,7 @@ int _fcloseall( void )
{
__file_rec *fr = __file_rec_list;
__file_rec **last_fr = &__file_rec_list;
int total_closed = 0;
int i = 0;
@ -81,14 +81,14 @@ int _fcloseall( void )
while (fr)
{
last_fr = &(fr->next);
/* If one of the existing slots is available, return it */
for (i=0; i<fr->count; i++)
if (fr->files[i]->_flag != 0) {
fclose(fr->files[i]);
total_closed++;
}
/* If this one is full, go to the next */
if (fr->count == __FILE_REC_MAX)
fr = fr->next;

View file

@ -32,12 +32,12 @@ fclose(FILE *f)
if ( !(f->_flag&_IOSTRG) ) {
if ( OPEN4WRITING(f) )
r = fflush(f);
if (_close(_fileno(f)) < 0)
r = EOF;
if (f->_flag&_IOMYBUF)
free(f->_base);
// Kernel might do this later
if (f->_flag & _IORMONCL && f->_tmpfname)
{

View file

@ -12,10 +12,10 @@
/*
* @implemented
*/
FILE* _tfdopen(int handle,
FILE* _tfdopen(int handle,
#ifndef _UNICODE
const
#endif
#endif
_TCHAR* mode)
{
FILE* file;

View file

@ -62,7 +62,7 @@ int fflush(FILE *f)
{
base = f->_base;
// if the buffer is read ahead and dirty we will flush it entirely
// else the buffer is appended to the file to the extend it has valid bytes

View file

@ -20,7 +20,7 @@ int _filbuf(FILE* f)
{
int size;
char c;
if ( !OPEN4READING(f)) {
__set_errno (EINVAL);
return EOF;
@ -43,7 +43,7 @@ int _filbuf(FILE* f)
if (f->_flag&_IONBF)
f->_base = &c;
// flush stdout before reading from stdin
// flush stdout before reading from stdin
if (f == stdin) {
if (stdout->_flag&_IO_LBF)
fflush(stdout);
@ -74,9 +74,9 @@ int _filbuf(FILE* f)
f->_ptr = f->_base;
if (f->_flag & _IONBF)
if (f->_flag & _IONBF)
f->_base = NULL; // statically allocated buffer for sprintf
//check for error
if (f->_cnt <= 0) {
@ -86,7 +86,7 @@ int _filbuf(FILE* f)
f->_flag |= _IOERR;
f->_cnt = 0;
// FIXME should set errno
// FIXME should set errno
return EOF;
}
@ -113,9 +113,9 @@ int _readcnv(int fn, void *buf, size_t siz )
n = _read(fn, buf, siz );
while (_bufsiz > 0) {
if (*bufp == '\r')
if (*bufp == '\r')
cr++;
else if ( cr != 0 )
else if ( cr != 0 )
*bufp = *(bufp + cr);
bufp++;
_bufsiz--;

View file

@ -115,7 +115,7 @@ int _writecnv(int fn, void* buf, size_t siz)
int cr1 = 0;
int cr2 = 0;
int n;
cr1 = cntcr(bufp, bufsiz);
tmp = malloc(cr1);
memcpy(tmp, bufp + bufsiz - cr1, cr1);
@ -129,7 +129,7 @@ int _writecnv(int fn, void* buf, size_t siz)
}
int convert(char* endp, int bufsiz, int n)
{
{
endp = endp + bufsiz + n;
while (bufsiz > 0) {
*endp = *(endp - n);

View file

@ -43,7 +43,7 @@ FILE* _tfopen(const _TCHAR *file, const _TCHAR *mode)
{
FILE *f;
int fd, rw, oflags = 0;
if (file == 0)
return 0;
if (mode == 0)

View file

@ -13,9 +13,9 @@ _ftprintf(register FILE *iop, const _TCHAR *fmt, ...)
int len;
_TCHAR localbuf[BUFSIZ];
va_list a=0;
va_start( a, fmt );
va_start( a, fmt );
if (iop->_flag & _IONBF)
{
iop->_flag &= ~_IONBF;

View file

@ -15,7 +15,7 @@ size_t fread(void *vptr, size_t size, size_t count, FILE *iop)
int c, copy;
to_read = size * count;
if (!OPEN4READING(iop))
{
__set_errno (EINVAL);

View file

@ -19,7 +19,7 @@ int fseek(FILE *f, long offset, int ptrname)
__set_errno (EINVAL);
return -1;
}
f->_flag &= ~_IOEOF;
if (!OPEN4WRITING(f))
{
@ -47,7 +47,7 @@ int fseek(FILE *f, long offset, int ptrname)
f->_ptr = f->_base;
f->_flag &= ~_IOUNGETC;
}
else
else
{
p = fflush(f);
return _lseek(_fileno(f), offset, ptrname) == -1 || p == EOF ?

View file

@ -31,7 +31,7 @@ FILE* _tfsopen(const _TCHAR *file, const _TCHAR *mode, int shflag)
FILE *f;
int fd, rw, oflags = 0;
_TCHAR tbchar;
int shf;
if (file == 0)

View file

@ -10,7 +10,7 @@ void _fwalk(void (*func)(FILE *))
{
__file_rec *fr;
int i;
for (fr=__file_rec_list; fr; fr=fr->next)
for (i=0; i<fr->count; i++)
if (fr->files[i]->_flag)

View file

@ -92,7 +92,7 @@ link_warning (gets, "the `gets' function is dangerous and should not be used.")
/* Read a newline-terminated multibyte string from stdin into S,
removing the trailing newline. Return S or NULL. */
char *
gets (s)
char *s;
@ -114,7 +114,7 @@ gets (s)
while ((c = getc(stdin)) != EOF) {
if (c == '\n')
break;
if ( isascii(c) )
if ( isascii(c) )
*cs++ = c;
#ifdef _MULTIBYTE
else if ( isleadbyte(c) ) {
@ -142,5 +142,5 @@ gets (s)
return s;
}
#endif

View file

@ -30,7 +30,7 @@ int _getw(FILE *stream)
/* Is there a better way? */
if (fread( &w, sizeof(w), 1, stream) != 1) {
// EOF is a legitimate integer value so users must
// EOF is a legitimate integer value so users must
// check feof or ferror to verify an EOF return.
return(EOF);
}

View file

@ -48,7 +48,7 @@ FILE *_tpopen (const _TCHAR *cm, const _TCHAR *md) /* program name, pipe mode */
{
return NULL;
}
_tcscpy(szCmdLine, s);
s = _tcsrchr(szCmdLine, '.');
if (s)
@ -73,7 +73,7 @@ FILE *_tpopen (const _TCHAR *cm, const _TCHAR *md) /* program name, pipe mode */
StartupInfo.hStdInput = hReadPipe;
StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
}
result = CreateProcess(szComSpec,
szCmdLine,
NULL,
@ -119,7 +119,7 @@ FILE *_tpopen (const _TCHAR *cm, const _TCHAR *md) /* program name, pipe mode */
int _pclose (FILE *pp)
{
TRACE("_pclose(%x)",pp);
fclose(pp);
if (!TerminateProcess(pp->_tmpfname ,0))
return( -1 );

View file

@ -54,7 +54,7 @@ int putc(int c, FILE* fp)
if (fp->_cnt > 0) {
fp->_cnt--;
*(fp)->_ptr++ = (unsigned char)c;
return (int)(unsigned char)c;
return (int)(unsigned char)c;
} else {
return _flsbuf((unsigned char)c, fp);
}
@ -140,7 +140,7 @@ wint_t putwc(wint_t c, FILE* fp)
}
}
#endif
return c;
return c;
}
return WEOF;
}

View file

@ -27,7 +27,7 @@ int puts(const char *s)
int _putws(const wchar_t *s)
{
wint_t c;
while ((c = *s++)) {
putwchar(c);
}

View file

@ -5,12 +5,12 @@
* modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
*
* The GNU C Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
*
* You should have received a copy of the GNU Library General Public
* License along with the GNU C Library; see the file COPYING.LIB. If
* not, write to the Free Software Foundation, Inc., 675 Mass Ave,

View file

@ -20,11 +20,11 @@ extern __file_rec *__file_rec_list;
int _rmtmp( void )
{
/*
loop files and check for _tmpfname
loop files and check for _tmpfname
*/
__file_rec *fr = __file_rec_list;
__file_rec **last_fr = &__file_rec_list;
int total_closed = 0;
int i = 0;
char temp_name[260];
@ -53,5 +53,5 @@ loop files and check for _tmpfname
/* it isn't full, we can add to it */
break;
}
return total_closed;
return total_closed;
}

View file

@ -21,9 +21,9 @@ int setvbuf(FILE *f, char *buf, int type, size_t len)
if ( f->_base != NULL )
fflush(f);
/* Cannot use _IOLBF as flag value because _IOLBF is equal to _IOSTRG */
if (type == _IOLBF)
if (type == _IOLBF)
type = _IO_LBF;
switch (type)
{
case _IOFBF:

View file

@ -33,14 +33,14 @@ _TINT _ungettc(_TINT c, FILE *f)
f->_cnt+=sizeof(_TCHAR);
f->_ptr-=sizeof(_TCHAR);
#if 1
#if 1
if (*((_TCHAR*)(f->_ptr)) != c)
{
f->_flag |= _IOUNGETC;
*((_TCHAR*)(f->_ptr)) = c;
}
#else
#else
/* This is the old unicode version. Dunno what version is most correct. -Gunnar */
f->_flag |= _IOUNGETC;
*((_TCHAR*)(f->_ptr)) = c;

View file

@ -213,7 +213,7 @@ static int numberf(FILE * f, double __n, char exp_sign, int size, int precision
double* __n;
double_t* n;
} n;
n.__n = &__n;
if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) {

View file

@ -32,7 +32,7 @@ _vsntprintf(_TCHAR *str, size_t maxlen, const _TCHAR *fmt, va_list ap)
{
FILE f = {0};
int len;
f._flag = _IOWRT|_IOSTRG|_IOBINARY;
f._ptr = (char*)str;
f._cnt = maxlen;

View file

@ -9,7 +9,7 @@ struct __atexit *__atexit_ptr = 0;
/*
* @implemented
*/
void exit(int status)
void exit(int status)
{
//int i;
struct __atexit *a = __atexit_ptr;

View file

@ -57,9 +57,9 @@ int __set_errno(int error)
void _dosmaperr(unsigned long oserror)
{
int pos, base, lim;
__set_doserrno(oserror);
/* Use binary chop to find the corresponding errno code */
for (base=0, lim=sizeof(doserrmap)/sizeof(doserrmap[0]); lim; lim >>= 1) {
pos = base+(lim >> 1);

View file

@ -3,7 +3,7 @@
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/stdlib/itoa.c
* PURPOSE: converts a integer to ascii
* PROGRAMER:
* PROGRAMER:
* UPDATE HISTORY:
* 1995: Created
* 1998: Added ltoa Boudewijn Dekker

View file

@ -4,7 +4,7 @@
* PROJECT: ReactOS system libraries
* FILE: lib/msvcrt/stdlib/itow.c
* PURPOSE: converts a integer to wchar_t
* PROGRAMER:
* PROGRAMER:
* UPDATE HISTORY:
* 1995: Created
* 1998: Added ltoa Boudewijn Dekker
@ -147,7 +147,7 @@ wchar_t* _ultow(unsigned long value, wchar_t* string, int radix)
#endif /*_MSVCRT_LIB_*/
}
sp = string;
while (tp > tmp) {
*sp++ = *--tp;
}

View file

@ -15,7 +15,7 @@ int _putenv(const char* val)
{
int size, result;
wchar_t *woption;
size = MultiByteToWideChar(CP_ACP, 0, val, -1, NULL, 0);
woption = malloc(size* sizeof(wchar_t));
if (woption == NULL)

Some files were not shown because too many files have changed in this diff Show more