diff src/debug.c @ 125:23a36ac0514d

recover dropped pragma pack line, use int64_t rather than off_t to avoid forcing users of the shared library to enable large file support.
author Carl Byington <carl@five-ten-sg.com>
date Tue, 03 Feb 2009 15:01:47 -0800
parents ab2a11e72250
children fc11b1d1ad34
line wrap: on
line diff
--- a/src/debug.c	Tue Feb 03 11:00:16 2009 -0800
+++ b/src/debug.c	Tue Feb 03 15:01:47 2009 -0800
@@ -48,7 +48,7 @@
     if (col == -1) col = NUM_COL;
     fprintf(out, "\n");
     while (off < size) {
-        fprintf(out, "%06"PRIx64"\t:", (uint64_t)(off+delta));
+        fprintf(out, "%06"PRIx64"\t:", (int64_t)(off+delta));
         toff = off;
         while (count < col && off < size) {
             fprintf(out, "%02hhx ", (unsigned char)buf[off]);
@@ -251,19 +251,19 @@
     size_t size, ptr, funcname, filename, text, end;
     char *buf = NULL, rec_type;
     if (!debug_fp) return;  // no file
-    uint64_t index_pos = ftello(debug_fp);
-    uint64_t file_pos  = index_pos;
+    int64_t index_pos = ftello(debug_fp);
+    int64_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(uint64_t));
-    uint64_t *index;
+    int index_size = ((curr_items+2) * sizeof(int64_t));
+    int64_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 = (uint64_t*)xmalloc(index_size);
+    index = (int64_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(uint64_t);
-    uint64_t index[3];
-    uint64_t index_pos, file_pos;
+    int index_size = 3 * sizeof(int64_t);
+    int64_t index[3];
+    int64_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(uint64_t);
-    uint64_t index_pos, file_pos, index[3];
+    int index_size = 3 * sizeof(int64_t);
+    int64_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