projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix error message in merge.
[u/mdw/catacomb]
/
mpint.h
diff --git
a/mpint.h
b/mpint.h
index
733292b
..
23378cd
100644
(file)
--- a/
mpint.h
+++ b/
mpint.h
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id
: mpint.h,v 1.1 1999/11/25 11:38:31 mdw Exp
$
+ * $Id$
*
* Conversion between MPs and standard C integers
*
*
* Conversion between MPs and standard C integers
*
@@
-27,16
+27,8
@@
* MA 02111-1307, USA.
*/
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: mpint.h,v $
- * Revision 1.1 1999/11/25 11:38:31 mdw
- * Support for conversions between MPs and C integers.
- *
- */
-
-#ifndef MPINT_H
-#define MPINT_H
+#ifndef CATACOMB_MPINT_H
+#define CATACOMB_MPINT_H
#ifdef __cplusplus
extern "C" {
#ifdef __cplusplus
extern "C" {
@@
-46,7
+38,7
@@
#include <limits.h>
#include <limits.h>
-#ifndef MP_H
+#ifndef
CATACOMB_
MP_H
# include "mp.h"
#endif
# include "mp.h"
#endif
@@
-68,7
+60,7
@@
mp *_d = (d); \
size_t _sz = 4; \
\
mp *_d = (d); \
size_t _sz = 4; \
\
- MP_
MODIFY(_d, _sz);
\
+ MP_
DEST(_d, _sz, 0);
\
_d->f &= ~(MP_NEG | MP_UNDEF); \
\
/* --- Set the sign on the MP --- * \
_d->f &= ~(MP_NEG | MP_UNDEF); \
\
/* --- Set the sign on the MP --- * \
@@
-102,7
+94,7
@@
* up all of my negative arithmetic. So do an explicit test here. \
*/ \
\
* up all of my negative arithmetic. So do an explicit test here. \
*/ \
\
- if (_i >
-MPW_MAX)
\
+ if (_i >
= -MPW_MAX)
\
break; \
else \
_i /= (type)MPW_MAX + 1; \
break; \
else \
_i /= (type)MPW_MAX + 1; \
@@
-144,7
+136,7
@@
_v++; \
_max /= (mpd)MPW_MAX + 1; \
} \
_v++; \
_max /= (mpd)MPW_MAX + 1; \
} \
- if (!
(_m->f & MP_NEG))
\
+ if (!
MP_NEGP(_m))
\
_i = -_i; \
(i) = _i; \
} while (0)
_i = -_i; \
(i) = _i; \
} while (0)
@@
-168,6
+160,7
@@
mp_fromINT(short, short);
mp_fromINT(ushort, unsigned short);
mp_fromINT(int, int);
mp_fromINT(uint, unsigned);
mp_fromINT(ushort, unsigned short);
mp_fromINT(int, int);
mp_fromINT(uint, unsigned);
+mp_fromINT(uint32, uint32);
mp_fromINT(long, long);
mp_fromINT(ulong, unsigned long);
mp_fromINT(long, long);
mp_fromINT(ulong, unsigned long);
@@
-187,12
+180,13
@@
mp_fromINT(ulong, unsigned long);
*/
#define mp_toINT(name, type) \
*/
#define mp_toINT(name, type) \
- extern type mp_to##name(const mp */*m*/)
;
+ extern type mp_to##name(const mp */*m*/)
mp_toINT(short, short);
mp_toINT(ushort, unsigned short);
mp_toINT(int, int);
mp_toINT(uint, unsigned);
mp_toINT(short, short);
mp_toINT(ushort, unsigned short);
mp_toINT(int, int);
mp_toINT(uint, unsigned);
+mp_toINT(uint32, uint32);
mp_toINT(long, long);
mp_toINT(ulong, unsigned long);
mp_toINT(long, long);
mp_toINT(ulong, unsigned long);