FastLED 3.10.6
Loading...
Searching...
No Matches

◆ write() [8/11]

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

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

337 {
338 char buf[64] = {0};
339#if FL_PLATFORM_HAS_LARGE_MEMORY
340 int len = fl::itoa64(val, buf, 10);
341#else
342 // Low-memory gate per #3224 Tier 3G: route through the 32-bit itoa to
343 // avoid `__udivmoddi4` + `__clzdi2`. Values outside INT32 range saturate
344 // to INT32_MIN / INT32_MAX. Sketches that need full int64 formatting on
345 // Low-memory can opt in by defining FL_PLATFORM_HAS_LARGE_MEMORY=1.
346 fl::i32 narrow = val > 2147483647LL ? 2147483647
347 : val < -2147483648LL ? -2147483648
348 : static_cast<fl::i32>(val);
349 int len = fl::itoa(narrow, buf, 10);
350#endif
351 return write(buf, len);
352}
fl::size write(const fl::u8 *data, fl::size n) FL_NO_EXCEPT
int itoa64(i64 value, char *sp, int radix)
Convert signed 64-bit integer to string buffer in given radix.
int itoa(i32 value, char *sp, int radix)
Convert signed 32-bit integer to string buffer in given radix.

References fl::itoa(), fl::itoa64(), and write().

+ Here is the call graph for this function: