From e65bd6b7d7c8177def8fa7c23875b1f0ff13d7ce Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 10 Apr 2016 13:59:27 -0700 Subject: [PATCH] Fix more format warnings --- common/list.c | 2 +- sesman/chansrv/clipboard.c | 28 ++++++++++++------------- sesman/chansrv/rail.c | 36 ++++++++++++++++----------------- sesman/chansrv/smartcard.c | 4 ++-- sesman/chansrv/smartcard_pcsc.c | 2 +- xup/xup.c | 2 +- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/common/list.c b/common/list.c index abab2fab..5873d41d 100644 --- a/common/list.c +++ b/common/list.c @@ -221,6 +221,6 @@ list_dump_items(struct list *self) for (index = 0; index < self->count; index++) { - g_writeln("%d: %s", index, list_get_item(self, index)); + g_writeln("%d: 0x%lx", index, list_get_item(self, index)); } } diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c index 929805f9..a170dd23 100644 --- a/sesman/chansrv/clipboard.c +++ b/sesman/chansrv/clipboard.c @@ -1697,9 +1697,9 @@ clipboard_event_selection_owner_notify(XEvent *xevent) XFixesSelectionNotifyEvent *lxevent; lxevent = (XFixesSelectionNotifyEvent *)xevent; - log_debug("clipboard_event_selection_owner_notify: %p", lxevent->owner); + log_debug("clipboard_event_selection_owner_notify: 0x%lx", lxevent->owner); log_debug("clipboard_event_selection_owner_notify: " - "window %d subtype %d owner %d g_wnd %d", + "window %ld subtype %d owner %ld g_wnd %ld", lxevent->window, lxevent->subtype, lxevent->owner, g_wnd); if (lxevent->owner == g_wnd) @@ -1735,7 +1735,7 @@ clipboard_get_window_property(Window wnd, Atom prop, Atom *type, int *fmt, Atom ltype; log_debug("clipboard_get_window_property:"); - log_debug(" prop %d name %s", prop, get_atom_text(prop)); + log_debug(" prop %ld name %s", prop, get_atom_text(prop)); lxdata = 0; ltype = 0; XGetWindowProperty(g_display, wnd, prop, 0, 0, 0, @@ -1873,7 +1873,7 @@ clipboard_event_selection_notify(XEvent *xevent) if (rv == 0) { - log_debug("clipboard_event_selection_notify: wnd %p prop %s", + log_debug("clipboard_event_selection_notify: wnd 0x%lx prop %s", lxevent->requestor, get_atom_text(lxevent->property)); rv = clipboard_get_window_property(lxevent->requestor, lxevent->property, @@ -1922,7 +1922,7 @@ clipboard_event_selection_notify(XEvent *xevent) atom = atoms[index]; LOGM((LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: %d %s %d", atom, get_atom_text(atom), XA_STRING)); - log_debug("clipboard_event_selection_notify: 0x%x %s", + log_debug("clipboard_event_selection_notify: 0x%lx %s", atom, get_atom_text(atom)); if (atom == g_utf8_atom) { @@ -1943,15 +1943,15 @@ clipboard_event_selection_notify(XEvent *xevent) } else { - log_error("clipboard_event_selection_notify: unknown atom 0x%x", atom); + log_error("clipboard_event_selection_notify: unknown atom 0x%lx", atom); } } } else { log_error("clipboard_event_selection_notify: error, " - "target is 'TARGETS' and type[%d] or fmt[%d] not right, " - "should be type[%d], fmt[%d]", type, fmt, XA_ATOM, 32); + "target is 'TARGETS' and type[%ld] or fmt[%d] not right, " + "should be type[%ld], fmt[%d]", type, fmt, XA_ATOM, 32); } } else if (lxevent->target == g_utf8_atom) @@ -2138,9 +2138,9 @@ clipboard_event_selection_request(XEvent *xevent) char *xdata; lxev = (XSelectionRequestEvent *)xevent; - log_debug("clipboard_event_selection_request: %p", lxev->property); - log_debug("clipboard_event_selection_request: g_wnd %d, " - ".requestor %d .owner %d .selection %d '%s' .target %d .property %d", + log_debug("clipboard_event_selection_request: 0x%lx", lxev->property); + log_debug("clipboard_event_selection_request: g_wnd %ld, " + ".requestor %ld .owner %ld .selection %ld '%s' .target %ld .property %ld", g_wnd, lxev->requestor, lxev->owner, lxev->selection, get_atom_text(lxev->selection), lxev->target, lxev->property); @@ -2326,8 +2326,8 @@ clipboard_event_property_notify(XEvent *xevent) char *cptr; log_debug("clipboard_event_property_notify:"); - log_debug("clipboard_event_property_notify: PropertyNotify .window %d " - ".state %d .atom %d %s", xevent->xproperty.window, + log_debug("clipboard_event_property_notify: PropertyNotify .window %ld " + ".state %d .atom %ld %s", xevent->xproperty.window, xevent->xproperty.state, xevent->xproperty.atom, get_atom_text(xevent->xproperty.atom)); @@ -2412,7 +2412,7 @@ clipboard_event_property_notify(XEvent *xevent) } else { - log_error("clipboard_event_property_notify: error unknown type %d", + log_error("clipboard_event_property_notify: error unknown type %ld", g_clip_s2c.type); clipboard_send_data_response_failed(); } diff --git a/sesman/chansrv/rail.c b/sesman/chansrv/rail.c index 09f40eba..cad16471 100644 --- a/sesman/chansrv/rail.c +++ b/sesman/chansrv/rail.c @@ -508,7 +508,7 @@ rail_win_popdown(void) window_attributes.map_state == IsViewable && list_index_of(g_window_list, children[i]) >= 0) { - LOG(10, (" dismiss pop up 0x%8.8x", children[i])); + LOG(10, (" dismiss pop up 0x%8.8lx", children[i])); rail_send_key_esc(children[i]); rv = 1; } @@ -756,7 +756,7 @@ rail_win_set_state(Window win, unsigned long state) int old_state; unsigned long data[2] = { state, None }; - LOG(10, (" rail_win_set_state: %d", state)); + LOG(10, (" rail_win_set_state: %ld", state)); /* check whether WM_STATE exists */ old_state = rail_win_get_state(win); if (old_state == -1) @@ -1259,7 +1259,7 @@ rail_win_send_text(Window win) } if (data && len > 0) { - LOG(10, ("chansrv::rail_win_send_text: 0x%8.8x text %s length %d", + LOG(10, ("chansrv::rail_win_send_text: 0x%8.8lx text %s length %d", win, data, len)); make_stream(s); init_stream(s, len + 1024); @@ -1289,7 +1289,7 @@ rail_destroy_window(Window window_id) { struct stream *s; - LOG(10, ("chansrv::rail_destroy_window 0x%8.8x", window_id)); + LOG(10, ("chansrv::rail_destroy_window 0x%8.8lx", window_id)); make_stream(s); init_stream(s, 1024); @@ -1309,7 +1309,7 @@ rail_show_window(Window window_id, int show_state) int flags; struct stream* s; - LOG(10, ("chansrv::rail_show_window 0x%8.8x 0x%x", window_id, show_state)); + LOG(10, ("chansrv::rail_show_window 0x%8.8lx 0x%x", window_id, show_state)); make_stream(s); init_stream(s, 1024); @@ -1351,7 +1351,7 @@ rail_create_window(Window window_id, Window owner_id) struct rail_window_data* rwd; struct stream* s; - LOG(10, ("chansrv::rail_create_window 0x%8.8x", window_id)); + LOG(10, ("chansrv::rail_create_window 0x%8.8lx", window_id)); rwd = rail_get_window_data_safe(window_id); if (rwd == 0) @@ -1507,7 +1507,7 @@ rail_configure_request_window(XConfigureRequestEvent* config) if (mask & CWStackMode) { LOG(10, ("chansrv::rail_configure_request_window: CWStackMode " - "detail 0x%8.8x above 0x%8.8x", config->detail, config->above)); + "detail 0x%8.8x above 0x%8.8lx", config->detail, config->above)); if (config->detail == Above) { LOG(10, ("chansrv::rail_configure_request_window: bring to front " @@ -1808,7 +1808,7 @@ rail_xevent(void *xevent) { case PropertyNotify: prop_name = XGetAtomName(g_display, lxevent->xproperty.atom); - LOG(10, (" got PropertyNotify window_id 0x%8.8x %s state new %d", + LOG(10, (" got PropertyNotify window_id 0x%8.8lx %s state new %d", lxevent->xproperty.window, prop_name, lxevent->xproperty.state == PropertyNewValue)); @@ -1831,7 +1831,7 @@ rail_xevent(void *xevent) break; case ConfigureRequest: - LOG(10, (" got ConfigureRequest window_id 0x%8.8x", lxevent->xconfigurerequest.window)); + LOG(10, (" got ConfigureRequest window_id 0x%8.8lx", lxevent->xconfigurerequest.window)); g_memset(&xwc, 0, sizeof(xwc)); xwc.x = lxevent->xconfigurerequest.x; xwc.y = lxevent->xconfigurerequest.y; @@ -1849,13 +1849,13 @@ rail_xevent(void *xevent) break; case CreateNotify: - LOG(10, (" got CreateNotify window 0x%8.8x parent 0x%8.8x", + LOG(10, (" got CreateNotify window 0x%8.8lx parent 0x%8.8lx", lxevent->xcreatewindow.window, lxevent->xcreatewindow.parent)); rail_select_input(lxevent->xcreatewindow.window); break; case DestroyNotify: - LOG(10, (" got DestroyNotify window 0x%8.8x event 0x%8.8x", + LOG(10, (" got DestroyNotify window 0x%8.8lx event 0x%8.8lx", lxevent->xdestroywindow.window, lxevent->xdestroywindow.event)); if (lxevent->xdestroywindow.window != lxevent->xdestroywindow.event) { @@ -1871,12 +1871,12 @@ rail_xevent(void *xevent) break; case MapRequest: - LOG(10, (" got MapRequest window 0x%8.8x", lxevent->xmaprequest.window)); + LOG(10, (" got MapRequest window 0x%8.8lx", lxevent->xmaprequest.window)); XMapWindow(g_display, lxevent->xmaprequest.window); break; case MapNotify: - LOG(10, (" got MapNotify window 0x%8.8x event 0x%8.8x", + LOG(10, (" got MapNotify window 0x%8.8lx event 0x%8.8lx", lxevent->xmap.window, lxevent->xmap.event)); if (lxevent->xmap.window != lxevent->xmap.event) { @@ -1902,7 +1902,7 @@ rail_xevent(void *xevent) break; case UnmapNotify: - LOG(10, (" got UnmapNotify 0x%8.8x", lxevent->xunmap.event)); + LOG(10, (" got UnmapNotify 0x%8.8lx", lxevent->xunmap.event)); if (lxevent->xunmap.window != lxevent->xunmap.event) { break; @@ -1910,7 +1910,7 @@ rail_xevent(void *xevent) if (is_window_valid_child_of_root(lxevent->xunmap.window)) { index = list_index_of(g_window_list, lxevent->xunmap.window); - LOG(10, (" window 0x%8.8x is unmapped", lxevent->xunmap.window)); + LOG(10, (" window 0x%8.8lx is unmapped", lxevent->xunmap.window)); if (index >= 0) { XGetWindowAttributes(g_display, lxevent->xunmap.window, &wnd_attributes); @@ -1929,7 +1929,7 @@ rail_xevent(void *xevent) break; case ConfigureNotify: - LOG(10, (" got ConfigureNotify 0x%8.8x event 0x%8.8x", lxevent->xconfigure.window, + LOG(10, (" got ConfigureNotify 0x%8.8lx event 0x%8.8lx", lxevent->xconfigure.window, lxevent->xconfigure.event)); rv = 0; if (lxevent->xconfigure.event != lxevent->xconfigure.window || @@ -1975,8 +1975,8 @@ rail_xevent(void *xevent) break; case ReparentNotify: - LOG(10, (" got ReparentNotify window 0x%8.8x parent 0x%8.8x " - "event 0x%8.8x x %d y %d override redirect %d", + LOG(10, (" got ReparentNotify window 0x%8.8lx parent 0x%8.8lx " + "event 0x%8.8lx x %d y %d override redirect %d", lxevent->xreparent.window, lxevent->xreparent.parent, lxevent->xreparent.event, lxevent->xreparent.x, lxevent->xreparent.y, lxevent->xreparent.override_redirect)); diff --git a/sesman/chansrv/smartcard.c b/sesman/chansrv/smartcard.c index a07e36eb..02a30d1a 100644 --- a/sesman/chansrv/smartcard.c +++ b/sesman/chansrv/smartcard.c @@ -1854,8 +1854,8 @@ scard_send_Transmit(IRP *irp, char *context, int context_bytes, } log_debug("send_bytes %d recv_bytes %d send dwProtocol %d cbPciLength %d " - "extra_bytes %d recv dwProtocol %d cbPciLength %d", send_bytes, - recv_bytes, send_ior->dwProtocol, send_ior->cbPciLength, + "extra_bytes %d recv dwProtocol %d cbPciLength %d extra_bytes %d", + send_bytes, recv_bytes, send_ior->dwProtocol, send_ior->cbPciLength, send_ior->extra_bytes, recv_ior->dwProtocol, recv_ior->cbPciLength, recv_ior->extra_bytes); diff --git a/sesman/chansrv/smartcard_pcsc.c b/sesman/chansrv/smartcard_pcsc.c index 9824432e..bf3d11bb 100644 --- a/sesman/chansrv/smartcard_pcsc.c +++ b/sesman/chansrv/smartcard_pcsc.c @@ -259,7 +259,7 @@ free_uds_client(struct pcsc_uds_client *uds_client) } list_delete(context->cards); } - LLOGLN(10, (" left over context 0x%8.8x", context->context)); + LLOGLN(10, (" left over context %p", context->context)); scard_send_cancel(0, context->context, context->context_bytes); scard_send_release_context(0, context->context, context->context_bytes); diff --git a/xup/xup.c b/xup/xup.c index 8e904d52..1bc976ea 100644 --- a/xup/xup.c +++ b/xup/xup.c @@ -212,7 +212,7 @@ lib_mod_connect(struct mod *mod) if (trans_connect(mod->trans, mod->ip, con_port, 3000) == 0) { LLOGLN(0, ("lib_mod_connect: connected to Xserver " - "(Xorg or X11rdp) sck %d", mod->trans->sck)); + "(Xorg or X11rdp) sck %ld", mod->trans->sck)); error = 0; }