From 34ca71a2b1057685e6406df71b167759d74b586e Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 29 Sep 2011 23:09:48 +0200 Subject: [PATCH 1/1] kinect_upload_fw: fix -Wformat warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit kinect_upload_fw.c:92:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat] kinect_upload_fw.c:157:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat] kinect_upload_fw.c:182:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat] kinect_upload_fw.c:208:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat] --- kinect_upload_fw/kinect_upload_fw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kinect_upload_fw/kinect_upload_fw.c b/kinect_upload_fw/kinect_upload_fw.c index c932908..b16cff9 100644 --- a/kinect_upload_fw/kinect_upload_fw.c +++ b/kinect_upload_fw/kinect_upload_fw.c @@ -89,7 +89,7 @@ static int get_reply(void) { int transferred; res = libusb_bulk_transfer(dev, 0x81, (unsigned char*)&buffer, 512, &transferred, 0); if(res != 0 || transferred != sizeof(status_code)) { - LOG("Error reading reply: %d\ttransferred: %d (expected %d)\n", res, transferred, sizeof(status_code)); + LOG("Error reading reply: %d\ttransferred: %d (expected %lu)\n", res, transferred, sizeof(status_code)); return res; } if(fn_le32(buffer.magic) != 0x0a6fe000) { @@ -154,7 +154,7 @@ int main(int argc, char** argv) { res = libusb_bulk_transfer(dev, 1, (unsigned char*)&cmd, sizeof(cmd), &transferred, 0); if(res != 0 || transferred != sizeof(cmd)) { - LOG("Error: res: %d\ttransferred: %d (expected %d)\n",res, transferred, sizeof(cmd)); + LOG("Error: res: %d\ttransferred: %d (expected %lu)\n",res, transferred, sizeof(cmd)); goto cleanup; } res = get_first_reply(); // This first one doesn't have the usual magic bytes at the beginning, and is 96 bytes long - much longer than the usual 12-byte replies. @@ -179,7 +179,7 @@ int main(int argc, char** argv) { // Send it off! res = libusb_bulk_transfer(dev, 1, (unsigned char*)&cmd, sizeof(cmd), &transferred, 0); if(res != 0 || transferred != sizeof(cmd)) { - LOG("Error: res: %d\ttransferred: %d (expected %d)\n",res, transferred, sizeof(cmd)); + LOG("Error: res: %d\ttransferred: %d (expected %lu)\n",res, transferred, sizeof(cmd)); goto cleanup; } int bytes_sent = 0; @@ -205,7 +205,7 @@ int main(int argc, char** argv) { dump_bl_cmd(cmd); res = libusb_bulk_transfer(dev, 1, (unsigned char*)&cmd, sizeof(cmd), &transferred, 0); if(res != 0 || transferred != sizeof(cmd)) { - LOG("Error: res: %d\ttransferred: %d (expected %d)\n", res, transferred, sizeof(cmd)); + LOG("Error: res: %d\ttransferred: %d (expected %lu)\n", res, transferred, sizeof(cmd)); goto cleanup; } res = get_reply(); -- 2.1.4