File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -374,16 +374,16 @@ extern "C"
374374 } else if (std::isinf (v)) {
375375 if (v > 0 ) {
376376 StringPtr *ret = string_pool_new ();
377- string_assign_cstring (ret, " Infinity " );
377+ string_assign (ret, &INFINITY_STR );
378378 return ret;
379379 } else {
380380 StringPtr *ret = string_pool_new ();
381- string_assign_cstring (ret, " -Infinity " );
381+ string_assign (ret, &NEGATIVE_INFINITY_STR );
382382 return ret;
383383 }
384384 } else if (std::isnan (v)) {
385385 StringPtr *ret = string_pool_new ();
386- string_assign_cstring (ret, " NaN " );
386+ string_assign (ret, &NAN_STR );
387387 return ret;
388388 }
389389
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ namespace libscratchcpp
2323
2424static const StringPtr TRUE_STR (" true" );
2525static const StringPtr FALSE_STR (" false" );
26+ static const StringPtr INFINITY_STR (" Infinity" );
27+ static const StringPtr NEGATIVE_INFINITY_STR (" -Infinity" );
28+ static const StringPtr NAN_STR (" NaN" );
2629
2730template <typename T>
2831inline unsigned int value_intDigitCount (T v)
You can’t perform that action at this time.
0 commit comments