author | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
commit | 39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91 (patch) (side-by-side diff) | |
tree | 96e66fdc18dca4d4ab8611133e072f57dea224b9 /noncore/apps/opie-reader/iSilo.cpp | |
parent | 279fc4fd1986074acbadd3a8e86fcf3968a8dd5c (diff) | |
download | opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.zip opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.gz opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.bz2 |
new opie-reader sources with support for ArriereGo, Reb input and flite output plugins
Diffstat (limited to 'noncore/apps/opie-reader/iSilo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/iSilo.cpp | 17 |
1 files changed, 9 insertions, 8 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 @@ -1,12 +1,12 @@ #include "iSilo.h" -#ifdef _WINDOWS
-#include <winsock.h>
-#endif
+#ifdef _WINDOWS +#include <winsock.h> +#endif u_int8_t *rodata = (u_int8_t *) "\x10\x11\x12\x00\x08\x07\x09\x06\x0a\x05\x0b\x04\x0c\x03\x0d\x02\x0e\x01\x0f"; u_int16_t *rsize_min = (u_int16_t *) "\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0d" "\x00\x0f\x00\x11\x00\x13\x00\x17\x00\x1b\x00\x1f\x00\x23\x00\x2b\x00\x33\x00" "\x3b\x00\x43\x00\x53\x00\x63\x00\x73\x00\x83\x00\xa3\x00\xc3\x00\xe3\x00\x02" "\x01"; @@ -289,16 +289,17 @@ u_int32_t iSilo::get_bits(int num) { if (num == 0) { pos = 0; return(0); } for (i = 0; i < num; i++) { if (pos == 0) { + unsuspend(); r = fread(buf, sizeof(u_int32_t), 256, fin); if (r <= 0) { qDebug("ERROR: Unexpected end of file"); exit(-1); /* FIXME */ } pos = 32*256; } @@ -556,22 +557,22 @@ void iSilo::read_attr() fread(buffer, 1, 4, fin); fread(&attr_num, sizeof(attr_num), 1, fin); attr_num = ntohs(attr_num)+1; attr = new s_attrib[attr_num]; for (int j = 0; j < attr_num; j++) { fread(&attr[j].offset, 2, 1, fin); attr[j].offset = htons(attr[j].offset); - }
+ } #ifdef _WINDOWS - for (j = 0; j < attr_num; j++)
-#else
- for (int j = 0; j < attr_num; j++)
-#endif
+ for (j = 0; j < attr_num; j++) +#else + for (int j = 0; j < attr_num; j++) +#endif { fread(&attr[j].value, 2, 1, fin); if (attr[j].offset < last_pos) { pos_hi++; } if ((attr[j].offset == last_pos) && (attr[j].value == last_value)) |