Commit b0fee59003fbb314573bdb51865acc159d640d12
1 parent
c9fd97f0
convert long int to long long int
Showing
2 changed files
with
6 additions
and
12 deletions
Show diff stats
envi/binary.h
... | ... | @@ -34,10 +34,9 @@ protected: |
34 | 34 | |
35 | 35 | //returns the file size |
36 | 36 | // reads the file size from disk and returns it (in bytes) |
37 | - unsigned int get_file_size(){ | |
38 | - | |
39 | - struct stat results; | |
40 | - if(stat(name.c_str(), &results) == 0) | |
37 | + long long int get_file_size(){ | |
38 | + struct _stat64 results; | |
39 | + if(_stat64(name.c_str(), &results) == 0) | |
41 | 40 | return results.st_size; |
42 | 41 | else return 0; |
43 | 42 | } |
... | ... | @@ -45,10 +44,10 @@ protected: |
45 | 44 | //make sure that the specified file size matches the file size on disk |
46 | 45 | // returns true/false |
47 | 46 | bool test_file_size(){ |
48 | - unsigned int npts = 1; //initialize the number of data points to 1 | |
47 | + long long int npts = 1; //initialize the number of data points to 1 | |
49 | 48 | for(unsigned int i = 0; i<D; i++) //iterate over each dimension |
50 | 49 | npts *= R[i]; //compute the total number of data points in the file |
51 | - unsigned int datasize = npts * sizeof(T);//multiply the sum by the size of the template parameter | |
50 | + long long int datasize = npts * sizeof(T);//multiply the sum by the size of the template parameter | |
52 | 51 | |
53 | 52 | if(datasize + header == get_file_size()) return true; //if the byte size matches the file size, we're golden |
54 | 53 | else return false; //otherwise return an error | ... | ... |
envi/envi.h
... | ... | @@ -618,12 +618,6 @@ public: |
618 | 618 | |
619 | 619 | pi++; |
620 | 620 | } |
621 | - //at this point, pi is an index to the mi'th valid pixel | |
622 | - | |
623 | - //load the next N valid pixels | |
624 | - //for(unsigned i = 0; i < N; i++){ | |
625 | - | |
626 | - //} | |
627 | 621 | |
628 | 622 | for(unsigned i = pi; i < pixels; i++){ |
629 | 623 | if(mask[i] != 0){ |
... | ... | @@ -644,6 +638,7 @@ public: |
644 | 638 | std::cout << "number of valid pixels in the mask : " << count <<"is less than N: "<< N; |
645 | 639 | exit(1); |
646 | 640 | } |
641 | + free(p); | |
647 | 642 | return true; |
648 | 643 | } |
649 | 644 | ... | ... |