Skip to content
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
4 changes: 2 additions & 2 deletions stl/inc/ios
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ _EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL hex(ios_base& _Iosbase) { // set
return _Iosbase;
}

_EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL hexfloat(ios_base& _Iosbase) { // set floatfield to hexfloat
_Iosbase.setf(ios_base::hexfloat, ios_base::floatfield);
_EXPORT_STD inline ios_base& __CLRCALL_OR_CDECL hexfloat(ios_base& _Iosbase) { // set floatfield to (scientific | fixed)
_Iosbase.setf(ios_base::scientific | ios_base::fixed, ios_base::floatfield);
return _Iosbase;
}

Expand Down
2 changes: 0 additions & 2 deletions stl/inc/xiosbase
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public:
static constexpr int scientific = 0x1000;
static constexpr int fixed = 0x2000;

static constexpr int hexfloat = 0x3000; // TRANSITION, ABI, GH-3296

static constexpr int boolalpha = 0x4000;
static constexpr int adjustfield = left | right | internal;
static constexpr int basefield = dec | oct | hex;
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/xlocnum
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ private:
if (_Flags & ios_base::uppercase) {
if (_Ffl == ios_base::fixed) {
_Ch = 'f';
} else if (_Ffl == ios_base::hexfloat) {
} else if (_Ffl == (ios_base::scientific | ios_base::fixed)) {
_Ch = 'A'; // added with TR1
} else if (_Ffl == ios_base::scientific) {
_Ch = 'E';
Expand All @@ -1451,7 +1451,7 @@ private:
} else {
if (_Ffl == ios_base::fixed) {
_Ch = 'f';
} else if (_Ffl == ios_base::hexfloat) {
} else if (_Ffl == (ios_base::scientific | ios_base::fixed)) {
_Ch = 'a'; // added with TR1
} else if (_Ffl == ios_base::scientific) {
_Ch = 'e';
Expand All @@ -1475,7 +1475,7 @@ private:
bool _Is_finite_val) const { // put formatted floating-point to _Dest
auto _Prefix = static_cast<size_t>(0 < _Count && (*_Buf == '+' || *_Buf == '-'));
const char* _Exps;
if ((_Iosbase.flags() & ios_base::floatfield) != ios_base::hexfloat) {
if ((_Iosbase.flags() & ios_base::floatfield) != (ios_base::scientific | ios_base::fixed)) {
_Exps = "eE";
} else { // correct for hexadecimal floating-point
_Exps = "pP";
Expand Down
18 changes: 8 additions & 10 deletions tests/tr1/tests/ios/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include <string.h>

// static data
static const STD ios_base::fmtflags ffl[] = {STD ios_base::hexfloat, STD ios_base::dec, STD ios_base::fixed,
STD ios_base::hex, STD ios_base::internal, STD ios_base::left, STD ios_base::oct, STD ios_base::right,
STD ios_base::scientific, STD ios_base::showbase, STD ios_base::showpoint, STD ios_base::showpos,
STD ios_base::skipws, STD ios_base::unitbuf, STD ios_base::uppercase, STD ios_base::boolalpha,
STD ios_base::adjustfield, STD ios_base::basefield, STD ios_base::floatfield};
static const STD ios_base::fmtflags ffl[] = {STD ios_base::dec, STD ios_base::fixed, STD ios_base::hex,
STD ios_base::internal, STD ios_base::left, STD ios_base::oct, STD ios_base::right, STD ios_base::scientific,
STD ios_base::showbase, STD ios_base::showpoint, STD ios_base::showpos, STD ios_base::skipws, STD ios_base::unitbuf,
STD ios_base::uppercase, STD ios_base::boolalpha, STD ios_base::adjustfield, STD ios_base::basefield,
STD ios_base::floatfield};

static const STD ios_base::iostate ifl[] = {
STD ios_base::badbit, STD ios_base::eofbit, STD ios_base::failbit, STD ios_base::goodbit};
Expand Down Expand Up @@ -86,8 +86,6 @@ void test_main() { // test basic workings of ios definitions
CHECK_INT(STD ios_base::dec | STD ios_base::oct | STD ios_base::hex, STD ios_base::basefield);
CHECK_INT(STD ios_base::scientific | STD ios_base::fixed, STD ios_base::floatfield);

CHECK_INT(STD ios_base::scientific | STD ios_base::fixed, STD ios_base::hexfloat);

// test assignment and control functions
CHECK(x && true);
CHECK(!x == 0);
Expand Down Expand Up @@ -170,7 +168,7 @@ void test_main() { // test basic workings of ios definitions
CHECK_INT(x.flags(), STD ios_base::scientific | STD ios_base::unitbuf);

x.clear(STD ios_base::floatfield);
x.setf(STD ios_base::hexfloat);
x.setf(STD ios_base::scientific | STD ios_base::fixed);
CHECK_INT(x.flags(), STD ios_base::scientific | STD ios_base::fixed | STD ios_base::unitbuf);

CHECK_INT(x.precision(INT_MIN), 6);
Expand Down Expand Up @@ -216,13 +214,13 @@ void test_main() { // test basic workings of ios definitions
CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::scientific);

STD hexfloat(*po);
CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::hexfloat);
CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::scientific | STD ios_base::fixed);

STD defaultfloat(*po);
CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right);

STD hexfloat(*po);
CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::hexfloat);
CHECK_INT(po->flags(), STD ios_base::oct | STD ios_base::right | STD ios_base::scientific | STD ios_base::fixed);

STD error_code ec1 = STD make_error_code(STD io_errc::stream);
CHECK(ec1.value() == (int) STD io_errc::stream);
Expand Down