Skip to content

Commit 4de4349

Browse files
committed
[UCRT] Fix non-standard literal suffixes
1 parent ffd6975 commit 4de4349

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

sdk/lib/ucrt/filesystem/findfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static Integer convert_file_size_to_integer(DWORD const high, DWORD const low) t
6666
template <>
6767
static __int64 convert_file_size_to_integer(DWORD const high, DWORD const low) throw()
6868
{
69-
return static_cast<__int64>(high) * 0x100000000i64 + static_cast<__int64>(low);
69+
return static_cast<__int64>(high) * 0x100000000ll + static_cast<__int64>(low);
7070
}
7171

7272
template <>

sdk/lib/ucrt/filesystem/stat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static bool __cdecl compute_size(BY_HANDLE_FILE_INFORMATION const& file_info, __
8383
_VALIDATE_RETURN_NOEXC(file_info.nFileSizeHigh <= LONG_MAX, EOVERFLOW, false);
8484

8585
size = static_cast<__int64>(
86-
static_cast<unsigned __int64>(file_info.nFileSizeHigh) * 0x100000000i64 +
86+
static_cast<unsigned __int64>(file_info.nFileSizeHigh) * 0x100000000ll +
8787
static_cast<unsigned __int64>(file_info.nFileSizeLow));
8888
return true;
8989
}

sdk/lib/ucrt/inc/corecrt_internal_fltintrn.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ struct __acrt_floating_type_traits<double>
7171

7272
enum : uint64_t
7373
{
74-
exponent_mask = (1ui64 << (exponent_bits )) - 1,
75-
normal_mantissa_mask = (1ui64 << (mantissa_bits )) - 1,
76-
denormal_mantissa_mask = (1ui64 << (mantissa_bits - 1)) - 1,
74+
exponent_mask = (1ull << (exponent_bits )) - 1,
75+
normal_mantissa_mask = (1ull << (mantissa_bits )) - 1,
76+
denormal_mantissa_mask = (1ull << (mantissa_bits - 1)) - 1,
7777

78-
special_nan_mantissa_mask = (1ui64 << (mantissa_bits - 2))
78+
special_nan_mantissa_mask = (1ull << (mantissa_bits - 2))
7979
};
8080

8181
struct components_type

sdk/lib/ucrt/inc/corecrt_internal_strtox.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,9 @@ __forceinline uint64_t __cdecl right_shift_with_rounding(
687687
return 0;
688688
}
689689

690-
uint64_t const extra_bits_mask = (1ui64 << (shift - 1)) - 1;
691-
uint64_t const round_bit_mask = (1ui64 << (shift - 1));
692-
uint64_t const lsb_bit_mask = 1ui64 << shift;
690+
uint64_t const extra_bits_mask = (1ull << (shift - 1)) - 1;
691+
uint64_t const round_bit_mask = (1ull << (shift - 1));
692+
uint64_t const lsb_bit_mask = 1ull << shift;
693693

694694
bool const lsb_bit = (value & lsb_bit_mask) != 0;
695695
bool const round_bit = (value & round_bit_mask) != 0;
@@ -1140,7 +1140,7 @@ inline SLD_STATUS __cdecl convert_decimal_string_to_floating_type_common(
11401140
if (fractional_mantissa_bits > required_fractional_bits_of_precision)
11411141
{
11421142
uint32_t const shift = fractional_mantissa_bits - required_fractional_bits_of_precision;
1143-
has_zero_tail = has_zero_tail && (fractional_mantissa & ((1ui64 << shift) - 1)) == 0;
1143+
has_zero_tail = has_zero_tail && (fractional_mantissa & ((1ull << shift) - 1)) == 0;
11441144
fractional_mantissa >>= shift;
11451145
}
11461146

sdk/lib/ucrt/inc/corecrt_internal_time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
//
2626
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2727
// Number of 100 nanosecond units from 1/1/1601 to 1/1/1970
28-
#define _EPOCH_BIAS 116444736000000000i64
28+
#define _EPOCH_BIAS 116444736000000000ll
2929

3030
#define _DAY_SEC (24 * 60 * 60) // Seconds in a day
3131
#define _YEAR_SEC (365 * _DAY_SEC) // Seconds in a year

sdk/lib/ucrt/lowio/eof.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ extern "C" int __cdecl _eof(int const fh)
2929
return -1;
3030
}
3131

32-
__int64 const here = _lseeki64_nolock(fh, 0i64, SEEK_CUR);
33-
if (here == -1i64)
32+
__int64 const here = _lseeki64_nolock(fh, 0ll, SEEK_CUR);
33+
if (here == -1ll)
3434
return -1;
3535

3636

37-
__int64 const end = _lseeki64_nolock(fh, 0i64, SEEK_END);
38-
if (end == -1i64)
37+
__int64 const end = _lseeki64_nolock(fh, 0ll, SEEK_END);
38+
if (end == -1ll)
3939
return -1;
4040

4141
// Now we can test if we're at the end:

sdk/lib/ucrt/time/ftime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static errno_t __cdecl common_ftime_s(TimeBType* const tp) throw()
4848

4949
// Obtain the current Daylight Savings Time status. Note that the status is
5050
// cached and only updated once per minute, if necessary.
51-
TimeType const current_minutes_value = static_cast<TimeType>(system_time._scalar / 600000000i64);
51+
TimeType const current_minutes_value = static_cast<TimeType>(system_time._scalar / 600000000ll);
5252
if (static_cast<__time64_t>(current_minutes_value) != elapsed_minutes_cache)
5353
{
5454
TIME_ZONE_INFORMATION tz_info;
@@ -78,8 +78,8 @@ static errno_t __cdecl common_ftime_s(TimeBType* const tp) throw()
7878
}
7979

8080
tp->dstflag = static_cast<short>(dstflag_cache);
81-
tp->millitm = static_cast<unsigned short>((system_time._scalar / 10000i64) % 1000i64);
82-
tp->time = static_cast<TimeType>((system_time._scalar - _EPOCH_BIAS) / 10000000i64);
81+
tp->millitm = static_cast<unsigned short>((system_time._scalar / 10000ll) % 1000ll);
82+
tp->time = static_cast<TimeType>((system_time._scalar - _EPOCH_BIAS) / 10000000ll);
8383

8484
return 0;
8585
}

0 commit comments

Comments
 (0)