Skip to content

Commit 473e3c4

Browse files
committed
fix -Wimplicit-int-conversion
1 parent 0980f1b commit 473e3c4

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

src/libcxx/include/__memory_resource/unsynchronized_pool_resource.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI unsynchronized_pool_res
105105
__adhoc_pool __adhoc_pool_;
106106
__fixed_pool* __fixed_pools_;
107107
int __num_fixed_pools_;
108+
#ifndef _EZ80
108109
uint32_t __options_max_blocks_per_chunk_;
110+
#else // _EZ80
111+
size_t __options_max_blocks_per_chunk_;
112+
#endif // _EZ80
109113
};
110114

111115
} // namespace pmr

src/libcxx/src/include/ryu/common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@
4848

4949
_LIBCPP_BEGIN_NAMESPACE_STD
5050

51+
#ifndef _EZ80
5152
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __decimalLength9(const uint32_t __v) {
53+
#else // _EZ80
54+
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline unsigned __decimalLength9(const uint32_t __v) {
55+
#endif // _EZ80
5256
// Function precondition: __v is not a 10-digit number.
5357
// (f2s: 9 digits are sufficient for round-tripping.)
5458
// (d2fixed: We print 9-digit blocks.)

src/libcxx/src/ryu/d2fixed.cpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
236236
#else // _EZ80
237237
[[nodiscard]] to_chars_result __d2fixed_buffered_n(char* _First, char* const _Last, const long double __d,
238238
#endif // _EZ80
239-
239+
#ifndef _EZ80
240240
const uint32_t __precision) {
241+
#else // _EZ80
242+
const unsigned __precision) {
243+
#endif // _EZ80
241244
char* const _Original_first = _First;
242245

243246
const uint64_t __bits = __double_to_bits(__d);
@@ -317,10 +320,18 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
317320
}
318321
if (__e2 < 0) {
319322
const int32_t __idx = -__e2 / 16;
323+
#ifndef _EZ80
320324
const uint32_t __blocks = __precision / 9 + 1;
325+
#else // _EZ80
326+
const unsigned __blocks = __precision / 9 + 1;
327+
#endif // _EZ80
321328
// 0 = don't round up; 1 = round up unconditionally; 2 = round up if odd.
322329
int __roundUp = 0;
330+
#ifndef _EZ80
323331
uint32_t __i = 0;
332+
#else // _EZ80
333+
unsigned __i = 0;
334+
#endif // _EZ80
324335
if (__blocks <= __MIN_BLOCK_2[__idx]) {
325336
__i = __blocks;
326337
if (_Last - _First < static_cast<ptrdiff_t>(__precision)) {
@@ -342,7 +353,11 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
342353
if (__p >= __POW10_OFFSET_2[__idx + 1]) {
343354
// If the remaining digits are all 0, then we might as well use memset.
344355
// No rounding required in this case.
356+
#ifndef _EZ80
345357
const uint32_t __fill = __precision - 9 * __i;
358+
#else // _EZ80
359+
const unsigned __fill = __precision - 9 * __i;
360+
#endif // _EZ80
346361
if (_Last - _First < static_cast<ptrdiff_t>(__fill)) {
347362
return { _Last, errc::value_too_large };
348363
}
@@ -431,7 +446,11 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
431446
#else // _EZ80
432447
[[nodiscard]] to_chars_result __d2exp_buffered_n(char* _First, char* const _Last, const long double __d,
433448
#endif // _EZ80
449+
#ifndef _EZ80
434450
uint32_t __precision) {
451+
#else // _EZ80
452+
unsigned __precision) {
453+
#endif // _EZ80
435454
char* const _Original_first = _First;
436455

437456
const uint64_t __bits = __double_to_bits(__d);
@@ -473,8 +492,13 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
473492
const bool __printDecimalPoint = __precision > 0;
474493
++__precision;
475494
uint32_t __digits = 0;
495+
#ifndef _EZ80
476496
uint32_t __printedDigits = 0;
477497
uint32_t __availableDigits = 0;
498+
#else // _EZ80
499+
unsigned __printedDigits = 0;
500+
unsigned __availableDigits = 0;
501+
#endif // _EZ80
478502
int32_t __exp = 0;
479503
if (__e2 >= -52) {
480504
const uint32_t __idx = __e2 < 0 ? 0 : __indexForExponent(static_cast<uint32_t>(__e2));
@@ -564,7 +588,11 @@ void __append_nine_digits(uint32_t __digits, char* const __result) {
564588
}
565589
}
566590

591+
#ifndef _EZ80
567592
const uint32_t __maximum = __precision - __printedDigits;
593+
#else // _EZ80
594+
const unsigned __maximum = __precision - __printedDigits;
595+
#endif // _EZ80
568596
if (__availableDigits == 0) {
569597
__digits = 0;
570598
}

src/libcxx/src/strstream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ strstreambuf::pos_type strstreambuf::seekoff(off_type __off, ios_base::seekdir _
216216
// min(pbase, newpos), newpos, epptr()
217217
__off = epptr() - newpos;
218218
setp(min(pbase(), newpos), epptr());
219-
__pbump((epptr() - pbase()) - __off);
219+
__pbump(static_cast<streamsize>((epptr() - pbase()) - __off));
220220
}
221221
return pos_type(newoff);
222222
}
@@ -242,7 +242,7 @@ strstreambuf::pos_type strstreambuf::seekpos(pos_type __sp, ios_base::openmode _
242242
// min(pbase, newpos), newpos, epptr()
243243
off_type temp = epptr() - newpos;
244244
setp(min(pbase(), newpos), epptr());
245-
__pbump((epptr() - pbase()) - temp);
245+
__pbump(static_cast<streamsize>((epptr() - pbase()) - temp));
246246
}
247247
return pos_type(newoff);
248248
}

0 commit comments

Comments
 (0)