Mercurial > libpst
diff src/debug.c @ 43:f6db1f060a95
start on outlook 2003 64 bit format
author | carl |
---|---|
date | Sun, 06 Jan 2008 14:47:06 -0800 |
parents | ddfb25318812 |
children | b2a7f2e0926a |
line wrap: on
line diff
--- a/src/debug.c Tue Oct 02 16:10:36 2007 -0700 +++ b/src/debug.c Sun Jan 06 14:47:06 2008 -0800 @@ -246,11 +246,12 @@ size_t size, ptr, funcname, filename, text, end; char *buf = NULL, rec_type; if (!debug_fp) return; // no file - long index_pos = ftell (debug_fp), file_pos = index_pos; + off_t index_pos = ftell (debug_fp); + off_t file_pos = index_pos; // add 2. One for the pointer to the next index, // one for the count of this index - int index_size = ((curr_items+2) * sizeof(int)); - int *index; + int index_size = ((curr_items+2) * sizeof(off_t)); + off_t *index; int index_ptr = 0; struct _debug_file_rec_m mfile_rec; struct _debug_file_rec_l lfile_rec; @@ -329,9 +330,9 @@ struct _debug_file_rec_l lfile_rec; struct _debug_file_rec_m mfile_rec; unsigned char rec_type; - int index_size = 3 * sizeof(int); - int index[3]; - int index_pos, file_pos; + int index_size = 3 * sizeof(off_t); + off_t index[3]; + off_t index_pos, file_pos; char zero='\0'; unsigned int end; if (!debug_fp) return; // no file @@ -387,8 +388,8 @@ void _debug_write_hex(struct _debug_item *item, unsigned char *buf, int size, int col) { struct _debug_file_rec_l lfile_rec; unsigned char rec_type; - int index_size = 3 * sizeof(int); - int index_pos, file_pos, index[3]; + int index_size = 3 * sizeof(off_t); + off_t index_pos, file_pos, index[3]; char zero='\0'; if (!debug_fp) return; // no file index[0] = 1; // only one item in this index run @@ -415,7 +416,7 @@ _pst_debug_hexdump(debug_fp, buf, size, col, 0); fwrite(&zero, 1, 1, debug_fp); - lfile_rec.end = ftell(debug_fp)-file_pos; + lfile_rec.end = ftell(debug_fp) - file_pos; index[2] = ftell(debug_fp); fseek(debug_fp, index_pos, SEEK_SET);