Mark internal log functions with attribute(printf)

And fix all the places where we passed in garbage.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-07-21 11:01:39 +10:00
parent dd0111b32d
commit d109a00cbf
4 changed files with 9 additions and 5 deletions

View file

@ -612,7 +612,7 @@ evdev_middlebutton_filter_button(struct evdev_device *device,
if (button < BTN_LEFT ||
bit >= sizeof(device->middlebutton.button_mask) * 8) {
log_bug_libinput(device->base.seat->libinput,
"Button mask too small for %d\n",
"Button mask too small for %s\n",
libevdev_event_code_get_name(EV_KEY,
button));
return true;

View file

@ -1536,7 +1536,8 @@ tp_sanity_check(struct tp_dispatch *tp,
error:
log_bug_kernel(libinput,
"device %s failed touchpad sanity checks\n");
"device %s failed touchpad sanity checks\n",
device->devname);
return -1;
}

View file

@ -563,7 +563,7 @@ evdev_process_touch(struct evdev_device *device,
case ABS_MT_SLOT:
if ((size_t)e->value >= device->mt.slots_len) {
log_bug_libinput(device->base.seat->libinput,
"%s exceeds slots (%d of %d)\n",
"%s exceeds slots (%d of %zd)\n",
device->devname,
e->value,
device->mt.slots_len);
@ -1482,6 +1482,7 @@ evdev_get_trackpoint_dpi(struct evdev_device *device)
}
log_info(libinput,
"Device '%s' set to const accel %.2f\n",
device->devname,
accel);
}

View file

@ -247,13 +247,15 @@ typedef void (*libinput_source_dispatch_t)(void *data);
void
log_msg(struct libinput *libinput,
enum libinput_log_priority priority,
const char *format, ...);
const char *format, ...)
LIBINPUT_ATTRIBUTE_PRINTF(3, 4);
void
log_msg_va(struct libinput *libinput,
enum libinput_log_priority priority,
const char *format,
va_list args);
va_list args)
LIBINPUT_ATTRIBUTE_PRINTF(3, 0);
int
libinput_init(struct libinput *libinput,