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

<xlocale>: _Uglify non-conforming locale::c_str() #3088

Merged
merged 2 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions stl/inc/xlocale
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public:
return _Ptr ? _Ptr->_Name.c_str() : string{};
}

_Ret_z_ const char* c_str() const {
_Ret_z_ const char* _C_str() const noexcept {
return _Ptr ? _Ptr->_Name.c_str() : "";
}

Expand Down Expand Up @@ -717,7 +717,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new codecvt(_Locinfo(_Ploc->c_str()));
*_Ppf = new codecvt(_Locinfo(_Ploc->_C_str()));
}

return _X_CTYPE;
Expand Down Expand Up @@ -899,7 +899,7 @@ public:
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
_STL_DISABLE_DEPRECATED_WARNING
*_Ppf = new codecvt(_Locinfo(_Ploc->c_str()));
*_Ppf = new codecvt(_Locinfo(_Ploc->_C_str()));
_STL_RESTORE_DEPRECATED_WARNING
}

Expand Down Expand Up @@ -1197,7 +1197,7 @@ public:
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
_STL_DISABLE_DEPRECATED_WARNING
*_Ppf = new codecvt(_Locinfo(_Ploc->c_str()));
*_Ppf = new codecvt(_Locinfo(_Ploc->_C_str()));
_STL_RESTORE_DEPRECATED_WARNING
}

Expand Down Expand Up @@ -1965,7 +1965,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new codecvt(_Locinfo(_Ploc->c_str()));
*_Ppf = new codecvt(_Locinfo(_Ploc->_C_str()));
}

return _X_CTYPE;
Expand Down Expand Up @@ -2164,7 +2164,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new codecvt(_Locinfo(_Ploc->c_str()));
*_Ppf = new codecvt(_Locinfo(_Ploc->_C_str()));
}

return _X_CTYPE;
Expand Down Expand Up @@ -2459,7 +2459,7 @@ public:

static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
if (_Ppf && !*_Ppf) {
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->c_str()));
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->_C_str()));
}

return _X_CTYPE;
Expand Down Expand Up @@ -2716,7 +2716,7 @@ public:

static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
if (_Ppf && !*_Ppf) {
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->c_str()));
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->_C_str()));
}

return _X_CTYPE;
Expand Down Expand Up @@ -2881,7 +2881,7 @@ public:

static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
if (_Ppf && !*_Ppf) {
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->c_str()));
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->_C_str()));
}

return _X_CTYPE;
Expand Down Expand Up @@ -3082,7 +3082,7 @@ public:

static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
if (_Ppf && !*_Ppf) {
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->c_str()));
*_Ppf = new ctype<_Elem>(_Locinfo(_Ploc->_C_str()));
}

return _X_CTYPE;
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xlocmes
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public:
static size_t _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new messages<_Elem>(_Locinfo(_Ploc->c_str()));
*_Ppf = new messages<_Elem>(_Locinfo(_Ploc->_C_str()));
}

return _X_MESSAGES;
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/xlocmon
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public:
static size_t _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new moneypunct<_Elem, _Intl>(_Locinfo(_Ploc->c_str()), 0, true);
*_Ppf = new moneypunct<_Elem, _Intl>(_Locinfo(_Ploc->_C_str()), 0, true);
}

return _X_MONETARY;
Expand Down Expand Up @@ -337,7 +337,7 @@ public:
static size_t _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new money_get<_Elem, _InIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new money_get<_Elem, _InIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_MONETARY;
Expand Down Expand Up @@ -641,7 +641,7 @@ public:
static size_t _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new money_put<_Elem, _OutIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new money_put<_Elem, _OutIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_MONETARY;
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/xlocnum
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public:
static size_t _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new numpunct<_Elem>(_Locinfo(_Ploc->c_str()), 0, true);
*_Ppf = new numpunct<_Elem>(_Locinfo(_Ploc->_C_str()), 0, true);
}
return _X_NUMERIC;
}
Expand Down Expand Up @@ -263,7 +263,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new num_get<_Elem, _InIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new num_get<_Elem, _InIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_NUMERIC;
Expand Down Expand Up @@ -1169,7 +1169,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new num_put<_Elem, _OutIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new num_put<_Elem, _OutIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_NUMERIC;
Expand Down
8 changes: 4 additions & 4 deletions stl/inc/xloctime
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new time_get<_Elem, _InIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new time_get<_Elem, _InIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_TIME;
Expand Down Expand Up @@ -711,7 +711,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new time_put<_Elem, _OutIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new time_put<_Elem, _OutIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_TIME;
Expand Down Expand Up @@ -836,7 +836,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new time_put<_Elem, _OutIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new time_put<_Elem, _OutIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_TIME;
Expand Down Expand Up @@ -968,7 +968,7 @@ public:
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) {
// return locale category mask and construct standard facet
if (_Ppf && !*_Ppf) {
*_Ppf = new time_put<_Elem, _OutIt>(_Locinfo(_Ploc->c_str()));
*_Ppf = new time_put<_Elem, _OutIt>(_Locinfo(_Ploc->_C_str()));
}

return _X_TIME;
Expand Down