OSSP CVS Repository

ossp - Check-in [4641]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4641
Date: 2004-Jul-13 13:00:43 (local)
2004-Jul-13 11:00:43 (UTC)
User:rse
Branch:
Comment: Fix handling/casting of "int (*)(void *)" callback functions
Tickets:
Inspections:
Files:
ossp-pkg/pth/ChangeLog      1.611 -> 1.612     3 inserted, 0 deleted
ossp-pkg/pth/pth_event.c      1.62 -> 1.63     5 inserted, 5 deleted

ossp-pkg/pth/ChangeLog 1.611 -> 1.612

--- ChangeLog    2004/07/13 10:53:53     1.611
+++ ChangeLog    2004/07/13 11:00:43     1.612
@@ -21,6 +21,9 @@
                   
   Changes between 2.0.0 and 2.0.1 (17-Feb-2003 to xx-XXX-2003)
 
+   *) Fix handling/casting of "int (*)(void *)" callback functions.
+      [Ralf S. Engelschall]
+
    *) Resolve symbol conflict in pth_string.c between pow10/round
       and GCC builtins.
       [Ralf S. Engelschall]


ossp-pkg/pth/pth_event.c 1.62 -> 1.63

--- pth_event.c  2004/07/13 10:50:49     1.62
+++ pth_event.c  2004/07/13 11:00:43     1.63
@@ -196,7 +196,7 @@
         /* custom function event */
         ev->ev_type = PTH_EVENT_FUNC;
         ev->ev_goal = (int)(spec & (PTH_UNTIL_OCCURRED));
-        ev->ev_args.FUNC.func  = (int (*)(void *))va_arg(ap, void *);
+        ev->ev_args.FUNC.func  = va_arg(ap, int (*)(void *));
         ev->ev_args.FUNC.arg   = va_arg(ap, void *);
         ev->ev_args.FUNC.tv    = va_arg(ap, pth_time_t);
     }
@@ -266,10 +266,10 @@
     }
     else if (ev->ev_type & PTH_EVENT_FUNC) {
         /* custom function event */
-        void **func    = va_arg(ap, void **);
-        void **arg     = va_arg(ap, void **);
-        pth_time_t *tv = va_arg(ap, pth_time_t *);
-        *func = (int (**)(void *))ev->ev_args.FUNC.func;
+        int (**func)(void *) = va_arg(ap, int (**)(void *));
+        void **arg           = va_arg(ap, void **);
+        pth_time_t *tv       = va_arg(ap, pth_time_t *);
+        *func = ev->ev_args.FUNC.func;
         *arg  = ev->ev_args.FUNC.arg;
         *tv   = ev->ev_args.FUNC.tv;
     }

CVSTrac 2.0.1