| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: gethex.c,v 1.6 2013/04/19 10:41:53 joerg Exp $ */ | | 1 | /* $NetBSD: gethex.c,v 1.7 2020/02/22 00:38:14 kamil Exp $ */ |
2 | | | 2 | |
3 | /**************************************************************** | | 3 | /**************************************************************** |
4 | | | 4 | |
5 | The author of this software is David M. Gay. | | 5 | The author of this software is David M. Gay. |
6 | | | 6 | |
7 | Copyright (C) 1998 by Lucent Technologies | | 7 | Copyright (C) 1998 by Lucent Technologies |
8 | All Rights Reserved | | 8 | All Rights Reserved |
9 | | | 9 | |
10 | Permission to use, copy, modify, and distribute this software and | | 10 | Permission to use, copy, modify, and distribute this software and |
11 | its documentation for any purpose and without fee is hereby | | 11 | its documentation for any purpose and without fee is hereby |
12 | granted, provided that the above copyright notice appear in all | | 12 | granted, provided that the above copyright notice appear in all |
13 | copies and that both that the copyright notice and this | | 13 | copies and that both that the copyright notice and this |
14 | permission notice and warranty disclaimer appear in supporting | | 14 | permission notice and warranty disclaimer appear in supporting |
| @@ -199,27 +199,27 @@ gethex( CONST char **sp, CONST FPI *fpi, | | | @@ -199,27 +199,27 @@ gethex( CONST char **sp, CONST FPI *fpi, |
199 | if (*--s1 == decimalpoint[i]) { | | 199 | if (*--s1 == decimalpoint[i]) { |
200 | s1 -= i; | | 200 | s1 -= i; |
201 | continue; | | 201 | continue; |
202 | } | | 202 | } |
203 | #else | | 203 | #else |
204 | if (*--s1 == '.') | | 204 | if (*--s1 == '.') |
205 | continue; | | 205 | continue; |
206 | #endif | | 206 | #endif |
207 | if (n == ULbits) { | | 207 | if (n == ULbits) { |
208 | *x++ = L; | | 208 | *x++ = L; |
209 | L = 0; | | 209 | L = 0; |
210 | n = 0; | | 210 | n = 0; |
211 | } | | 211 | } |
212 | L |= (hexdig[(unsigned char)*s1] & 0x0f) << n; | | 212 | L |= (unsigned int)(hexdig[(unsigned char)*s1] & 0x0f) << n; |
213 | n += 4; | | 213 | n += 4; |
214 | } | | 214 | } |
215 | *x++ = L; | | 215 | *x++ = L; |
216 | b->wds = n = (int)(x - b->x); | | 216 | b->wds = n = (int)(x - b->x); |
217 | n = ULbits*n - hi0bits(L); | | 217 | n = ULbits*n - hi0bits(L); |
218 | nbits = fpi->nbits; | | 218 | nbits = fpi->nbits; |
219 | lostbits = 0; | | 219 | lostbits = 0; |
220 | x = b->x; | | 220 | x = b->x; |
221 | if (n > nbits) { | | 221 | if (n > nbits) { |
222 | n -= nbits; | | 222 | n -= nbits; |
223 | if (any_on(b,n)) { | | 223 | if (any_on(b,n)) { |
224 | lostbits = 1; | | 224 | lostbits = 1; |
225 | k = n - 1; | | 225 | k = n - 1; |