comparison libdecnumber/decNumberLocal.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents 77e2b8dfacca
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Local definitions for the decNumber C Library. 1 /* Local definitions for the decNumber C Library.
2 Copyright (C) 2007, 2009 Free Software Foundation, Inc. 2 Copyright (C) 2007-2017 Free Software Foundation, Inc.
3 Contributed by IBM Corporation. Author Mike Cowlishaw. 3 Contributed by IBM Corporation. Author Mike Cowlishaw.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it under 7 GCC is free software; you can redistribute it and/or modify it under
151 /* Return a uInt, etc., from bytes starting at a char* or uByte* */ 151 /* Return a uInt, etc., from bytes starting at a char* or uByte* */
152 #define UBTOUS(b) (memcpy((void *)&uswork, b, 2), uswork) 152 #define UBTOUS(b) (memcpy((void *)&uswork, b, 2), uswork)
153 #define UBTOUI(b) (memcpy((void *)&uiwork, b, 4), uiwork) 153 #define UBTOUI(b) (memcpy((void *)&uiwork, b, 4), uiwork)
154 154
155 /* Store a uInt, etc., into bytes starting at a char* or uByte*. */ 155 /* Store a uInt, etc., into bytes starting at a char* or uByte*. */
156 /* Returns i, evaluated, for convenience; has to use uiwork because */ 156 /* Has to use uiwork because i may be an expression. */
157 /* i may be an expression. */ 157 #define UBFROMUS(b, i) (uswork=(i), memcpy(b, (void *)&uswork, 2))
158 #define UBFROMUS(b, i) (uswork=(i), memcpy(b, (void *)&uswork, 2), uswork) 158 #define UBFROMUI(b, i) (uiwork=(i), memcpy(b, (void *)&uiwork, 4))
159 #define UBFROMUI(b, i) (uiwork=(i), memcpy(b, (void *)&uiwork, 4), uiwork)
160 159
161 /* X10 and X100 -- multiply integer i by 10 or 100 */ 160 /* X10 and X100 -- multiply integer i by 10 or 100 */
162 /* [shifts are usually faster than multiply; could be conditional] */ 161 /* [shifts are usually faster than multiply; could be conditional] */
163 #define X10(i) (((i)<<1)+((i)<<3)) 162 #define X10(i) (((i)<<1)+((i)<<3))
164 #define X100(i) (((i)<<2)+((i)<<5)+((i)<<6)) 163 #define X100(i) (((i)<<2)+((i)<<5)+((i)<<6))