Changeset 5e88b2f in tol
- Timestamp:
- Mar 18, 2015, 11:57:16 AM (12 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 08c59de
- Parents:
- 565b311
- Location:
- tol/OIS
- Files:
-
- 3 edited
-
oiscreator.cpp (modified) (1 diff)
-
oisloader.cpp (modified) (1 diff)
-
tol_ois.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/OIS/oiscreator.cpp
r565b311 r5e88b2f 413 413 int s = x.Size(); 414 414 EWrite(s, stream); 415 BCoefDeg* buf = (BCoefDeg*)AllocAuxilarBuffer(3,sizeof(BCoefDeg)*x.Size());415 char* buf = (char*)AllocAuxilarBuffer(3,SIZEOF_BCoefDeg*x.Size()); 416 416 for(int i=0; i<x.Size(); i++) 417 417 { 418 buf[i].degree_ = x(i).Degree(); 419 buf[i].coefficient_ = x(i).Coef (); 420 } 421 Ensure(Write(buf,sizeof(BCoefDeg),x.Size(),stream)); 418 int *degree; 419 BDat *coefficient; 420 degree = (int*)&buf[i*SIZEOF_BCoefDeg]; 421 coefficient = (BDat*)&buf[i*SIZEOF_BCoefDeg+sizeof(int)]; 422 *degree = x(i).Degree(); 423 *coefficient = x(i).Coef(); 424 } 425 Ensure(Write(buf,SIZEOF_BCoefDeg,x.Size(),stream)); 422 426 return(true); 423 427 }; -
tol/OIS/oisloader.cpp
r565b311 r5e88b2f 409 409 } 410 410 } 411 else if(control_.typeSizes_.sizeof_BCoefDeg_== sizeof(BCoefDeg))412 { 413 BCoefDeg* buf = (BCoefDeg*)AllocAuxilarBuffer(1,sizeof(BCoefDeg)*s);414 Ensure(Read(buf, sizeof(BCoefDeg),s,stream));411 else if(control_.typeSizes_.sizeof_BCoefDeg_==SIZEOF_BCoefDeg) 412 { 413 char* buf = (char*)AllocAuxilarBuffer(1,SIZEOF_BCoefDeg*s); 414 Ensure(Read(buf,SIZEOF_BCoefDeg,s,stream)); 415 415 for(i=0; i<x.Size(); i++) 416 416 { 417 x[i].PutDegree(buf[i].degree_); 418 x[i].PutCoef (buf[i].coefficient_); 417 int *degree; 418 BDat *coefficient; 419 degree = (int*)&buf[i*SIZEOF_BCoefDeg]; 420 coefficient = (BDat*)&buf[i*SIZEOF_BCoefDeg+sizeof(int)]; 421 x[i].PutDegree(*degree); 422 x[i].PutCoef(*coefficient); 419 423 } 420 424 } -
tol/OIS/tol_ois.h
r565b311 r5e88b2f 67 67 #define Ensure(doit) if(!(doit)) { return(0); } 68 68 69 // SIZEOF_BCoefDeg was sizeof(BCoefDeg) 70 #define SIZEOF_BCoefDeg (sizeof(int)+sizeof(BDat)) 69 71 70 72 //-------------------------------------------------------------------- … … 195 197 sizeof_double_ (sizeof(double)), 196 198 sizeof_BDat_ (sizeof(BDat)), 197 sizeof_BCoefDeg_ ( sizeof(BCoefDeg)),199 sizeof_BCoefDeg_ (SIZEOF_BCoefDeg), 198 200 sizeof_BGrammarId_ (sizeof(BGrammarId)) 199 201 {}
Note: See TracChangeset
for help on using the changeset viewer.
