Commit fceee190d9591260b3f62d0f074be5e934d57e1d
1 parent
9333bc22
fixed a return warning in bil.h
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
stim/envi/bil.h
@@ -231,15 +231,18 @@ public: | @@ -231,15 +231,18 @@ public: | ||
231 | } | 231 | } |
232 | 232 | ||
233 | //given a Y, return ZX slice (transposed such that the spectrum is the leading dimension) | 233 | //given a Y, return ZX slice (transposed such that the spectrum is the leading dimension) |
234 | - int read_plane_zx(T* p, size_t y){ | ||
235 | - T* temp = (T*) malloc(X() * Z() * sizeof(T)); //allocate space to store the temporary xz plane | ||
236 | - binary<T>::read_plane_2(temp, y); //load the plane from disk | 234 | + bool read_plane_zx(T* p, size_t y){ |
235 | + T* temp = (T*) malloc(X() * Z() * sizeof(T)); //allocate space to store the temporary xz plane | ||
236 | + if(!binary<T>::read_plane_2(temp, y)) //load the plane from disk | ||
237 | + return false; | ||
238 | + | ||
237 | size_t z, x; | 239 | size_t z, x; |
238 | for(z = 0; z < Z(); z++){ | 240 | for(z = 0; z < Z(); z++){ |
239 | for(x = 0; x <= z; x++){ | 241 | for(x = 0; x <= z; x++){ |
240 | p[x * Z() + z] = temp[z * X() + x]; //copy to the destination frame | 242 | p[x * Z() + z] = temp[z * X() + x]; //copy to the destination frame |
241 | } | 243 | } |
242 | } | 244 | } |
245 | + return true; | ||
243 | } | 246 | } |
244 | 247 | ||
245 | //load a frame y into a pre-allocated double-precision array | 248 | //load a frame y into a pre-allocated double-precision array |