From: Antonio Ospite Date: Thu, 29 Sep 2011 21:09:48 +0000 (+0200) Subject: kinect_upload_fw: fix -Wformat warnings X-Git-Tag: v0.1~16 X-Git-Url: https://git.ao2.it/kinect-audio-setup.git/commitdiff_plain/34ca71a2b1057685e6406df71b167759d74b586e?hp=02e18316d400a4b4fcc26f2e180de5d521721f4d kinect_upload_fw: fix -Wformat warnings 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] --- 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();