version 1.38, 2015/08/04 05:24:44 |
version 1.40, 2015/08/04 10:19:31 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox.c,v 1.37 2014/04/07 04:00:10 iwane Exp $ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox.c,v 1.39 2015/08/04 07:41:49 noro Exp $ */ |
|
|
/* |
/* |
This module includes functions for sending/receiveng CMO's. |
This module includes functions for sending/receiveng CMO's. |
Line 756 static int send_mpz(OXFILE *oxfp, mpz_ptr mpz) |
|
Line 756 static int send_mpz(OXFILE *oxfp, mpz_ptr mpz) |
|
int len = abs(mpz->_mp_size) * n; |
int len = abs(mpz->_mp_size) * n; |
int *ptr = (int *)mpz->_mp_d; |
int *ptr = (int *)mpz->_mp_d; |
int size; |
int size; |
send_int32(oxfp, mpz->_mp_size * n); |
|
#if 0 |
|
if (len > 0 && ptr[len-1] == 0) { |
if (len > 0 && ptr[len-1] == 0) { |
len--; |
len--; |
} |
} |
size = mpz->_mp_size < 0 ? -len : len; |
size = mpz->_mp_size < 0 ? -len : len; |
send_int32(oxfp, size); |
send_int32(oxfp, size); |
#endif |
|
for(i=0; i<len; i++) { |
for(i=0; i<len; i++) { |
send_int32(oxfp, ptr[i]); |
send_int32(oxfp, ptr[i]); |
} |
} |
Line 778 void send_int64(OXFILE *oxfp,UL64 a) |
|
Line 775 void send_int64(OXFILE *oxfp,UL64 a) |
|
|
|
UL64 receive_int64(OXFILE *oxfp) |
UL64 receive_int64(OXFILE *oxfp) |
{ |
{ |
UL64 u,l; |
unsigned int u,l; |
|
UL64 r; |
|
|
u = receive_int32(oxfp); |
u = receive_int32(oxfp); |
l = receive_int32(oxfp); |
l = receive_int32(oxfp); |
return (u<<32)|l; |
r = (((UL64)u)<<32)|((UL64)l); |
|
return r; |
} |
} |
|
|
static void receive_mpfr(OXFILE *oxfp, mpfr_ptr mpfr) |
static void receive_mpfr(OXFILE *oxfp, mpfr_ptr mpfr) |