bug-zile
[Top][All Lists]
Advanced

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

Re: [Bug-zile] 2.3.12: LP64 warnings


From: Reuben Thomas
Subject: Re: [Bug-zile] 2.3.12: LP64 warnings
Date: Wed, 14 Oct 2009 22:58:35 +0100

Thanks for this, sorry to take so long to reply.

Surely your patch won't work on machines for which long is not the
same as a pointer? I came up with:

diff --git a/src/main.c b/src/main.c
index 037dfc8..c95a1d8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -315,7 +315,7 @@ main (int argc, char **argv)
     {
       char *arg = (char *) gl_list_get_at (arg_arg, i);

-      switch ((int) gl_list_get_at (arg_type, i))
+      switch ((ptrdiff_t) gl_list_get_at (arg_type, i))
         {
         case ARG_FUNCTION:
           ok = get_function (arg) != NULL;
diff --git a/src/term_curses.c b/src/term_curses.c
index 1afcf4c..c48f076 100644
--- a/src/term_curses.c
+++ b/src/term_curses.c
@@ -349,7 +349,7 @@ get_char (void)

   if (size > 0)
     {
-      c = (int) gl_list_get_at (key_buf, size - 1);
+      c = (ptrdiff_t) gl_list_get_at (key_buf, size - 1);
       gl_list_remove_at (key_buf, size - 1);
     }
   else
@@ -404,7 +404,7 @@ term_ungetkey (size_t key)
   size_t i, n = keytocodes (key, &codes);

   for (i = n; i > 0; i--)
-    gl_list_add_last (key_buf, (void *) codes[i - 1]);
+    gl_list_add_last (key_buf, (void *)(ptrdiff_t) codes[i - 1]);

   free (codes);
 }

Does this look better to you?

-- 
http://rrt.sc3d.org
Too late: it’s like sticking plasters on a coffin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]