rogersce / cnpy

library to read/write .npy and .npz files in C/C++
MIT License
1.34k stars 301 forks source link

Various fixes and modernizations #9

Closed dstahlke closed 7 years ago

dstahlke commented 10 years ago

The main changes are as follows: 1) Use portable datatypes (e.g. "unsigned int" is not guaranteed to be 32 bits but "uint32_t" is). 2) It is no longer necessary to manually free the data. In fact "delete" or "destruct" is not called anywhere now. Memory is freed when objects go out of scope. 3) std::vector is used in place of arrays, and also for "shape" parameters.

Unfortunately, the API is now different (see example1.cpp) and also C++11 is needed.

rogersce commented 7 years ago

I haven't spent much time with this code in a while (since school, actually...) but saw you cleaned up a bunch of issues. Apologies for the extreme delay....thank you!