diff src/debug.c @ 123:ab2a11e72250

more cleanup of #include files. common.h is the only file allowed to include system .h files unprotected by autoconf HAVE_ symbols. define.h is the only other file allowed to include system .h files. define.h is never installed; common.h is installed if we are building the shared library.
author Carl Byington <carl@five-ten-sg.com>
date Tue, 03 Feb 2009 10:59:10 -0800
parents bdb38b434c0a
children 23a36ac0514d
line wrap: on
line diff
--- a/src/debug.c	Mon Feb 02 21:55:48 2009 -0800
+++ b/src/debug.c	Tue Feb 03 10:59:10 2009 -0800
@@ -251,19 +251,19 @@
     size_t size, ptr, funcname, filename, text, end;
     char *buf = NULL, rec_type;
     if (!debug_fp) return;  // no file
-    off_t index_pos = ftello(debug_fp);
-    off_t file_pos  = index_pos;
+    uint64_t index_pos = ftello(debug_fp);
+    uint64_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(off_t));
-    off_t *index;
+    int index_size = ((curr_items+2) * sizeof(uint64_t));
+    uint64_t *index;
     int index_ptr = 0;
     struct pst_debug_file_rec_m mfile_rec;
     struct pst_debug_file_rec_l lfile_rec;
 
     if (curr_items == 0) return;    // no items to write.
 
-    index = (off_t*)xmalloc(index_size);
+    index = (uint64_t*)xmalloc(index_size);
     memset(index, 0, index_size);   // valgrind, avoid writing uninitialized data
     file_pos += index_size;
     // write the index first, we will re-write it later, but
@@ -335,9 +335,9 @@
     struct pst_debug_file_rec_l lfile_rec;
     struct pst_debug_file_rec_m mfile_rec;
     unsigned char rec_type;
-    int index_size = 3 * sizeof(off_t);
-    off_t index[3];
-    off_t index_pos, file_pos;
+    int index_size = 3 * sizeof(uint64_t);
+    uint64_t index[3];
+    uint64_t index_pos, file_pos;
     char zero = '\0';
     unsigned int end;
     if (!debug_fp) return;  // no file
@@ -397,8 +397,8 @@
 void pst_debug_write_hex(struct pst_debug_item *item, char *buf, size_t size, int col) {
     struct pst_debug_file_rec_l lfile_rec;
     unsigned char rec_type;
-    int index_size = 3 * sizeof(off_t);
-    off_t index_pos, file_pos, index[3];
+    int index_size = 3 * sizeof(uint64_t);
+    uint64_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