=================================================================== RCS file: /home/cvs/OpenXM/src/ox_ntl/ntlconv.cpp,v retrieving revision 1.2 retrieving revision 1.5 diff -u -p -r1.2 -r1.5 --- OpenXM/src/ox_ntl/ntlconv.cpp 2003/11/15 09:06:20 1.2 +++ OpenXM/src/ox_ntl/ntlconv.cpp 2003/11/27 14:19:50 1.5 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/ox_ntl/ntlconv.cpp,v 1.1 2003/11/08 12:34:00 iwane Exp $ */ +/* $OpenXM: OpenXM/src/ox_ntl/ntlconv.cpp,v 1.4 2003/11/17 12:04:20 iwane Exp $ */ #include #include @@ -11,6 +11,9 @@ #define __NTL_PRINT (1) #endif +/*==========================================================================* + * Block interrupt input + *==========================================================================*/ #define BLOCK_NEW_CMO() BLOCK_INPUT() #define UNBLOCK_NEW_CMO() UNBLOCK_INPUT() @@ -145,13 +148,17 @@ cmo_zz * ZZ_to_cmo_zz(const ZZ &z) { cmo_zz *c; + char *ptr; - ostrstream sout; + std::ostrstream sout; sout << z << '\0'; + ptr = sout.str(); BLOCK_NEW_CMO(); - c = new_cmo_zz_set_string(sout.str()); + c = new_cmo_zz_set_string(ptr); UNBLOCK_NEW_CMO(); + + delete [] ptr; return (c); } @@ -215,7 +222,6 @@ cmo_list * mat_zz_to_cmo(mat_ZZ &mat) { cmo_list *list; - int ret; cmo_zz *zz; int row, col; @@ -308,12 +314,6 @@ cmo_to_mat_zz(mat_ZZ &mat, cmo *m) - - - - - - /**************************************************************************** * convert cmo to ZZX which is polynomial in Z[x] * @@ -339,7 +339,7 @@ cmo_to_ZZX(ZZX &f, cmo *m, cmo_indeterminate *&x) return (NTL_FAILURE); } { - istrstream sin(str, strlen(str)); + std::istrstream sin(str, strlen(str)); sin >> f; } break; @@ -385,6 +385,8 @@ cmo_to_ZZX(ZZX &f, cmo *m, cmo_indeterminate *&x) } return (NTL_SUCCESS); } + + /**************************************************************************** * convert polynomial in Z[x] to cmo_recursive_polynomial