equal
deleted
inserted
replaced
294 FIX_STRING(s); |
294 FIX_STRING(s); |
295 *a = str_to_int(s.str); |
295 *a = str_to_int(s.str); |
296 } |
296 } |
297 |
297 |
298 LongInt fpcrtl_random(LongInt l) { |
298 LongInt fpcrtl_random(LongInt l) { |
|
299 // random(0) is undefined in docs but effectively returns 0 in free pascal |
|
300 if (l == 0) { |
|
301 printf("WARNING: random(0) called!"); |
|
302 return 0; |
|
303 } |
299 return (LongInt) (rand() / (double) RAND_MAX * l); |
304 return (LongInt) (rand() / (double) RAND_MAX * l); |
300 } |
305 } |
301 |
306 |
302 void __attribute__((overloadable)) fpcrtl_str__vars(float x, string255 *s) { |
307 void __attribute__((overloadable)) fpcrtl_str__vars(float x, string255 *s) { |
303 sprintf(s->str, "%f", x); |
308 sprintf(s->str, "%f", x); |