2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
|
return NAN;
if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame)
return -NAN;
#if defined(HAVE_STRTOF_L) || defined(HAVE_USELOCALE)
const char *UTF8String = self.UTF8String;
#else
/*
* If we have no strtof_l, we have no other choice than to replace the
* locale's decimal point with something that will be rejected and
* replacing "." with the locale's decimal point.
*/
OFString *decimalSeparator = [OFLocale decimalSeparator];
const char *UTF8String = [[self
stringByReplacingOccurrencesOfString: decimalSeparator
withString: @"!"]
stringByReplacingOccurrencesOfString: @"."
withString: decimalSeparator].UTF8String;
#endif
char *endPtr = NULL;
float value;
errno = 0;
#if defined(HAVE_STRTOF_L)
value = strtof_l(UTF8String, &endPtr, cLocale);
|
>
>
>
>
>
>
|
|
|
|
>
|
<
|
|
|
|
|
>
|
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
|
return NAN;
if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame)
return -NAN;
#if defined(HAVE_STRTOF_L) || defined(HAVE_USELOCALE)
const char *UTF8String = self.UTF8String;
#else
OFString *decimalSeparator = [OFLocale decimalSeparator];
const char *UTF8String;
if ([decimalSeparator isEqual: @"."])
UTF8String = self.UTF8String;
else
/*
* If we have no strtof_l, we have no other choice than to
* replace the locale's decimal point with something that will
* be rejected and replacing "." with the locale's decimal
* point.
*/
UTF8String = [[self
stringByReplacingOccurrencesOfString: decimalSeparator
withString: @"!"]
stringByReplacingOccurrencesOfString: @"."
withString: decimalSeparator]
.UTF8String;
#endif
char *endPtr = NULL;
float value;
errno = 0;
#if defined(HAVE_STRTOF_L)
value = strtof_l(UTF8String, &endPtr, cLocale);
|
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
|
return NAN;
if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame)
return -NAN;
#if defined(HAVE_STRTOD_L) || defined(HAVE_USELOCALE)
const char *UTF8String = self.UTF8String;
#else
/*
* If we have no strtod_l, we have no other choice than to replace the
* locale's decimal point with something that will be rejected and
* replacing "." with the locale's decimal point.
*/
OFString *decimalSeparator = [OFLocale decimalSeparator];
const char *UTF8String = [[self
stringByReplacingOccurrencesOfString: decimalSeparator
withString: @"!"]
stringByReplacingOccurrencesOfString: @"."
withString: decimalSeparator].UTF8String;
#endif
char *endPtr = NULL;
double value;
errno = 0;
#if defined(HAVE_STRTOD_L)
value = strtod_l(UTF8String, &endPtr, cLocale);
|
>
>
>
>
>
>
|
|
|
|
>
|
<
|
|
|
|
|
>
|
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
|
return NAN;
if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame)
return -NAN;
#if defined(HAVE_STRTOD_L) || defined(HAVE_USELOCALE)
const char *UTF8String = self.UTF8String;
#else
OFString *decimalSeparator = [OFLocale decimalSeparator];
const char *UTF8String;
if ([decimalSeparator isEqual: @"."])
UTF8String = self.UTF8String;
else
/*
* If we have no strtod_l, we have no other choice than to
* replace the locale's decimal point with something that will
* be rejected and replacing "." with the locale's decimal
* point.
*/
UTF8String = [[self
stringByReplacingOccurrencesOfString: decimalSeparator
withString: @"!"]
stringByReplacingOccurrencesOfString: @"."
withString: decimalSeparator]
.UTF8String;
#endif
char *endPtr = NULL;
double value;
errno = 0;
#if defined(HAVE_STRTOD_L)
value = strtod_l(UTF8String, &endPtr, cLocale);
|