changeset 111:43722a0ba717

Attempt to make audioDB files 32/64 neutral. Doing so by turning all the (logically) size_t and off_t elements into unsigneds is a hack, it has to be admitted. There will still be endian dependencies too, but maybe this is enough to make audioDB files portable between x86 and x86-64.
author mas01cr
date Fri, 05 Oct 2007 15:38:34 +0000
parents 428c210cb9f4
children 6735281de562
files audioDB.h
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/audioDB.h	Fri Oct 05 15:05:07 2007 +0000
+++ b/audioDB.h	Fri Oct 05 15:38:34 2007 +0000
@@ -85,19 +85,23 @@
 
 using namespace std;
 
-// 64 byte header
 typedef struct dbTableHeader{
   unsigned magic;
   unsigned version;
   unsigned numFiles;
   unsigned dim;
   unsigned flags;
-  size_t length;
-  size_t fileTableOffset;
-  size_t trackTableOffset;
-  size_t dataOffset;
-  size_t l2normTableOffset;
-  size_t timesTableOffset;
+  // FIXME: these lengths and offsets should be size_t or off_t, but
+  // that causes this header (and hence audioDB files) to be
+  // unportable between 32 and 64-bit architectures.  Making them
+  // unsigned isn't the real answer, but it works around the problem.
+  // -- CSR, 2007-10-05
+  unsigned length;
+  unsigned fileTableOffset;
+  unsigned trackTableOffset;
+  unsigned dataOffset;
+  unsigned l2normTableOffset;
+  unsigned timesTableOffset;
 } dbTableHeaderT, *dbTableHeaderPtr;