[REACTOS] Use standard conforming names

- Use _alloca instead of non-standard alloca
- Use _TCHAR instead of non-standard TCHAR
- Use _off_t instead of deprecated off_t
- Use _O_BINARY instead of O_BINARY
This commit is contained in:
Timo Kreuzer 2024-05-12 19:47:18 +03:00
parent 1de09c477c
commit b707be90a1
10 changed files with 41 additions and 40 deletions

View File

@ -150,7 +150,7 @@ typedef struct _ENUMFILES_CTX
static BOOL
EnumFilesWorker(
_Inout_ PENUMFILES_CTX EnumCtx,
_Inout_ off_t offFilePart) // Offset to the file name inside FullPathBuffer
_Inout_ _off_t offFilePart) // Offset to the file name inside FullPathBuffer
{
BOOL bFound = FALSE;
HRESULT hRes;

View File

@ -278,7 +278,7 @@ ident_len(LPCTSTR p)
#define PARSE_IDENT(ident, identlen, p) \
do { \
identlen = ident_len(p); \
ident = (LPTSTR)alloca((identlen + 1) * sizeof(TCHAR)); \
ident = (LPTSTR)_alloca((identlen + 1) * sizeof(TCHAR)); \
memmove(ident, p, identlen * sizeof(TCHAR)); \
ident[identlen] = 0; \
p += identlen; \
@ -681,7 +681,7 @@ evaluate:
return FALSE;
}
buf = (LPTSTR)alloca(32 * sizeof(TCHAR));
buf = (LPTSTR)_alloca(32 * sizeof(TCHAR));
_sntprintf(buf, 32, _T("%i"), identval);
SetEnvironmentVariable(ident, buf); // TODO FIXME - check return value
exprval = identval;

View File

@ -872,7 +872,7 @@ HRESULT WINAPI CFSFolder::ParseDisplayName(HWND hwndOwner,
else
{
INT cchElement = lstrlenW(lpszDisplayName) + 1;
LPWSTR pszElement = (LPWSTR)alloca(cchElement * sizeof(WCHAR));
LPWSTR pszElement = (LPWSTR)_alloca(cchElement * sizeof(WCHAR));
LPWSTR pchNext = lpszDisplayName;
hr = Shell_NextElement(&pchNext, pszElement, cchElement, TRUE);
if (FAILED(hr))

View File

@ -5,7 +5,7 @@
* PURPOSE: Concatenates STDIN or an arbitrary number of files to STDOUT
* PROGRAMMERS: David Welch
* Semyon Novikov (tappak)
* Hermès Bélusca - Maïto
* Hermès Bélusca - Maïto
*/
#include <stdio.h>
@ -54,7 +54,7 @@ int main(int argc, char* argv[])
}
/* Set STDOUT to binary */
_setmode(_fileno(stdout), O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
/* Special case where we run 'cat' without any argument: we use STDIN */
if (argc <= 1)
@ -62,7 +62,7 @@ int main(int argc, char* argv[])
unsigned int ch;
/* Set STDIN to binary */
_setmode(_fileno(stdin), O_BINARY);
_setmode(_fileno(stdin), _O_BINARY);
#if 0 // Version using feof()
ch = fgetc(stdin);

View File

@ -26,8 +26,8 @@ extern "C" {
#define FTRUNCATE_DEFINED
/* This is defined as a real library function to allow autoconf
to verify its existence. */
int ftruncate(int, off_t);
__CRT_INLINE int ftruncate(int __fd, off_t __length)
int ftruncate(int, _off_t);
__CRT_INLINE int ftruncate(int __fd, _off_t __length)
{
return _chsize (__fd, __length);
}

View File

@ -91,6 +91,7 @@ struct statfs;
# endif /* defined(__BEOS__) */
#endif /* !defined(HAVE_STATFS) */
struct stat;
/****************************************************************
* Macro definitions

View File

@ -22,7 +22,7 @@
#define min(a,b) (((a) < (b)) ? (a) : (b))
int __cdecl _tstreamout(FILE *stream, const TCHAR *format, va_list argptr);
int __cdecl _tstreamout(FILE *stream, const _TCHAR *format, va_list argptr);
int
#if defined(USER32_WSPRINTF) && defined(_M_IX86)
@ -31,14 +31,14 @@ __stdcall
__cdecl
#endif
_sxprintf(
TCHAR *buffer,
_TCHAR *buffer,
#if IS_SECAPI
size_t sizeOfBuffer,
#endif
#if USE_COUNT
size_t count,
#endif
const TCHAR *format,
const _TCHAR *format,
#if USE_VARARGS
va_list argptr)
#else
@ -74,7 +74,7 @@ _sxprintf(
stream._base = (char*)buffer;
stream._ptr = stream._base;
stream._charbuf = 0;
stream._cnt = (int)(sizeOfBuffer * sizeof(TCHAR));
stream._cnt = (int)(sizeOfBuffer * sizeof(_TCHAR));
stream._bufsiz = 0;
stream._flag = _IOSTRG | _IOWRT;
stream._tmpfname = 0;
@ -112,8 +112,8 @@ _sxprintf(
buffer[result] = _T('\0');
#else
/* Only zero terminate if there is enough space left */
if ((stream._cnt >= sizeof(TCHAR)) && (stream._ptr))
*(TCHAR*)stream._ptr = _T('\0');
if ((stream._cnt >= sizeof(_TCHAR)) && (stream._ptr))
*(_TCHAR*)stream._ptr = _T('\0');
#endif
return result;

View File

@ -80,18 +80,18 @@ void
__declspec(noinline)
#endif
format_float(
TCHAR chr,
_TCHAR chr,
unsigned int flags,
int precision,
TCHAR **string,
const TCHAR **prefix,
_TCHAR **string,
const _TCHAR **prefix,
va_list *argptr)
{
static const TCHAR digits_l[] = _T("0123456789abcdef0x");
static const TCHAR digits_u[] = _T("0123456789ABCDEF0X");
static const TCHAR _nan[] = _T("#QNAN");
static const TCHAR _infinity[] = _T("#INF");
const TCHAR *digits = digits_l;
static const _TCHAR digits_l[] = _T("0123456789abcdef0x");
static const _TCHAR digits_u[] = _T("0123456789ABCDEF0X");
static const _TCHAR _nan[] = _T("#QNAN");
static const _TCHAR _infinity[] = _T("#INF");
const _TCHAR *digits = digits_l;
int exponent = 0, sign;
long double fpval, fpval2;
int padding = 0, num_digits, val32, base = 10;
@ -186,13 +186,13 @@ format_float(
/* Handle special cases first */
if (_isnan(fpval))
{
(*string) -= sizeof(_nan) / sizeof(TCHAR) - 1;
(*string) -= sizeof(_nan) / sizeof(_TCHAR) - 1;
_tcscpy((*string), _nan);
fpval2 = 1;
}
else if (!_finite(fpval))
{
(*string) -= sizeof(_infinity) / sizeof(TCHAR) - 1;
(*string) -= sizeof(_infinity) / sizeof(_TCHAR) - 1;
_tcscpy((*string), _infinity);
fpval2 = 1;
}
@ -234,16 +234,16 @@ streamout_char(FILE *stream, int chr)
#endif
#if defined(_USER32_WSPRINTF) || defined(_LIBCNT_)
/* Check if the buffer is full */
if (stream->_cnt < sizeof(TCHAR))
if (stream->_cnt < sizeof(_TCHAR))
return 0;
*(TCHAR*)stream->_ptr = chr;
stream->_ptr += sizeof(TCHAR);
stream->_cnt -= sizeof(TCHAR);
*(_TCHAR*)stream->_ptr = chr;
stream->_ptr += sizeof(_TCHAR);
stream->_cnt -= sizeof(_TCHAR);
return 1;
#else
return _fputtc((TCHAR)chr, stream) != _TEOF;
return _fputtc((_TCHAR)chr, stream) != _TEOF;
#endif
}
@ -251,7 +251,7 @@ static
int
streamout_astring(FILE *stream, const char *string, size_t count)
{
TCHAR chr;
_TCHAR chr;
int written = 0;
#if !defined(_USER32_WSPRINTF)
@ -323,15 +323,15 @@ streamout_wstring(FILE *stream, const wchar_t *string, size_t count)
int
__cdecl
streamout(FILE *stream, const TCHAR *format, va_list argptr)
streamout(FILE *stream, const _TCHAR *format, va_list argptr)
{
static const TCHAR digits_l[] = _T("0123456789abcdef0x");
static const TCHAR digits_u[] = _T("0123456789ABCDEF0X");
static const _TCHAR digits_l[] = _T("0123456789abcdef0x");
static const _TCHAR digits_u[] = _T("0123456789ABCDEF0X");
static const char *_nullstring = "(null)";
TCHAR buffer[BUFFER_SIZE + 1];
TCHAR chr, *string;
_TCHAR buffer[BUFFER_SIZE + 1];
_TCHAR chr, *string;
STRING *nt_string;
const TCHAR *digits, *prefix;
const _TCHAR *digits, *prefix;
int base, fieldwidth, precision, padding;
size_t prefixlen, len;
int written = 1, written_all = 0;
@ -534,7 +534,7 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
case_string:
if (!string)
{
string = (TCHAR*)_nullstring;
string = (_TCHAR*)_nullstring;
flags &= ~FLAG_WIDECHAR;
}

View File

@ -211,7 +211,7 @@ __tmainCRTStartup (void)
/* We need to make sure that this function is build with frame-pointer
and that we align the stack to 16 bytes for the sake of SSE ops in main
or in functions inlined into main. */
lpszCommandLine = (_TCHAR *) alloca (32);
lpszCommandLine = (_TCHAR *) _alloca (32);
memset (lpszCommandLine, 0xcc, 32);
#ifdef __GNUC__
asm __volatile__ ("andl $-16, %%esp" : : : "%esp");

View File

@ -464,7 +464,7 @@ _pei386_runtime_relocator (void)
++was_init;
#ifdef __MINGW64_VERSION_MAJOR
mSecs = __mingw_GetSectionCount ();
the_secs = (sSecInfo *) alloca (sizeof (sSecInfo) * (size_t) mSecs);
the_secs = (sSecInfo *) _alloca (sizeof (sSecInfo) * (size_t) mSecs);
maxSections = 0;
#endif /* __MINGW64_VERSION_MAJOR */