~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/regdump.h (ARM32, ARM64): Properly parenthesize `_regfmt' arguments.
[catacomb]
/
math
/
mpint.c
diff --git
a/math/mpint.c
b/math/mpint.c
index
d89fb07
..
3511f1e
100644
(file)
--- a/
math/mpint.c
+++ b/
math/mpint.c
@@
-33,21
+33,12
@@
/* --- Conversion from C integers --- */
/* --- Conversion from C integers --- */
-#define FROM(name, type
)
\
+#define FROM(name, type
, max)
\
mp *mp_from##name(mp *d, type i) { \
MP_FROMINT(d, type, i); \
return (d); \
}
mp *mp_from##name(mp *d, type i) { \
MP_FROMINT(d, type, i); \
return (d); \
}
-
-FROM(short, short)
-FROM(ushort, unsigned short)
-FROM(int, int)
-FROM(uint, unsigned)
-FROM(uint32, uint32)
-FROM(long, long)
-FROM(ulong, unsigned long)
-
-#undef FROM
+MPINT_CONVERSIONS(FROM)
/* --- Conversion to C integers --- */
/* --- Conversion to C integers --- */
@@
-58,14
+49,7
@@
FROM(ulong, unsigned long)
MP_TOINT(m, type, max, i); \
return (i); \
}
MP_TOINT(m, type, max, i); \
return (i); \
}
-
-TO(short, short, SHRT_MAX)
-TO(ushort, unsigned short, USHRT_MAX)
-TO(int, int, INT_MAX)
-TO(uint, unsigned, UINT_MAX)
-TO(uint32, uint32, 0xffffffff)
-TO(long, long, LONG_MAX)
-TO(ulong, unsigned long, ULONG_MAX)
+MPINT_CONVERSIONS(TO)
#undef TO
#undef TO