[perl-Cairo] Do not assume that sizeof(void*) == sizeof(long)



commit 5f2dba87ee826fbd2523c6773c8776f659fccd6d
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date:   Sat Jun 9 00:37:56 2012 +0200

    Do not assume that sizeof(void*) == sizeof(long)

 CairoSurface.xs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/CairoSurface.xs b/CairoSurface.xs
index b905b72..e84ea27 100644
--- a/CairoSurface.xs
+++ b/CairoSurface.xs
@@ -17,10 +17,10 @@
 static HV *pointer_to_package = NULL;
 
 /* A hex character represents four bits in the address of a pointer, so we'll
- * need BITS_PER_LONG/4 characters.  That's sizeof (long) * 2.  Add 2 for the
- * "0x" part.  Add 1 for the trailing \0.  Reasoning courtesy of Robert Love.
+ * need BITS_PER_POINTER/4 characters.  That's sizeof (void*) * 2.  Add 2 for
+ * the "0x" part.  Add 1 for the trailing \0.
  */
-#define MAX_KEY_LENGTH ((sizeof(long) * 2) + 2 + 1)
+#define MAX_KEY_LENGTH ((sizeof(void*) * 2) + 2 + 1)
 
 /* This stuff is also used in CairoPattern.xs, hence no static on the
  * functions.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]