From 901672189f6d1d1251df84d945bb3cd9c210a066 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 20 Feb 2012 20:04:37 +0000 Subject: [PATCH] - simplify rounding - use 0x for hex printing --- src/cdf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cdf.c b/src/cdf.c index 08255d79..360c95c5 100644 --- a/src/cdf.c +++ b/src/cdf.c @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: cdf.c,v 1.47 2012/02/17 04:23:30 christos Exp $") +FILE_RCSID("@(#)$File: cdf.c,v 1.48 2012/02/17 05:27:45 christos Exp $") #endif #include @@ -807,7 +807,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, } inp[i].pi_id = CDF_GETUINT32(p, i << 1); inp[i].pi_type = CDF_GETUINT32(q, 0); - DPRINTF(("%" SIZE_T_FORMAT "u) id=%x type=%x offs=%tx,%d\n", i, + DPRINTF(("%" SIZE_T_FORMAT "u) id=%x type=%x offs=0x%tx,0x%x\n", i, inp[i].pi_id, inp[i].pi_type, q - p, CDF_GETUINT32(p, (i << 1) + 1))); if (inp[i].pi_type & CDF_VECTOR) { @@ -895,8 +895,9 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, "u, s = %s\n", l, CDF_ROUND(l, sizeof(l)), inp[i].pi_str.s_buf)); - l = 4 + (uint32_t)CDF_ROUND(l, sizeof(l)); - o += l >> 2; + if (l & 1) + l++; + o += l >> 1; if (q + o >= e) goto out; o4 = o * sizeof(uint32_t); -- 2.40.0