Skip to contentSkip to conversation

fix warnings in event.c when building for win32-64

PATCH In review Heiko Hund 2 participants 2 messages Aug 18, 2011 – Feb 21, 2012

lore
Share & tools
lore

Heiko Hund

author
#0 lore raw

PATCH 1/1 fix warnings in event.c when building for win32-64

When compiling for 64-bit Windows gcc warns about

"cast from pointer to integer of different size"

on two occasions in file event.c, due to invalid casting. This patch removes the type casts and uses the correct format specifier instead.

---
 event.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
event.c +4 -4
index 51b17b3..b6ed673 100644
@@ -214,9 +214,9 @@ we_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
 {
   struct we_set *wes = (struct we_set *) es;
 
-  dmsg (D_EVENT_WAIT, "WE_CTL n=%d ev=0x%08x rwflags=0x%04x arg=" ptr_format,
+  dmsg (D_EVENT_WAIT, "WE_CTL n=%d ev=%p rwflags=0x%04x arg=" ptr_format,
        wes->n_events,
-       (unsigned int)event,
+       event,
        rwflags,
        (ptr_type)arg);
 
@@ -344,9 +344,9 @@ we_wait (struct event_set *es, const struct timeval *tv, struct event_set_return
   if (check_debug_level (D_EVENT_WAIT)) {
     int i;
     for (i = 0; i < wes->n_events; ++i)
-      dmsg (D_EVENT_WAIT, "[%d] ev=0x%08x rwflags=0x%04x arg=" ptr_format,
+      dmsg (D_EVENT_WAIT, "[%d] ev=%p rwflags=0x%04x arg=" ptr_format,
        i,
-       (unsigned int)wes->events[i],
+       wes->events[i],
        wes->esr[i].rwflags,
        (ptr_type)wes->esr[i].arg);
   }
Signature · 1 line
1.7.5.4
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Heiko Hund

When compiling for 64-bit Windows gcc warns about

"cast from pointer to integer of different size"

on two occasions in file event.c, due to invalid casting. This patch removes the type casts and uses the correct format specifier instead.

++++---- 1 files changed, 4 insertions(+), 4 deletions(-)

Cleaning up some old patches which had slipped the patch queue. Applied to master and new master branch is pushed to -stable and -testing trees.

commit 3c19fcc2099d8ddf6bfeec6550d4e3cb1cbf3431

Author: Heiko Hund <[email protected]...>
Date:   Thu Aug 18 12:12:11 2011 +0000
    fix warnings in event.c when building for win32-64

    Signed-off-by: Heiko Hund <[email protected]...>
    Acked-by: James Yonan <[email protected]...>
    URL: http://article.gmane.org/gmane.network.openvpn.devel/4979
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9DoJkACgkQDC186MBRfrrN8gCfdtscvYfl3S4tMAbI3/lPUYmg COwAmwQyA/13DWVRppNs9Cleo1ov+sdJ
=VUzA
-----END PGP SIGNATURE-----