Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored declaring multiple variables on a single line #550

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b0573ef
Update _MSVC_STL_UPDATE value to February 2020
JeanPhilippeKernel Feb 6, 2020
7e5b7b3
Updated macro constants to constexpr variables #270
JeanPhilippeKernel Feb 6, 2020
59b9474
Revert "Updated macro constants to constexpr variables #270"
JeanPhilippeKernel Feb 6, 2020
91167a0
Changed macro constants to constexpr variables #270
JeanPhilippeKernel Feb 6, 2020
44604c6
Merge branch 'master' of https://github.com/microsoft/STL into fix-ma…
JeanPhilippeKernel Feb 6, 2020
eecf828
updated variables to _Ugly naming convention
JeanPhilippeKernel Feb 7, 2020
c403c18
Update stl/src/xtime.cpp
JeanPhilippeKernel Feb 7, 2020
8551ae8
updated macro change
JeanPhilippeKernel Feb 7, 2020
fd3f8e8
removed unecesarry comment
JeanPhilippeKernel Feb 7, 2020
0dfcf9f
Merge branch 'master' of https://github.com/microsoft/STL into fix-ma…
JeanPhilippeKernel Feb 7, 2020
bde3b36
clang-format updated
JeanPhilippeKernel Feb 7, 2020
e483f6a
removed unnecessary parentheses
JeanPhilippeKernel Feb 7, 2020
1eee336
Update comments.
StephanTLavavej Feb 7, 2020
72c9caa
Merge branch 'master' of https://github.com/microsoft/STL into fix-ma…
JeanPhilippeKernel Feb 8, 2020
141a36d
Merge branch 'master' of https://github.com/microsoft/STL
JeanPhilippeKernel Feb 26, 2020
f4dbc82
added llvm-project
JeanPhilippeKernel Feb 26, 2020
08b8895
Refactored declaring multiple variables on a single line (#522)
JeanPhilippeKernel Feb 26, 2020
23d8354
revert llvm-project bits changes
JeanPhilippeKernel Feb 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stl/inc/cvt/wbuffer
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ namespace stdext {

while (_Status != _Eof) { // get using codecvt facet
char* _Buf = &_Str[0];
_Elem _Ch, *_Dest;
_Elem _Ch;
_Elem* _Dest;
const char* _Src;
int _Meta;

Expand Down
52 changes: 35 additions & 17 deletions stl/inc/iostream
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,45 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
#ifdef _M_CEE_PURE
__PURE_APPDOMAIN_GLOBAL extern istream cin, *_Ptr_cin;
__PURE_APPDOMAIN_GLOBAL extern ostream cout, *_Ptr_cout;
__PURE_APPDOMAIN_GLOBAL extern ostream cerr, *_Ptr_cerr;
__PURE_APPDOMAIN_GLOBAL extern ostream clog, *_Ptr_clog;
__PURE_APPDOMAIN_GLOBAL extern istream cin;
__PURE_APPDOMAIN_GLOBAL extern ostream cout;
__PURE_APPDOMAIN_GLOBAL extern ostream cerr;
__PURE_APPDOMAIN_GLOBAL extern ostream clog;
__PURE_APPDOMAIN_GLOBAL extern istream* _Ptr_cin;
__PURE_APPDOMAIN_GLOBAL extern ostream* _Ptr_cout;
__PURE_APPDOMAIN_GLOBAL extern ostream* _Ptr_cerr;
__PURE_APPDOMAIN_GLOBAL extern ostream* _Ptr_clog;

__PURE_APPDOMAIN_GLOBAL extern wistream wcin;
__PURE_APPDOMAIN_GLOBAL extern wostream wcout;
__PURE_APPDOMAIN_GLOBAL extern wostream wcerr;
__PURE_APPDOMAIN_GLOBAL extern wostream wclog;
__PURE_APPDOMAIN_GLOBAL extern wistream* _Ptr_wcin;
__PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcout;
__PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcerr;
__PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wclog;

__PURE_APPDOMAIN_GLOBAL extern wistream wcin, *_Ptr_wcin;
__PURE_APPDOMAIN_GLOBAL extern wostream wcout, *_Ptr_wcout;
__PURE_APPDOMAIN_GLOBAL extern wostream wcerr, *_Ptr_wcerr;
__PURE_APPDOMAIN_GLOBAL extern wostream wclog, *_Ptr_wclog;

#else // _M_CEE_PURE
// OBJECTS
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream cin, *_Ptr_cin;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cout, *_Ptr_cout;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cerr, *_Ptr_cerr;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream clog, *_Ptr_clog;

__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wistream wcin, *_Ptr_wcin;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wcout, *_Ptr_wcout;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wcerr, *_Ptr_wcerr;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wclog, *_Ptr_wclog;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream cin;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cout;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cerr;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream clog;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream* _Ptr_cin;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream* _Ptr_cout;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream* _Ptr_cerr;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream* _Ptr_clog;

__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wistream wcin;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wcout;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wcerr;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wclog;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wistream* _Ptr_wcin;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wcout;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wcerr;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wclog;


// CLASS _Winit
class _CRTIMP2_PURE_IMPORT _Winit {
Expand Down
4 changes: 3 additions & 1 deletion stl/inc/random
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,9 @@ struct _Circ_buf { // holds historical values for generators
bool _Equals(const _Circ_buf& _Right) const {
const _Ty* _Last1 = _Ax + _Idx;
const _Ty* _Last2 = _Right._Ax + _Right._Idx;
const _Ty *_First, *_Last, *_Other;
const _Ty* _First;
const _Ty* _Last;
const _Ty* _Other;
bool _Use2 = _Base() < _Right._Base();

if (_Use2) { // _Right's range is higher up in the array
Expand Down
9 changes: 6 additions & 3 deletions stl/inc/xiosbase
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ private:
}

_Iosarray& __CLR_OR_THIS_CALL _Findarr(int _Idx) { // locate or make a variable array element
_Iosarray *_Ptr1, *_Ptr2;
_Iosarray* _Ptr1;
_Iosarray* _Ptr2;

for (_Ptr1 = _Arr, _Ptr2 = nullptr; _Ptr1; _Ptr1 = _Ptr1->_Next) {
if (_Ptr1->_Index == _Idx) {
Expand All @@ -529,15 +530,17 @@ private:

void __CLR_OR_THIS_CALL _Tidy() noexcept { // discard storage for an ios_base
_Callfns(erase_event);
_Iosarray *_Ptr1, *_Ptr2;
_Iosarray* _Ptr1;
_Iosarray* _Ptr2;

for (_Ptr1 = _Arr; _Ptr1; _Ptr1 = _Ptr2) { // delete array element
_Ptr2 = _Ptr1->_Next;
delete _Ptr1;
}
_Arr = nullptr;

_Fnarray *_Pfa1, *_Pfa2;
_Fnarray* _Pfa1;
_Fnarray* _Pfa2;
for (_Pfa1 = _Calls; _Pfa1; _Pfa1 = _Pfa2) { // delete callback element
_Pfa2 = _Pfa1->_Next;
delete _Pfa1;
Expand Down
16 changes: 13 additions & 3 deletions stl/inc/ymath.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,33 @@ _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double*);
_CRTIMP2_PURE double __CLRCALL_PURE_OR_CDECL _Sinh(double, double);

_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Exp(double*, double, short);
extern _CRTIMP2_PURE_IMPORT /* const */ _Dconst _Denorm, _Hugeval, _Inf, _Nan, _Snan;
extern _CRTIMP2_PURE_IMPORT _Dconst _Denorm;
extern _CRTIMP2_PURE_IMPORT _Dconst _Hugeval;
extern _CRTIMP2_PURE_IMPORT _Dconst _Inf;
extern _CRTIMP2_PURE_IMPORT _Dconst _Nan;
extern _CRTIMP2_PURE_IMPORT _Dconst _Snan;

// float DECLARATIONS
_CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _FCosh(float, float);
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDtest(float*);
_CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _FSinh(float, float);

_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FExp(float*, float, short);
extern _CRTIMP2_PURE_IMPORT /* const */ _Dconst _FDenorm, _FInf, _FNan, _FSnan;
extern _CRTIMP2_PURE_IMPORT _Dconst _FDenorm;
extern _CRTIMP2_PURE_IMPORT _Dconst _FInf;
extern _CRTIMP2_PURE_IMPORT _Dconst _FNan;
extern _CRTIMP2_PURE_IMPORT _Dconst _FSnan;

// long double DECLARATIONS
_CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _LCosh(long double, long double);
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _LDtest(long double*);
_CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _LSinh(long double, long double);

_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _LExp(long double*, long double, short);
extern _CRTIMP2_PURE_IMPORT /* const */ _Dconst _LDenorm, _LInf, _LNan, _LSnan;
extern _CRTIMP2_PURE_IMPORT _Dconst _LDenorm;
extern _CRTIMP2_PURE_IMPORT _Dconst _LInf;
extern _CRTIMP2_PURE_IMPORT _Dconst _LNan;
extern _CRTIMP2_PURE_IMPORT _Dconst _LSnan;

_END_EXTERN_C_UNLESS_PURE

Expand Down
4 changes: 3 additions & 1 deletion stl/src/filesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ _FS_DLL space_info __CLRCALL_PURE_OR_CDECL _Statvfs(const wchar_t* _Fname) {
_Devname.push_back(L'/');
}

_ULARGE_INTEGER _Available, _Capacity, _Free;
_ULARGE_INTEGER _Available;
_ULARGE_INTEGER _Capacity;
_ULARGE_INTEGER _Free;

if (GetDiskFreeSpaceExW(_Devname.c_str(), &_Available, &_Capacity, &_Free)) { // convert values
_Ans.capacity = _Capacity.QuadPart;
Expand Down
3 changes: 2 additions & 1 deletion stl/src/xstol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ _CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char*, char**,
_CRTIMP2_PURE long __CLRCALL_PURE_OR_CDECL _Stolx(
const char* s, char** endptr, int base, int* perr) { // convert string to long, with checking
const char* sc;
char *se, sign;
char* se;
char sign;
unsigned long x;

if (endptr == 0) {
Expand Down
3 changes: 2 additions & 1 deletion stl/src/xstoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ _CRTIMP2_PURE unsigned long long __CLRCALL_PURE_OR_CDECL _Stoullx(const char*, c
_CRTIMP2_PURE long long __CLRCALL_PURE_OR_CDECL _Stollx(
const char* s, char** endptr, int base, int* perr) { // convert string to long long, with checking
const char* sc;
char *se, sign;
char* se;
char sign;
unsigned long long x;

if (endptr == 0) {
Expand Down
9 changes: 6 additions & 3 deletions stl/src/xstoul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ static const char ndigs[_Base_max + 1] = {0, 0, 33, 21, 17, 14, 13, 12, 11, 11,

_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(
const char* s, char** endptr, int base, int* perr) { // convert string to unsigned long, with checking
const char *sc, *sd;
const char *s1, *s2;
const char* sc;
const char* sd;
const char* s1;
const char* s2;
char dig = 0;
char sign;
ptrdiff_t n;
unsigned long x, y;
unsigned long x;
unsigned long y;

if (perr != 0) {
*perr = 0;
Expand Down
12 changes: 8 additions & 4 deletions stl/src/xstoull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ static const char ndigs[_Base_max + 1] = {0, 0, 65, 41, 33, 28, 25, 23, 22, 21,

_CRTIMP2_PURE unsigned long long __CLRCALL_PURE_OR_CDECL _Stoullx(
const char* s, char** endptr, int base, int* perr) { // convert string to unsigned long long, with checking
const char *sc, *sd;
const char *s1, *s2;
char dig, sign;
const char* sc;
const char* sd;
const char* s1;
const char* s2;
char dig;
char sign;
ptrdiff_t n;
unsigned long long x, y;
unsigned long long x;
unsigned long long y;

if (perr != 0) {
*perr = 0;
Expand Down
9 changes: 6 additions & 3 deletions stl/src/xxxprec.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ FTYPE FNAME(Xp_getw)(const FTYPE* p, int n) { // get total value

FTYPE* FNAME(Xp_setw)(FTYPE* p, int n, FTYPE x) { // load a full-precision value
FTYPE x0 = x;
short errx, xexp;
short errx;
short xexp;

if (n > 0) {
if (n == 1 || (errx = FNAME(Dunscale)(&xexp, &x0)) == 0) {
Expand Down Expand Up @@ -102,7 +103,8 @@ FTYPE* FNAME(Xp_setw)(FTYPE* p, int n, FTYPE x) { // load a full-precision value

FTYPE* FNAME(Xp_addh)(FTYPE* p, int n, FTYPE x0) { // add a half-precision value
FTYPE xscaled = x0;
short errx, xexp;
short errx;
short xexp;

if (n != 0) {
if (0 < (errx = FNAME(Dunscale)(&xexp, &xscaled))) {
Expand Down Expand Up @@ -209,7 +211,8 @@ FTYPE* FNAME(Xp_addh)(FTYPE* p, int n, FTYPE x0) { // add a half-precision value

FTYPE* FNAME(Xp_mulh)(FTYPE* p, int n, FTYPE x0) { // multiply by a half-precision value
short errx;
int j, k;
int j;
int k;
FTYPE buf[NBUF];

if (0 < n) { // check for special values
Expand Down