diff options
Diffstat (limited to 'apps/plugins/puzzles/rbwrappers.c')
-rw-r--r-- | apps/plugins/puzzles/rbwrappers.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/apps/plugins/puzzles/rbwrappers.c b/apps/plugins/puzzles/rbwrappers.c index e595cf93d1..4fbfdc4e60 100644 --- a/apps/plugins/puzzles/rbwrappers.c +++ b/apps/plugins/puzzles/rbwrappers.c | |||
@@ -1346,9 +1346,12 @@ double scalbn_wrapper (double x, int n) | |||
1346 | if (k > 0) /* normal result */ | 1346 | if (k > 0) /* normal result */ |
1347 | {__HI(x) = (hx&0x800fffff)|(k<<20); return x;} | 1347 | {__HI(x) = (hx&0x800fffff)|(k<<20); return x;} |
1348 | if (k <= -54) | 1348 | if (k <= -54) |
1349 | { | ||
1349 | if (n > 50000) /* in case integer overflow in n+k */ | 1350 | if (n > 50000) /* in case integer overflow in n+k */ |
1350 | return huge*copysign_wrapper(huge,x); /*overflow*/ | 1351 | return huge*copysign_wrapper(huge,x); /*overflow*/ |
1351 | else return tiny*copysign_wrapper(tiny,x); /*underflow*/ | 1352 | else |
1353 | return tiny*copysign_wrapper(tiny,x); /*underflow*/ | ||
1354 | } | ||
1352 | k += 54; /* subnormal result */ | 1355 | k += 54; /* subnormal result */ |
1353 | __HI(x) = (hx&0x800fffff)|(k<<20); | 1356 | __HI(x) = (hx&0x800fffff)|(k<<20); |
1354 | return x*twom54; | 1357 | return x*twom54; |
@@ -1608,18 +1611,6 @@ static void bcopy_wrapper(const void *src, void *dst, size_t n) | |||
1608 | } | 1611 | } |
1609 | 1612 | ||
1610 | int | 1613 | int |
1611 | sscanf_wrapper(const char *ibuf, const char *fmt, ...) | ||
1612 | { | ||
1613 | va_list ap; | ||
1614 | int ret; | ||
1615 | |||
1616 | va_start(ap, fmt); | ||
1617 | ret = rb_vsscanf(ibuf, fmt, ap); | ||
1618 | va_end(ap); | ||
1619 | return(ret); | ||
1620 | } | ||
1621 | |||
1622 | int | ||
1623 | rb_vsscanf(const char *inp, char const *fmt0, va_list ap) | 1614 | rb_vsscanf(const char *inp, char const *fmt0, va_list ap) |
1624 | { | 1615 | { |
1625 | int inr; | 1616 | int inr; |
@@ -2065,6 +2056,18 @@ match_failure: | |||
2065 | return (nassigned); | 2056 | return (nassigned); |
2066 | } | 2057 | } |
2067 | 2058 | ||
2059 | int | ||
2060 | sscanf_wrapper(const char *ibuf, const char *fmt, ...) | ||
2061 | { | ||
2062 | va_list ap; | ||
2063 | int ret; | ||
2064 | |||
2065 | va_start(ap, fmt); | ||
2066 | ret = rb_vsscanf(ibuf, fmt, ap); | ||
2067 | va_end(ap); | ||
2068 | return(ret); | ||
2069 | } | ||
2070 | |||
2068 | /* | 2071 | /* |
2069 | * Fill in the given table from the scanset at the given format | 2072 | * Fill in the given table from the scanset at the given format |
2070 | * (just after `['). Return a pointer to the character past the | 2073 | * (just after `['). Return a pointer to the character past the |