Diffstat (limited to 'noncore/apps/opie-reader/iSilo.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/iSilo.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/iSilo.cpp b/noncore/apps/opie-reader/iSilo.cpp index 5f14b96..1f727fe 100644 --- a/noncore/apps/opie-reader/iSilo.cpp +++ b/noncore/apps/opie-reader/iSilo.cpp | |||
@@ -281,32 +281,33 @@ bool iSilo::reset_trees() | |||
281 | qDebug("read_tree() failed (format incorrect?)"); | 281 | qDebug("read_tree() failed (format incorrect?)"); |
282 | return false;; | 282 | return false;; |
283 | } | 283 | } |
284 | return true; | 284 | return true; |
285 | } | 285 | } |
286 | u_int32_t iSilo::get_bits(int num) { | 286 | u_int32_t iSilo::get_bits(int num) { |
287 | int i, r; | 287 | int i, r; |
288 | u_int32_t result = 0; | 288 | u_int32_t result = 0; |
289 | 289 | ||
290 | if (num == 0) { | 290 | if (num == 0) { |
291 | pos = 0; | 291 | pos = 0; |
292 | return(0); | 292 | return(0); |
293 | } | 293 | } |
294 | 294 | ||
295 | for (i = 0; i < num; i++) { | 295 | for (i = 0; i < num; i++) { |
296 | if (pos == 0) { | 296 | if (pos == 0) { |
297 | unsuspend(); | ||
297 | r = fread(buf, sizeof(u_int32_t), 256, fin); | 298 | r = fread(buf, sizeof(u_int32_t), 256, fin); |
298 | if (r <= 0) { | 299 | if (r <= 0) { |
299 | qDebug("ERROR: Unexpected end of file"); | 300 | qDebug("ERROR: Unexpected end of file"); |
300 | exit(-1); /* FIXME */ | 301 | exit(-1); /* FIXME */ |
301 | } | 302 | } |
302 | pos = 32*256; | 303 | pos = 32*256; |
303 | } | 304 | } |
304 | 305 | ||
305 | pos--; | 306 | pos--; |
306 | result <<= 1; | 307 | result <<= 1; |
307 | result |= (ntohl(buf[255 - (pos/32)]) >> (31-(pos % 32))) & 1; | 308 | result |= (ntohl(buf[255 - (pos/32)]) >> (31-(pos % 32))) & 1; |
308 | } | 309 | } |
309 | return(result); | 310 | return(result); |
310 | } | 311 | } |
311 | u_int32_t iSilo::get_swapped(int num) { | 312 | u_int32_t iSilo::get_swapped(int num) { |
312 | return(swap_bits(get_bits(num),num)); | 313 | return(swap_bits(get_bits(num),num)); |