[BACK]Return to ox.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_toolkit

Diff for /OpenXM/src/ox_toolkit/ox.c between version 1.34 and 1.35

version 1.34, 2007/03/14 10:30:54 version 1.35, 2013/10/20 14:58:20
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C; coding: euc-japan -*- */
 /* $OpenXM: OpenXM/src/ox_toolkit/ox.c,v 1.33 2005/03/03 07:25:17 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_toolkit/ox.c,v 1.34 2007/03/14 10:30:54 ohara Exp $ */
   
 /*  /*
    This module includes functions for sending/receiveng CMO's.     This module includes functions for sending/receiveng CMO's.
Line 387  cmo *receive_cmo_tag(OXFILE *oxfp, int tag)
Line 387  cmo *receive_cmo_tag(OXFILE *oxfp, int tag)
 static void receive_mpz(OXFILE *oxfp, mpz_ptr mpz)  static void receive_mpz(OXFILE *oxfp, mpz_ptr mpz)
 {  {
     int i;      int i;
           int n = sizeof(mpz->_mp_d[0]) / sizeof(int);
     int size  = receive_int32(oxfp);      int size  = receive_int32(oxfp);
     int len   = abs(size);      int len   = abs(size);
     resize_mpz(mpz, size);          int *ptr;
           if (n == 1) {
               resize_mpz(mpz, size);
           } else {
               resize_mpz(mpz, (size+1) / n);
           }
   
     for(i=0; i<len; i++) {          ptr = (int *)mpz->_mp_d;
         mpz->_mp_d[i] = receive_int32(oxfp);          for(i= len-1; i>=0; i--) {
     }                  ptr[i] = receive_int32(oxfp);
           }
 }  }
   
 void send_ox_command(OXFILE *oxfp, int sm_command)  void send_ox_command(OXFILE *oxfp, int sm_command)
Line 705  void send_cmo(OXFILE *oxfp, cmo* c)
Line 712  void send_cmo(OXFILE *oxfp, cmo* c)
 static int send_mpz(OXFILE *oxfp, mpz_ptr mpz)  static int send_mpz(OXFILE *oxfp, mpz_ptr mpz)
 {  {
     int i;      int i;
     int len = abs(mpz->_mp_size);          int n = sizeof(mpz->_mp_d[0]) / sizeof(int);
     send_int32(oxfp, mpz->_mp_size);      int len = abs(mpz->_mp_size) * n;
           int *ptr = (int *)mpz->_mp_d;
       send_int32(oxfp, mpz->_mp_size * n);
     for(i=0; i<len; i++) {      for(i=0; i<len; i++) {
         send_int32(oxfp, mpz->_mp_d[i]);          send_int32(oxfp, ptr[i]);
     }      }
     return 0;      return 0;
 }  }

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>