Skip to content

Commit 6cc5910

Browse files
committed
Cleanup some unused code in coreclr pal
1 parent 6aecb65 commit 6cc5910

File tree

7 files changed

+1
-343
lines changed

7 files changed

+1
-343
lines changed

src/coreclr/pal/inc/mbusafecrt.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33

44
/***
55
* mbusafecrt.h - public declarations for SafeCRT lib
6-
*
7-
86
*
97
* Purpose:
108
* This file contains the public declarations SafeCRT
119
* functions ported to MacOS. These are the safe versions of
1210
* functions standard functions banned by SWI
13-
*
14-
1511
****/
1612

1713
/* shields! */
@@ -65,7 +61,6 @@ extern int vsprintf_s( char* string, size_t sizeInBytes, const char* format, va_
6561
extern int _vsnprintf_s( char* string, size_t sizeInBytes, size_t count, const char* format, va_list arglist );
6662

6763
extern int sscanf_s( const char *string, const char *format, ... );
68-
extern int swscanf_s( const WCHAR *string, const WCHAR *format, ... );
6964

7065
extern errno_t memcpy_s( void * dst, size_t sizeInBytes, const void * src, size_t count );
7166
extern errno_t memmove_s( void * dst, size_t sizeInBytes, const void * src, size_t count );

src/coreclr/pal/inc/pal.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
/*++
5-
65
Module Name:
7-
86
pal.h
97
108
Abstract:
11-
129
CoreCLR Platform Adaptation Layer (PAL) header file. This file
1310
defines all types and API calls required by the CoreCLR when
1411
compiled for Unix-like systems.
@@ -27,7 +24,6 @@ Module Name:
2724
2825
If you want to add a PAL_ wrapper function to a native function in
2926
here, you also need to edit palinternal.h and win32pal.h.
30-
3127
--*/
3228

3329
#ifndef __PAL_H__
@@ -3446,16 +3442,6 @@ PALAPI
34463442
GetSystemInfo(
34473443
OUT LPSYSTEM_INFO lpSystemInfo);
34483444

3449-
PALIMPORT
3450-
BOOL
3451-
PALAPI
3452-
PAL_SetCurrentThreadAffinity(WORD procNo);
3453-
3454-
PALIMPORT
3455-
BOOL
3456-
PALAPI
3457-
PAL_GetCurrentThreadAffinitySet(SIZE_T size, UINT_PTR* data);
3458-
34593445
//
34603446
// The types of events that can be logged.
34613447
//

src/coreclr/pal/inc/rt/safecrt.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
3-
//
43

54
//
65
/***
@@ -9,7 +8,6 @@
98
*Purpose:
109
* This file contains a subset of the Secure CRT. It is meant to
1110
* be used in the Windows source tree.
12-
*
1311
****/
1412

1513
/* #pragma once */
@@ -355,7 +353,6 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam
355353
#define _tmakepath_s _wmakepath_s
356354
#define _stprintf_s swprintf_s
357355
#define _tscanf_s wscanf_s
358-
#define _tsscanf_s swscanf_s
359356

360357
#else
361358

@@ -1266,14 +1263,6 @@ int __cdecl wscanf_s(const WCHAR *_Format, ...);
12661263

12671264
/* no inline version of wscanf_s */
12681265

1269-
/* swscanf_s */
1270-
_SAFECRT__EXTERN_C
1271-
int __cdecl swscanf_s(const WCHAR *_String, const WCHAR *_Format, ...);
1272-
1273-
/* no C++ overload for swscanf_s */
1274-
1275-
/* no inline version of swscanf_s */
1276-
12771266
/* _swnscanf_s */
12781267
_SAFECRT__EXTERN_C
12791268
int __cdecl _swnscanf_s(const WCHAR *_String, size_t _Count, const WCHAR *_Format, ...);

src/coreclr/pal/src/safecrt/cruntime.h

Lines changed: 0 additions & 97 deletions
This file was deleted.

src/coreclr/pal/src/safecrt/input.inl

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,18 @@
33

44
/***
55
*input.c - C formatted input, used by scanf, etc.
6-
*
7-
86
*
97
*Purpose:
108
* defines _input() to do formatted input; called from scanf(),
11-
* etc. functions. This module defines _cscanf() instead when
12-
* CPRFLAG is defined. The file cscanf.c defines that symbol
13-
* and then includes this file in order to implement _cscanf().
9+
* etc. functions.
1410
*
1511
*Note:
1612
* this file is included in safecrt.lib build directly, plese refer
1713
* to safecrt_[w]input_s.c
18-
*
1914
*******************************************************************************/
2015

21-
2216
#define ALLOW_RANGE /* enable "%[a-z]"-style scansets */
2317

24-
2518
/* temporary work-around for compiler without 64-bit support */
2619

2720
#ifndef _INTEGRAL_MAX_BITS
@@ -62,17 +55,6 @@
6255
#define LEFT_BRACKET ('[' | ('a' - 'A')) /* 'lowercase' version */
6356

6457
static int __cdecl _hextodec(_TCHAR);
65-
#ifdef CPRFLAG
66-
67-
#define INC() (++charcount, _inc())
68-
#define UN_INC(chr) (--charcount, _un_inc(chr))
69-
#define EAT_WHITE() _whiteout(&charcount)
70-
71-
static int __cdecl _inc(void);
72-
static void __cdecl _un_inc(int);
73-
static int __cdecl _whiteout(int *);
74-
75-
#else /* CPRFLAG */
7658

7759
#define INC() (++charcount, _inc(stream))
7860
#define UN_INC(chr) (--charcount, _un_inc(chr, stream))
@@ -82,8 +64,6 @@ static int __cdecl _inc(miniFILE *);
8264
static void __cdecl _un_inc(int, miniFILE *);
8365
static int __cdecl _whiteout(int *, miniFILE *);
8466

85-
#endif /* CPRFLAG */
86-
8767
#undef _ISDIGIT
8868
#undef _ISXDIGIT
8969

@@ -158,7 +138,6 @@ static int __check_float_string(size_t nFloatStrUsed,
158138
return TRUE;
159139
}
160140

161-
162141
#define ASCII 32 /* # of bytes needed to hold 256 bits */
163142

164143
#define SCAN_SHORT 0 /* also for FLOAT */
@@ -281,10 +260,7 @@ static int __check_float_string(size_t nFloatStrUsed,
281260
_TCHAR tch;
282261

283262
_VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
284-
285-
#ifndef CPRFLAG
286263
_VALIDATE_RETURN( (stream != NULL), EINVAL, EOF);
287-
#endif /* CPRFLAG */
288264

289265
/*
290266
count = # fields assigned
@@ -618,9 +594,7 @@ scanit:
618594

619595
ch = INC();
620596
if (
621-
#ifndef CPRFLAG
622597
(_TEOF != ch) &&
623-
#endif /* CPRFLAG */
624598
// char conditions
625599
( ( comchr == _T('c')) ||
626600
// string conditions !isspace()
@@ -1176,10 +1150,8 @@ f_incwidth2:
11761150
#endif
11771151
}
11781152

1179-
#ifndef CPRFLAG
11801153
if ( (_TEOF == ch) && ((*format != _T('%')) || (*(format + 1) != _T('n'))) )
11811154
break;
1182-
#endif /* CPRFLAG */
11831155

11841156
} /* WHILE (*format) */
11851157

@@ -1195,12 +1167,10 @@ error_return:
11951167
_free_crt(pFloatStr);
11961168
}
11971169

