diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2020-03-17 00:44:02 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2020-03-17 12:18:15 +0000 |
commit | 4cbc36fe4546bce70537bc65541f65b4d7259a5b (patch) | |
tree | 5238751d4306e19bc4f66920604a47a09e0890ab /xps | |
parent | d7961033ee224fc5d2c96a16bea3f3399dd29561 (diff) | |
download | ghostpdl-4cbc36fe4546bce70537bc65541f65b4d7259a5b.tar.gz |
Bug 702151: Avoid truncating pointers in debug code.
Introduce a PRI_INTPTR and use that to consistently display
pointers. We avoid using %p, as that displays inconsistently
between platforms. Sometimes it does 0x%x, sometimes just %x.
Diffstat (limited to 'xps')
-rw-r--r-- | xps/xpshash.c | 5 | ||||
-rw-r--r-- | xps/xpsresource.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/xps/xpshash.c b/xps/xpshash.c index 3ff3d3e73..2c27f6ff6 100644 --- a/xps/xpshash.c +++ b/xps/xpshash.c @@ -214,7 +214,8 @@ xps_hash_debug(xps_hash_table_t *table) if (!table->entries[i].value) dlprintf1("table % 4d: empty\n", i); else - dlprintf3("table % 4d: key=%s value=%p\n", i, - table->entries[i].key, table->entries[i].value); + dlprintf3("table % 4d: key=%s value="PRI_INTPTR"\n", i, + table->entries[i].key, + (intptr_t)table->entries[i].value); } } diff --git a/xps/xpsresource.c b/xps/xpsresource.c index fdcf1876e..6fb5c2e68 100644 --- a/xps/xpsresource.c +++ b/xps/xpsresource.c @@ -208,7 +208,8 @@ xps_debug_resource_dictionary(xps_context_t *ctx, xps_resource_t *dict) { if (dict->base_uri) dmprintf1(ctx->memory, "URI = '%s'\n", dict->base_uri); - dmprintf2(ctx->memory, "KEY = '%s' VAL = %p\n", dict->name, dict->data); + dmprintf2(ctx->memory, "KEY = '%s' VAL = "PRI_INTPTR"\n", + dict->name, (intptr_t)dict->data); if (dict->parent) { dmputs(ctx->memory, "PARENT = {\n"); |