Diffstat (limited to 'noncore/apps/opie-reader/pdb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/pdb.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/noncore/apps/opie-reader/pdb.cpp b/noncore/apps/opie-reader/pdb.cpp index 3054424..dca67ff 100644 --- a/noncore/apps/opie-reader/pdb.cpp +++ b/noncore/apps/opie-reader/pdb.cpp | |||
@@ -1,10 +1,10 @@ | |||
1 | #include "pdb.h" | 1 | #include "pdb.h" |
2 | #include <sys/types.h> | 2 | #ifdef _WINDOWS |
3 | #include <sys/stat.h> | 3 | #include <winsock2.h> |
4 | #include <unistd.h> | 4 | #endif |
5 | 5 | ||
6 | size_t Cpdb::recordpos(int n) | 6 | size_t Cpdb::recordpos(int n) |
7 | { | 7 | { |
8 | UInt16 mxn = ntohs(head.recordList.numRecords); | 8 | UInt16 mxn = ntohs(head.recordList.numRecords); |
9 | if (n >= mxn) | 9 | if (n >= mxn) |
10 | { | 10 | { |
@@ -46,18 +46,15 @@ bool Cpdb::openfile(const char *src) | |||
46 | { | 46 | { |
47 | return false; | 47 | return false; |
48 | } | 48 | } |
49 | 49 | ||
50 | // just holds the first few chars of the file | 50 | // just holds the first few chars of the file |
51 | //char buf[0x100]; | 51 | //char buf[0x100]; |
52 | struct stat buf; | 52 | fseek(fin,0,SEEK_END); |
53 | stat(src, &buf); | 53 | file_length = ftell(fin); |
54 | file_length = buf.st_size; | ||
55 | // fseek(fin,0,SEEK_END); | ||
56 | // file_length = ftell(fin); | ||
57 | 54 | ||
58 | // fseek(fin,0,SEEK_SET); | 55 | fseek(fin,0,SEEK_SET); |
59 | 56 | ||
60 | fread(&head, 1, sizeof(head), fin); | 57 | fread(&head, 1, sizeof(head), fin); |
61 | 58 | ||
62 | return true; | 59 | return true; |
63 | } | 60 | } |