From 9df8909948bb491b1b8c53ff8e1b5ce125304aac Mon Sep 17 00:00:00 2001 From: Daniel Brahneborg Date: Sat, 2 Mar 2002 23:28:39 +0000 Subject: Various proto changes. --- lib/sisreqrecord.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lib/sisreqrecord.cpp') 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; } -- cgit v1.2.3