diff options
author | Daniel Brahneborg <basic@chello.se> | 2002-03-02 23:28:39 +0000 |
---|---|---|
committer | Daniel Brahneborg <basic@chello.se> | 2002-03-02 23:28:39 +0000 |
commit | 9df8909948bb491b1b8c53ff8e1b5ce125304aac (patch) | |
tree | 239befaacb77374dfd9c61ed45d592259bb969b0 /lib/sisreqrecord.cpp | |
parent | 6f49fd782b8935b8caf7cea7bcb6e10644851b13 (diff) | |
download | plptools-9df8909948bb491b1b8c53ff8e1b5ce125304aac.tar.gz plptools-9df8909948bb491b1b8c53ff8e1b5ce125304aac.tar.bz2 plptools-9df8909948bb491b1b8c53ff8e1b5ce125304aac.zip |
Various proto changes.
Diffstat (limited to 'lib/sisreqrecord.cpp')
-rw-r--r-- | lib/sisreqrecord.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/sisreqrecord.cpp b/lib/sisreqrecord.cpp index 978ce48..d0c2d12 100644 --- a/lib/sisreqrecord.cpp +++ b/lib/sisreqrecord.cpp @@ -7,28 +7,32 @@ void SISReqRecord::fillFrom(uchar* buf, int* base, SISFile* sisFile) { - int ix = *base; + uchar* p = buf + *base; + int size = 0; - m_uid = read32(buf, &ix); - m_major = read16(buf, &ix); - m_minor = read16(buf, &ix); - m_variant = read32(buf, &ix); + m_uid = read32(p); + m_major = read16(p + 4); + m_minor = read16(p + 6); + m_variant = read32(p + 8); int n = sisFile->m_header.m_nreqs; m_nameLengths = new uint32[n]; m_namePtrs = new uint32[n]; // First read lengths. // + size = 12; for (int i = 0; i < n; ++i) { - m_nameLengths[i] = read32(buf, &ix); + m_nameLengths[i] = read32(p + size); + size += 4; } // Then read ptrs. // for (int i = 0; i < n; ++i) { - m_namePtrs[i] = read32(buf, &ix); + m_namePtrs[i] = read32(p + size); + size += 4; if (logLevel >= 2) printf("Name %d (for %s) is %.*s\n", i, @@ -37,7 +41,8 @@ SISReqRecord::fillFrom(uchar* buf, int* base, SISFile* sisFile) buf + m_namePtrs[i]); } if (logLevel >= 1) - printf("%d .. %d (%d bytes): Req record\n", *base, ix, ix - *base); - *base = ix; + printf("%d .. %d (%d bytes): Req record\n", + *base, *base + size, size); + *base += size; } |