From 84c041a6fbebf7a4338371a17f001c76a165b1f3 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 7 Aug 2016 15:06:56 +1000 Subject: [PATCH] updated more incorrect logging types (%s vs %d) (#156) --- libsrc/effectengine/EffectEngine.cpp | 2 +- libsrc/leddevice/LedDeviceLightpack-hidapi.cpp | 2 +- libsrc/leddevice/LedDeviceLightpack.cpp | 18 +++++++++--------- libsrc/leddevice/LedDeviceMultiLightpack.cpp | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libsrc/effectengine/EffectEngine.cpp b/libsrc/effectengine/EffectEngine.cpp index a27261eb..93725c92 100644 --- a/libsrc/effectengine/EffectEngine.cpp +++ b/libsrc/effectengine/EffectEngine.cpp @@ -128,7 +128,7 @@ bool EffectEngine::loadEffectDefinition(const std::string &path, const std::stri { const std::list & errors = schemaChecker.getMessages(); foreach (const std::string & error, errors) { - Error( log, "Error while checking '%s':", fileName.c_str(), error.c_str()); + Error( log, "Error while checking '%s':%s", fileName.c_str(), error.c_str()); } return false; } diff --git a/libsrc/leddevice/LedDeviceLightpack-hidapi.cpp b/libsrc/leddevice/LedDeviceLightpack-hidapi.cpp index b53e64a8..3e47e6cb 100644 --- a/libsrc/leddevice/LedDeviceLightpack-hidapi.cpp +++ b/libsrc/leddevice/LedDeviceLightpack-hidapi.cpp @@ -259,7 +259,7 @@ int LedDeviceLightpackHidapi::writeBytes(uint8_t *data, int size) return 0; } - Error(_log, "Unable to write %s bytes to Lightpack device(%s)", size, error); + Error(_log, "Unable to write %d bytes to Lightpack device(%d)", size, error); return error; } diff --git a/libsrc/leddevice/LedDeviceLightpack.cpp b/libsrc/leddevice/LedDeviceLightpack.cpp index 7c94a527..0c38c7bb 100644 --- a/libsrc/leddevice/LedDeviceLightpack.cpp +++ b/libsrc/leddevice/LedDeviceLightpack.cpp @@ -71,7 +71,7 @@ int LedDeviceLightpack::open() // initialize the usb context if ((error = libusb_init(&_libusbContext)) != LIBUSB_SUCCESS) { - Error(_log, "Error while initializing USB context(%s): %s", error, libusb_error_name(error)); + Error(_log, "Error while initializing USB context(%d): %s", error, libusb_error_name(error)); _libusbContext = nullptr; return -1; } @@ -119,7 +119,7 @@ int LedDeviceLightpack::testAndOpen(libusb_device * device, const std::string & int error = libusb_get_device_descriptor(device, &deviceDescriptor); if (error != LIBUSB_SUCCESS) { - Error(_log, "Error while retrieving device descriptor(%s): %s", error, libusb_error_name(error)); + Error(_log, "Error while retrieving device descriptor(%d): %s", error, libusb_error_name(error)); return -1; } @@ -142,7 +142,7 @@ int LedDeviceLightpack::testAndOpen(libusb_device * device, const std::string & } catch (int e) { - Error(_log, "unable to retrieve serial number from Lightpack device(%s): %s", e, libusb_error_name(e)); + Error(_log, "unable to retrieve serial number from Lightpack device(%d): %s", e, libusb_error_name(e)); serialNumber = ""; } } @@ -173,7 +173,7 @@ int LedDeviceLightpack::testAndOpen(libusb_device * device, const std::string & buffer, sizeof(buffer), 1000); if (error < 3) { - Error(_log, "Unable to retrieve firmware version number from Lightpack device(%s): %s", error, libusb_error_name(error)); + Error(_log, "Unable to retrieve firmware version number from Lightpack device(%d): %s", error, libusb_error_name(error)); } else { @@ -219,7 +219,7 @@ int LedDeviceLightpack::testAndOpen(libusb_device * device, const std::string & catch(int e) { _deviceHandle = nullptr; - Warning(_log, "Unable to open Lightpack device. Searching for other device(%s): %s", e, libusb_error_name(e)); + Warning(_log, "Unable to open Lightpack device. Searching for other device(%d): %s", e, libusb_error_name(e)); } } } @@ -289,7 +289,7 @@ int LedDeviceLightpack::writeBytes(uint8_t *data, int size) return 0; } - Error(_log, "Unable to write %d bytes to Lightpack device(%s): %s", size, error, libusb_error_name(error)); + Error(_log, "Unable to write %d bytes to Lightpack device(%d): %s", size, error, libusb_error_name(error)); return error; } @@ -306,7 +306,7 @@ libusb_device_handle * LedDeviceLightpack::openDevice(libusb_device *device) int error = libusb_open(device, &handle); if (error != LIBUSB_SUCCESS) { - Error(log, "unable to open device(%s): %s", error, libusb_error_name(error)); + Error(log, "unable to open device(%d): %s", error, libusb_error_name(error)); throw error; } @@ -316,7 +316,7 @@ libusb_device_handle * LedDeviceLightpack::openDevice(libusb_device *device) error = libusb_detach_kernel_driver(handle, LIGHTPACK_INTERFACE); if (error != LIBUSB_SUCCESS) { - Error(log, "unable to detach kernel driver(%s): %s", error, libusb_error_name(error)); + Error(log, "unable to detach kernel driver(%d): %s", error, libusb_error_name(error)); libusb_close(handle); throw error; } @@ -325,7 +325,7 @@ libusb_device_handle * LedDeviceLightpack::openDevice(libusb_device *device) error = libusb_claim_interface(handle, LIGHTPACK_INTERFACE); if (error != LIBUSB_SUCCESS) { - Error(log, "unable to claim interface(%s): %s", error, libusb_error_name(error)); + Error(log, "unable to claim interface(%d): %s", error, libusb_error_name(error)); libusb_attach_kernel_driver(handle, LIGHTPACK_INTERFACE); libusb_close(handle); throw error; diff --git a/libsrc/leddevice/LedDeviceMultiLightpack.cpp b/libsrc/leddevice/LedDeviceMultiLightpack.cpp index e7a1b354..d7ff2654 100644 --- a/libsrc/leddevice/LedDeviceMultiLightpack.cpp +++ b/libsrc/leddevice/LedDeviceMultiLightpack.cpp @@ -114,7 +114,7 @@ std::list LedDeviceMultiLightpack::getLightpackSerials() int error = libusb_init(&libusbContext); if (error != LIBUSB_SUCCESS) { - Error(log,"Error while initializing USB context(%s): %s", error, libusb_error_name(error)); + Error(log,"Error while initializing USB context(%d): %s", error, libusb_error_name(error)); libusbContext = nullptr; return serialList; } @@ -132,7 +132,7 @@ std::list LedDeviceMultiLightpack::getLightpackSerials() error = libusb_get_device_descriptor(deviceList[i], &deviceDescriptor); if (error != LIBUSB_SUCCESS) { - Error(log, "Error while retrieving device descriptor(%s): %s", error, libusb_error_name(error)); + Error(log, "Error while retrieving device descriptor(%d): %s", error, libusb_error_name(error)); continue; } @@ -151,7 +151,7 @@ std::list LedDeviceMultiLightpack::getLightpackSerials() } catch (int e) { - Error(log,"Unable to retrieve serial number(%s): %s", e, libusb_error_name(e)); + Error(log,"Unable to retrieve serial number(%d): %s", e, libusb_error_name(e)); continue; } }