1198-
#ifndef CPRFLAG
11991170
if (_TEOF == ch)
12001171
/* If any fields were matched or assigned, return count */
12011172
return ( (count || match) ? count : EOF);
12021173
else
1203-
#endif /* CPRFLAG */
12041174
#ifdef _SECURE_SCANF
12051175
if(format_error == TRUE) {
12061176
_VALIDATE_RETURN( ("Invalid Input Format" && 0), EINVAL, count);
@@ -1219,40 +1189,6 @@ static int __cdecl _hextodec ( _TCHAR chr)
12191189
return _ISDIGIT(chr) ? chr : (chr & ~(_T('a') - _T('A'))) - _T('A') + 10 + _T('0');
12201190
}
12211191

1222-
#ifdef CPRFLAG
1223-
1224-
static int __cdecl _inc(void)
1225-
{
1226-
return (_gettche_nolock());
1227-
}
1228-
1229-
static void __cdecl _un_inc(int chr)
1230-
{
1231-
if (_TEOF != chr) {
1232-
_ungettch_nolock(chr);
1233-
}
1234-
}
1235-
1236-
static int __cdecl _whiteout(REG1 int* counter)
1237-
{
1238-
REG2 int ch;
1239-
1240-
do
1241-
{
1242-
++*counter;
1243-
ch = _inc();
1244-
1245-
if (ch == _TEOF)
1246-
{
1247-
break;
1248-
}
1249-
}
1250-
while(_istspace((_TUCHAR)ch));
1251-
return ch;
1252-
}
1253-
1254-
#else /* CPRFLAG */
1255-
12561192
static int __cdecl _inc(miniFILE* fileptr)
12571193
{
12581194
return (_gettc_nolock(fileptr));
@@ -1282,5 +1218,3 @@ static int __cdecl _whiteout(int* counter, miniFILE* fileptr)
12821218
while(_istspace((_TUCHAR)ch));
12831219
return ch;
12841220
}
1285-
1286-
#endif /* CPRFLAG */

0 commit comments

Comments
 (0)