From 868f55956a2e906958ef86f0a6d532502362708e Mon Sep 17 00:00:00 2001
From: Mike Vastola <Mike@Vasto.la>
Date: Fri, 20 Jun 2014 11:03:21 -0400
Subject: [PATCH] Fixed two warnings when compiling Ruby extension.
- Fixed the format arg passed to printf on if/ruby/hpdf.c:51. The %X format
specifier expects an int, but the type being passed to it, HPDF_STATUS is
defined as a long. Prefixed the two 'X's with 'l's to remove compile warn.
- Resolved 2nd compile warning due to if/ruby/hpdf.c:1989. The iterator in
the for loop was a HPDF_INT, but it was being compared against the
'num_ptn' element of an HPDF_DashMode, which is defined as an HPDF_UINT.
I simply made the iterator an HPDF_UINT as well, since it never needed
to dip into negative territory anyway.
---
if/ruby/hpdf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/if/ruby/hpdf.c b/if/ruby/hpdf.c
index 1f5e472..5e76d74 100644
--- a/if/ruby/hpdf.c
+++ b/if/ruby/hpdf.c
@@ -48,7 +48,7 @@ hpdf_error_handler (HPDF_STATUS error_no,
{
char msg[256];
- snprintf(msg, 256, "ERROR 0x%04X-0x%04X", error_no, detail_no);
+ snprintf(msg, 256, "ERROR 0x%04lX-0x%04lX", error_no, detail_no);
rb_raise(rb_eHPDFError, "%s", msg);
}
@@ -1974,7 +1974,7 @@ hpdf_page_get_dash (VALUE obj)
VALUE ret;
VALUE num_ptn;
VALUE phase;
- HPDF_INT i;
+ HPDF_UINT i;
Data_Get_Struct(obj, HPDF_Dict_Rec, page);
--
2.21.1 (Apple Git-122.3)