Skip to content

Commit b707be9

Browse files
committed
[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
1 parent 1de09c4 commit b707be9

File tree

10 files changed

+41
-40
lines changed

10 files changed

+41
-40
lines changed

base/applications/cmdutils/attrib/attrib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ typedef struct _ENUMFILES_CTX
150150
static BOOL
151151
EnumFilesWorker(
152152
_Inout_ PENUMFILES_CTX EnumCtx,
153-
_Inout_ off_t offFilePart) // Offset to the file name inside FullPathBuffer
153+
_Inout_ _off_t offFilePart) // Offset to the file name inside FullPathBuffer
154154
{
155155
BOOL bFound = FALSE;
156156
HRESULT hRes;

base/shell/cmd/set.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ ident_len(LPCTSTR p)
278278
#define PARSE_IDENT(ident, identlen, p) \
279279
do { \
280280
identlen = ident_len(p); \
281-
ident = (LPTSTR)alloca((identlen + 1) * sizeof(TCHAR)); \
281+
ident = (LPTSTR)_alloca((identlen + 1) * sizeof(TCHAR)); \
282282
memmove(ident, p, identlen * sizeof(TCHAR)); \
283283
ident[identlen] = 0; \
284284
p += identlen; \
@@ -681,7 +681,7 @@ seta_assignment(LPCTSTR* p_, INT* result)
681681
return FALSE;
682682
}
683683

684-
buf = (LPTSTR)alloca(32 * sizeof(TCHAR));
684+
buf = (LPTSTR)_alloca(32 * sizeof(TCHAR));
685685
_sntprintf(buf, 32, _T("%i"), identval);
686686
SetEnvironmentVariable(ident, buf); // TODO FIXME - check return value
687687
exprval = identval;

dll/win32/shell32/folders/CFSFolder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ HRESULT WINAPI CFSFolder::ParseDisplayName(HWND hwndOwner,
872872
else
873873
{
874874
INT cchElement = lstrlenW(lpszDisplayName) + 1;
875-
LPWSTR pszElement = (LPWSTR)alloca(cchElement * sizeof(WCHAR));
875+
LPWSTR pszElement = (LPWSTR)_alloca(cchElement * sizeof(WCHAR));
876876
LPWSTR pchNext = lpszDisplayName;
877877
hr = Shell_NextElement(&pchNext, pszElement, cchElement, TRUE);
878878
if (FAILED(hr))

modules/rosapps/applications/cmdutils/cat/cat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* PURPOSE: Concatenates STDIN or an arbitrary number of files to STDOUT
66
* PROGRAMMERS: David Welch
77
* Semyon Novikov (tappak)
8-
* Hermès Bélusca - Maïto
8+
* Hermès Bélusca - Maïto
99
*/
1010

1111
#include <stdio.h>
@@ -54,15 +54,15 @@ int main(int argc, char* argv[])
5454
}
5555

5656
/* Set STDOUT to binary */
57-
_setmode(_fileno(stdout), O_BINARY);
57+
_setmode(_fileno(stdout), _O_BINARY);
5858

5959
/* Special case where we run 'cat' without any argument: we use STDIN */
6060
if (argc <= 1)
6161
{
6262
unsigned int ch;
6363

6464
/* Set STDIN to binary */
65-
_setmode(_fileno(stdin), O_BINARY);
65+
_setmode(_fileno(stdin), _O_BINARY);
6666

6767
#if 0 // Version using feof()
6868
ch = fgetc(stdin);

sdk/include/crt/unistd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ extern "C" {
2626
#define FTRUNCATE_DEFINED
2727
/* This is defined as a real library function to allow autoconf
2828
to verify its existence. */
29-
int ftruncate(int, off_t);
30-
__CRT_INLINE int ftruncate(int __fd, off_t __length)
29+
int ftruncate(int, _off_t);
30+
__CRT_INLINE int ftruncate(int __fd, _off_t __length)
3131
{
3232
return _chsize (__fd, __length);
3333
}

sdk/include/reactos/wine/port.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ struct statfs;
9191
# endif /* defined(__BEOS__) */
9292
#endif /* !defined(HAVE_STATFS) */
9393

94+
struct stat;
9495

9596
/****************************************************************
9697
* Macro definitions

sdk/lib/crt/printf/_sxprintf.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#define min(a,b) (((a) < (b)) ? (a) : (b))
2424

25-
int __cdecl _tstreamout(FILE *stream, const TCHAR *format, va_list argptr);
25+
int __cdecl _tstreamout(FILE *stream, const _TCHAR *format, va_list argptr);
2626

2727
int
2828
#if defined(USER32_WSPRINTF) && defined(_M_IX86)
@@ -31,14 +31,14 @@ __stdcall
3131
__cdecl
3232
#endif
3333
_sxprintf(
34-
TCHAR *buffer,
34+
_TCHAR *buffer,
3535
#if IS_SECAPI
3636
size_t sizeOfBuffer,
3737
#endif
3838
#if USE_COUNT
3939
size_t count,
4040
#endif
41-
const TCHAR *format,
41+
const _TCHAR *format,
4242
#if USE_VARARGS
4343
va_list argptr)
4444
#else
@@ -74,7 +74,7 @@ _sxprintf(
7474
stream._base = (char*)buffer;
7575
stream._ptr = stream._base;
7676
stream._charbuf = 0;
77-
stream._cnt = (int)(sizeOfBuffer * sizeof(TCHAR));
77+
stream._cnt = (int)(sizeOfBuffer * sizeof(_TCHAR));
7878
stream._bufsiz = 0;
7979
stream._flag = _IOSTRG | _IOWRT;
8080
stream._tmpfname = 0;
@@ -112,8 +112,8 @@ _sxprintf(
112112
buffer[result] = _T('\0');
113113
#else
114114
/* Only zero terminate if there is enough space left */
115-
if ((stream._cnt >= sizeof(TCHAR)) && (stream._ptr))
116-
*(TCHAR*)stream._ptr = _T('\0');
115+
if ((stream._cnt >= sizeof(_TCHAR)) && (stream._ptr))
116+
*(_TCHAR*)stream._ptr = _T('\0');
117117
#endif
118118

119119
return result;

sdk/lib/crt/printf/streamout.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ void
8080
__declspec(noinline)
8181
#endif
8282
format_float(
83-
TCHAR chr,
83+
_TCHAR chr,
8484
unsigned int flags,
8585
int precision,
86-
TCHAR **string,
87-
const TCHAR **prefix,
86+
_TCHAR **string,
87+
const _TCHAR **prefix,
8888
va_list *argptr)
8989
{
90-
static const TCHAR digits_l[] = _T("0123456789abcdef0x");
91-
static const TCHAR digits_u[] = _T("0123456789ABCDEF0X");
92-
static const TCHAR _nan[] = _T("#QNAN");
93-
static const TCHAR _infinity[] = _T("#INF");
94-
const TCHAR *digits = digits_l;
90+
static const _TCHAR digits_l[] = _T("0123456789abcdef0x");
91+
static const _TCHAR digits_u[] = _T("0123456789ABCDEF0X");
92+
static const _TCHAR _nan[] = _T("#QNAN");
93+
static const _TCHAR _infinity[] = _T("#INF");
94+
const _TCHAR *digits = digits_l;
9595
int exponent = 0, sign;
9696
long double fpval, fpval2;
9797
int padding = 0, num_digits, val32, base = 10;
@@ -186,13 +186,13 @@ format_float(
186186
/* Handle special cases first */
187187
if (_isnan(fpval))
188188
{
189-
(*string) -= sizeof(_nan) / sizeof(TCHAR) - 1;
189+
(*string) -= sizeof(_nan) / sizeof(_TCHAR) - 1;
190190
_tcscpy((*string), _nan);
191191
fpval2 = 1;
192192
}
193193
else if (!_finite(fpval))
194194
{
195-
(*string) -= sizeof(_infinity) / sizeof(TCHAR) - 1;
195+
(*string) -= sizeof(_infinity) / sizeof(_TCHAR) - 1;
196196
_tcscpy((*string), _infinity);
197197
fpval2 = 1;
198198
}
@@ -234,24 +234,24 @@ streamout_char(FILE *stream, int chr)
234234
#endif
235235
#if defined(_USER32_WSPRINTF) || defined(_LIBCNT_)
236236
/* Check if the buffer is full */
237-
if (stream->_cnt < sizeof(TCHAR))
237+
if (stream->_cnt < sizeof(_TCHAR))
238238
return 0;
239239

240-
*(TCHAR*)stream->_ptr = chr;
241-
stream->_ptr += sizeof(TCHAR);
242-
stream->_cnt -= sizeof(TCHAR);
240+
*(_TCHAR*)stream->_ptr = chr;
241+
stream->_ptr += sizeof(_TCHAR);
242+
stream->_cnt -= sizeof(_TCHAR);
243243

244244
return 1;
245245
#else
246-
return _fputtc((TCHAR)chr, stream) != _TEOF;
246+
return _fputtc((_TCHAR)chr, stream) != _TEOF;
247247
#endif
248248
}
249249

250250
static
251251
int
252252
streamout_astring(FILE *stream, const char *string, size_t count)
253253
{
254-
TCHAR chr;
254+
_TCHAR chr;
255255
int written = 0;
256256

257257
#if !defined(_USER32_WSPRINTF)
@@ -323,15 +323,15 @@ streamout_wstring(FILE *stream, const wchar_t *string, size_t count)
323323

324324
int
325325
__cdecl
326-
streamout(FILE *stream, const TCHAR *format, va_list argptr)
326+
streamout(FILE *stream, const _TCHAR *format, va_list argptr)
327327
{
328-
static const TCHAR digits_l[] = _T("0123456789abcdef0x");
329-
static const TCHAR digits_u[] = _T("0123456789ABCDEF0X");
328+
static const _TCHAR digits_l[] = _T("0123456789abcdef0x");
329+
static const _TCHAR digits_u[] = _T("0123456789ABCDEF0X");
330330
static const char *_nullstring = "(null)";
331-
TCHAR buffer[BUFFER_SIZE + 1];
332-
TCHAR chr, *string;
331+
_TCHAR buffer[BUFFER_SIZE + 1];
332+
_TCHAR chr, *string;
333333
STRING *nt_string;
334-
const TCHAR *digits, *prefix;
334+
const _TCHAR *digits, *prefix;
335335
int base, fieldwidth, precision, padding;
336336
size_t prefixlen, len;
337337
int written = 1, written_all = 0;
@@ -534,7 +534,7 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
534534
case_string:
535535
if (!string)
536536
{
537-
string = (TCHAR*)_nullstring;
537+
string = (_TCHAR*)_nullstring;
538538
flags &= ~FLAG_WIDECHAR;
539539
}
540540

sdk/lib/crt/startup/crtexe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ __tmainCRTStartup (void)
211211
/* We need to make sure that this function is build with frame-pointer
212212
and that we align the stack to 16 bytes for the sake of SSE ops in main
213213
or in functions inlined into main. */
214-
lpszCommandLine = (_TCHAR *) alloca (32);
214+
lpszCommandLine = (_TCHAR *) _alloca (32);
215215
memset (lpszCommandLine, 0xcc, 32);
216216
#ifdef __GNUC__
217217
asm __volatile__ ("andl $-16, %%esp" : : : "%esp");

sdk/lib/crt/startup/pseudo-reloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ _pei386_runtime_relocator (void)
464464
++was_init;
465465
#ifdef __MINGW64_VERSION_MAJOR
466466
mSecs = __mingw_GetSectionCount ();
467-
the_secs = (sSecInfo *) alloca (sizeof (sSecInfo) * (size_t) mSecs);
467+
the_secs = (sSecInfo *) _alloca (sizeof (sSecInfo) * (size_t) mSecs);
468468
maxSections = 0;
469469
#endif /* __MINGW64_VERSION_MAJOR */
470470

0 commit comments

Comments
 (0)