fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / machine / powerpc / atosfix16.c
blob501c0f1cbd2afb989792562c80b93c709b0d1350
1 /*
2 FUNCTION
3 <<atosfix16>>, <<atosfix32>>, <<atosfix64>>---string to signed fixed-point
5 INDEX
6 atosfix16
7 INDEX
8 atosfix32
9 INDEX
10 atosfix64
11 INDEX
12 _atosfix16_r
13 INDEX
14 _atosfix32_r
15 INDEX
16 _atosfix64_r
18 ANSI_SYNOPSIS
19 #include <stdlib.h>
20 __int16_t atosfix16(const char *<[s]>);
21 __int32_t atosfix32(const char *<[s]>);
22 __int64_t atosfix32(const char *<[s]>);
24 __int16_t _atosfix16_r(struct __reent *, const char *<[s]>);
25 __int32_t _atosfix32_r(struct __reent *, const char *<[s]>);
26 __int64_t _atosfix32_r(struct __reent *, const char *<[s]>);
28 TRAD_SYNOPSIS
29 #include <stdlib.h>
30 __int16_t atosfix16(<[s]>)
31 const char *<[s]>;
33 __int32_t atosfix32(<[s]>)
34 const char *<[s]>;
36 __int64_t atosfix64(<[s]>)
37 const char *<[s]>;
39 __int16_t _atosfix16_r(<reent>, <[s]>)
40 struct _reent *<[reent]>;
41 const char *<[s]>;
43 __int32_t _atosfix32_r(<reent>, <[s]>)
44 struct _reent *<[reent]>;
45 const char *<[s]>;
47 __int64_t _atosfix64_r(<reent>, <[s]>)
48 struct _reent *<[reent]>;
49 const char *<[s]>;
51 DESCRIPTION
52 <<atosfix16>> converts the initial portion of a string to a sign
53 + 15-bit fraction fixed point value.
54 <<atosfix32>> converts the initial portion of a string to a sign
55 + 31-bit fraction fixed point value.
56 <<atosfix64>> converts the initial portion of a string to a sign
57 + 63-bit fraction fixed point value.
58 <<atosfix16(s)>> is implemented as <<strtosfix16(s, NULL).>>
59 <<atosfix32(s)>> is implemented as <<strtosfix32(s, NULL).>>
60 <<atosfix64(s)>> is implemented as <<strtosfix64(s, NULL).>>
62 The alternate functions <<_atosfix16_r>>, <<_atosfix32_r>>,
63 and <<_atosfix64_r>> are reentrant versions.
64 The extra argument <[reent]> is a pointer to a reentrancy structure.
66 RETURNS
67 The functions return the converted value, if any. If no conversion was
68 made, <<0>> is returned. If saturation occurs, <<ERANGE>> is stored
69 in errno.
71 PORTABILITY
72 <<atosfix16>>, <<atosfix32>>, and <<atosfix64>> are non-standard.
74 No supporting OS subroutines are directly required. The
75 OS subroutines required by <<strtod>> are used.
79 * Jeff Johnston - 02/13/2002
82 #ifdef __SPE__
84 #include <stdlib.h>
85 #include <_ansi.h>
87 __int16_t
88 _DEFUN (_atosfix16_r, (reent, s),
89 struct _reent *reent _AND
90 _CONST char *s)
92 return _strtosfix16_r (reent, s, NULL);
95 #ifndef _REENT_ONLY
96 __int16_t
97 _DEFUN (atosfix16, (s),
98 _CONST char *s)
100 return strtosfix16 (s, NULL);
103 #endif /* !_REENT_ONLY */
105 #endif /* __SPE__ */