FastLED 3.10.10
Loading...
Searching...
No Matches

◆ write() [8/11]

fl::size fl::basic_string::write ( const i64 & val)

Definition at line 351 of file basic_string.cpp.hpp.

351 {
352 char buf[64] = {0};
353#if FL_PLATFORM_HAS_LARGE_MEMORY
354 int len = fl::itoa64(val, buf, 10);
355#else
356 // Low-memory gate per #3224 Tier 3G: route through the 32-bit itoa to
357 // avoid `__udivmoddi4` + `__clzdi2`. Values outside INT32 range saturate
358 // to INT32_MIN / INT32_MAX. Sketches that need full int64 formatting on
359 // Low-memory can opt in by defining FL_PLATFORM_HAS_LARGE_MEMORY=1.
360 fl::i32 narrow = val > 2147483647LL ? 2147483647
361 : val < -2147483648LL ? -2147483648
362 : static_cast<fl::i32>(val);
363 int len = fl::itoa(narrow, buf, 10);
364#endif
365 return write(buf, len);
366}
fl::size write(const fl::u8 *data, fl::size n) FL_NO_EXCEPT
int itoa64(i64 value, char *sp, int radix) FL_NO_EXCEPT
Convert signed 64-bit integer to string buffer in given radix.
int itoa(i32 value, char *sp, int radix) FL_NO_EXCEPT
Convert signed 32-bit integer to string buffer in given radix.

References fl::FL_NO_EXCEPT.