all: Fixed all compiler warnings.

This commit is contained in:
Solomon Peachy 2013-11-23 19:51:55 -05:00
parent e79080796d
commit 9201105c66
8 changed files with 44 additions and 13 deletions

View File

@ -329,6 +329,8 @@ static void canonselphy_attach(void *vctx, struct libusb_device_handle *dev,
{
struct canonselphy_ctx *ctx = vctx;
UNUSED(jobid);
ctx->dev = dev;
ctx->endp_up = endp_up;
ctx->endp_down = endp_down;
@ -602,7 +604,7 @@ top:
struct dyesub_backend canonselphy_backend = {
.name = "Canon SELPHY CP/ES",
.version = "0.60",
.version = "0.61",
.uri_prefix = "canonselphy",
.init = canonselphy_init,
.attach = canonselphy_attach,

View File

@ -27,7 +27,7 @@
#include "backend_common.h"
#define BACKEND_VERSION "0.22"
#define BACKEND_VERSION "0.23"
#ifndef URI_PREFIX
#define URI_PREFIX "gutenprint+usb"
#endif
@ -109,6 +109,8 @@ int send_data(struct libusb_device_handle *dev, uint8_t endp,
int terminate = 0;
static void sigterm_handler(int signum) {
UNUSED(signum);
terminate = 1;
INFO("Job Cancelled");
}

View File

@ -78,6 +78,9 @@
#define cpu_to_be16 be16_to_cpu
#define cpu_to_be32 be32_to_cpu
/* To cheat the compiler */
#define UNUSED(expr) do { (void)(expr); } while (0)
/* To enumerate supported devices */
enum {
P_ANY = 0,

View File

@ -269,6 +269,8 @@ static void kodak1400_attach(void *vctx, struct libusb_device_handle *dev,
{
struct kodak1400_ctx *ctx = vctx;
UNUSED(jobid);
ctx->dev = dev;
ctx->endp_up = endp_up;
ctx->endp_down = endp_down;
@ -565,7 +567,7 @@ top:
struct dyesub_backend kodak1400_backend = {
.name = "Kodak 1400/805",
.version = "0.22",
.version = "0.23",
.uri_prefix = "kodak1400",
.cmdline_usage = kodak1400_cmdline,
.cmdline_arg = kodak1400_cmdline_arg,

View File

@ -98,6 +98,8 @@ static void kodak605_attach(void *vctx, struct libusb_device_handle *dev,
struct libusb_device *device;
struct libusb_device_descriptor desc;
UNUSED(jobid);
ctx->dev = dev;
ctx->endp_up = endp_up;
ctx->endp_down = endp_down;
@ -346,8 +348,8 @@ static int kodak605_get_status(struct kodak605_ctx *ctx)
READBACK_LEN,
&num,
5000);
if (ret < 0 || num < sizeof(rdbuf)) {
ERROR("Failure to receive data from printer (libusb error %d: (%d/%d from 0x%02x))\n", ret, num, sizeof(rdbuf), ctx->endp_up);
if (ret < 0 || num < (int)sizeof(rdbuf)) {
ERROR("Failure to receive data from printer (libusb error %d: (%d/%d from 0x%02x))\n", ret, num, (int)sizeof(rdbuf), ctx->endp_up);
if (ret < 0)
return ret;
return 4;
@ -384,8 +386,8 @@ static int kodak605_get_media(struct kodak605_ctx *ctx)
READBACK_LEN,
&num,
5000);
if (ret < 0 || num < sizeof(rdbuf)) {
ERROR("Failure to receive data from printer (libusb error %d: (%d/%d from 0x%02x))\n", ret, num, sizeof(rdbuf), ctx->endp_up);
if (ret < 0 || num < (int)sizeof(rdbuf)) {
ERROR("Failure to receive data from printer (libusb error %d: (%d/%d from 0x%02x))\n", ret, num, (int)sizeof(rdbuf), ctx->endp_up);
if (ret < 0)
return ret;
return 4;
@ -409,6 +411,8 @@ static int kodak605_cmdline_arg(void *vctx, int run, char *arg1, char *arg2)
{
struct kodak605_ctx *ctx = vctx;
UNUSED(arg2);
if (!run || !ctx)
return (!strcmp("-qs", arg1) ||
!strcmp("-qm", arg1) );
@ -424,7 +428,7 @@ static int kodak605_cmdline_arg(void *vctx, int run, char *arg1, char *arg2)
/* Exported */
struct dyesub_backend kodak605_backend = {
.name = "Kodak 605",
.version = "0.06",
.version = "0.07",
.uri_prefix = "kodak605",
.cmdline_usage = kodak605_cmdline,
.cmdline_arg = kodak605_cmdline_arg,
@ -479,7 +483,17 @@ struct dyesub_backend kodak605_backend = {
00 00 00 00 00 00 01 00 00 00 00 00
-> 02 00 00 00
<- [113 bytes -- supported media?? ]
<- [113 bytes -- supported media/sizes? Always seems to be identical ]
01 00 00 00 00 00 02 00 67 00 02 0b 04 01 34 07
d8 04 01 00 00 00 00 02 dc 05 34 08 01 00 00 00
00 03 34 07 82 09 01 00 00 00 00 04 34 07 ba 09
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00
-> 01 40 0a 00 01 01 00 34 07 d8 04 01 02 00 [[ unmodified header ]]
<- 01 00 00 00 00 00 XX 00 00 00 [[ Seen 0x01 and 0x02 ]
-> image data!

View File

@ -316,6 +316,8 @@ static void kodak6800_attach(void *vctx, struct libusb_device_handle *dev,
struct libusb_device *device;
struct libusb_device_descriptor desc;
UNUSED(jobid);
ctx->dev = dev;
ctx->endp_up = endp_up;
ctx->endp_down = endp_down;
@ -602,7 +604,7 @@ skip_query:
/* Exported */
struct dyesub_backend kodak6800_backend = {
.name = "Kodak 6800/6850",
.version = "0.22",
.version = "0.23",
.uri_prefix = "kodak6800",
.cmdline_usage = kodak6800_cmdline,
.cmdline_arg = kodak6800_cmdline_arg,

View File

@ -78,6 +78,8 @@ static void mitsu70x_attach(void *vctx, struct libusb_device_handle *dev,
struct libusb_device *device;
struct libusb_device_descriptor desc;
UNUSED(jobid);
ctx->dev = dev;
ctx->endp_up = endp_up;
ctx->endp_down = endp_down;
@ -294,7 +296,7 @@ static int mitsu70x_get_status(struct mitsu70x_ctx *ctx)
if ((ret = send_data(ctx->dev, ctx->endp_down,
cmdbuf, 4)))
return ret;
memset(&resp, 0, sizeof(&resp));
memset(&resp, 0, sizeof(resp));
ret = libusb_bulk_transfer(ctx->dev, ctx->endp_up,
(uint8_t*) &resp,
sizeof(resp),
@ -330,6 +332,8 @@ static int mitsu70x_cmdline_arg(void *vctx, int run, char *arg1, char *arg2)
{
struct mitsu70x_ctx *ctx = vctx;
UNUSED(arg2);
if (!run || !ctx)
return (!strcmp("-qs", arg1));
@ -343,7 +347,7 @@ static int mitsu70x_cmdline_arg(void *vctx, int run, char *arg1, char *arg2)
/* Exported */
struct dyesub_backend mitsu70x_backend = {
.name = "Mitsubishi CP-D70/D707",
.version = "0.04",
.version = "0.05",
.uri_prefix = "mitsu70x",
.cmdline_usage = mitsu70x_cmdline,
.cmdline_arg = mitsu70x_cmdline_arg,

View File

@ -61,6 +61,8 @@ static void updr150_attach(void *vctx, struct libusb_device_handle *dev,
{
struct updr150_ctx *ctx = vctx;
UNUSED(jobid);
ctx->dev = dev;
ctx->endp_up = endp_up;
ctx->endp_down = endp_down;
@ -163,7 +165,7 @@ top:
struct dyesub_backend updr150_backend = {
.name = "Sony UP-DR150",
.version = "0.05",
.version = "0.06",
.uri_prefix = "sonyupdr150",
.init = updr150_init,
.attach = updr150_attach,