=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/plugin/cmo-gmp.c,v retrieving revision 1.5 retrieving revision 1.7 diff -u -p -r1.5 -r1.7 --- OpenXM/src/kan96xx/plugin/cmo-gmp.c 2000/02/01 02:38:58 1.5 +++ OpenXM/src/kan96xx/plugin/cmo-gmp.c 2003/08/26 05:04:41 1.7 @@ -1,7 +1,8 @@ -/*$OpenXM: OpenXM/src/kan96xx/plugin/cmo-gmp.c,v 1.4 1999/11/27 13:24:41 takayama Exp $ */ +/*$OpenXM: OpenXM/src/kan96xx/plugin/cmo-gmp.c,v 1.6 2001/05/04 01:06:29 takayama Exp $ */ #include #include /* #include */ +#include #include "datatype.h" #include "stackm.h" #include "extern.h" @@ -166,10 +167,9 @@ cmoOutGMPCoeff_new(mpz_srcptr x) tmp[0] = htonl(CMO_ZZ); cmoOutputToBuf(CMOPUT,tmp,sizeof(cmoint)); - if (BITS_PER_CHAR != 8) { - fprintf(stderr,"BITS_PER_CHAR = %d\n",BITS_PER_CHAR); + if (CHAR_BIT != 8) { + fprintf(stderr,"CHAR_BIT = %d\n",CHAR_BIT); fprintf(stderr,"cmo-gmp.c does not work on this CPU.\n"); - fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); } @@ -195,11 +195,11 @@ cmoOutGMPCoeff_new(mpz_srcptr x) outRawInt32(((unsigned long)xp[s])&(unsigned long)0xffffffff); outRawInt32(((unsigned long)xp[s])>>32); } - if ( !(xsize&1) ) { - outRawInt32(((unsigned long)xp[s])&(unsigned long)0xffffffff); - outRawInt32(((unsigned long)xp[s])>>32); - } else - outRawInt32(((unsigned long)xp[s])&(unsigned long)0xffffffff); + if ( !(xsize&1) ) { + outRawInt32(((unsigned long)xp[s])&(unsigned long)0xffffffff); + outRawInt32(((unsigned long)xp[s])>>32); + } else + outRawInt32(((unsigned long)xp[s])&(unsigned long)0xffffffff); return ( ABS (xsize) ); } @@ -215,10 +215,9 @@ cmoGetGMPCoeff_new(MP_INT *x, struct cmoBuffer *cb) mp_size_t in_bytesize; int neg_flag; - if (BITS_PER_CHAR != 8) { - fprintf(stderr,"BITS_PER_CHAR = %d\n",BITS_PER_CHAR); + if (CHAR_BIT != 8) { + fprintf(stderr,"CHAR_BIT = %d\n",CHAR_BIT); fprintf(stderr,"cmo-gmp.c does not work on this CPU.\n"); - fprintf(stderr,"Read the GMP source code and rewrite cmo-gmp.c.\n"); exit(10); } @@ -231,7 +230,7 @@ cmoGetGMPCoeff_new(MP_INT *x, struct cmoBuffer *cb) if (xsize == 0) { x->_mp_size = 0; - return 1; /* we've read 4 bytes */ + return 1; /* we've read 4 bytes */ } xsize0 = (xsize+1)/2; @@ -241,11 +240,11 @@ cmoGetGMPCoeff_new(MP_INT *x, struct cmoBuffer *cb) for (i=0; i_mp_size = 0; - return 1; /* we've read 4 bytes */ + return 1; /* we've read 4 bytes */ } if (x->_mp_alloc < xsize)