all: Clean up a small pile of warnings that clang-analyzer found.
This commit is contained in:
parent
65d1c5461d
commit
2181ae04b9
4
Makefile
4
Makefile
|
@ -1,6 +1,8 @@
|
|||
BACKEND_NAME = gutenprint52+usb
|
||||
EXEC_NAME = dyesub_backend
|
||||
|
||||
# CC ?= gcc
|
||||
|
||||
CFLAGS = -Wall -Wextra -g -Os
|
||||
LDFLAGS = `pkg-config --libs libusb-1.0`
|
||||
CPPFLAGS = `pkg-config --cflags libusb-1.0`
|
||||
|
@ -19,7 +21,7 @@ SOURCES = backend_common.c $(addsuffix .c,$(addprefix backend_,$(BACKENDS)))
|
|||
all: $(EXEC_NAME) $(BACKENDS)
|
||||
|
||||
$(EXEC_NAME): $(SOURCES) $(DEPS)
|
||||
gcc -o $@ $(SOURCES) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -DURI_PREFIX=\"$(BACKEND_NAME)\"
|
||||
$(CC) -o $@ $(SOURCES) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) -DURI_PREFIX=\"$(BACKEND_NAME)\"
|
||||
|
||||
$(BACKENDS): $(EXEC_NAME)
|
||||
ln -sf $(EXEC_NAME) $@
|
||||
|
|
|
@ -498,7 +498,7 @@ top:
|
|||
ptr + SPOOL_PLANE_HDR_LEN, ctx->hdr.plane_len - SPOOL_PLANE_HDR_LEN)))
|
||||
return CUPS_BACKEND_FAILED;
|
||||
|
||||
ptr += ctx->hdr.plane_len;
|
||||
/* ptr += ctx->hdr.plane_len; */
|
||||
|
||||
/* Start print */
|
||||
cw01_build_cmd(&cmd, "CNTRL", "START", 0);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "backend_common.h"
|
||||
|
||||
#define BACKEND_VERSION "0.56"
|
||||
#define BACKEND_VERSION "0.57"
|
||||
#ifndef URI_PREFIX
|
||||
#error "Must Define URI_PREFIX"
|
||||
#endif
|
||||
|
@ -431,6 +431,10 @@ static int print_scan_output(struct libusb_device *device,
|
|||
descr = malloc(256);
|
||||
if (!descr) {
|
||||
ERROR("Memory allocation failure (%d bytes)\n", 256);
|
||||
if (manuf3)
|
||||
free(manuf3);
|
||||
if (product2)
|
||||
free(product2);
|
||||
return found;
|
||||
}
|
||||
|
||||
|
@ -562,7 +566,7 @@ static int find_and_enumerate(struct libusb_context *ctx,
|
|||
int scan_only)
|
||||
{
|
||||
int num;
|
||||
int i, j, k;
|
||||
int i, j = 0, k;
|
||||
int found = -1;
|
||||
|
||||
/* Enumerate and find suitable device */
|
||||
|
@ -876,7 +880,7 @@ int main (int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
i &= ~O_NONBLOCK;
|
||||
i = fcntl(data_fd, F_SETFL, 0);
|
||||
i = fcntl(data_fd, F_SETFL, i);
|
||||
if (i < 0) {
|
||||
perror("ERROR:Can't open input");
|
||||
exit(1);
|
||||
|
|
|
@ -343,7 +343,7 @@ static void dnpds40_attach(void *vctx, struct libusb_device_handle *dev,
|
|||
ctx->version = strdup((char*) resp);
|
||||
|
||||
/* Parse version */
|
||||
ptr = strtok((char*)resp, " .");
|
||||
/* ptr = */ strtok((char*)resp, " .");
|
||||
ptr = strtok(NULL, ".");
|
||||
ctx->ver_major = atoi(ptr);
|
||||
ptr = strtok(NULL, ".");
|
||||
|
@ -843,7 +843,7 @@ static int dnpds40_main_loop(void *vctx, int copies) {
|
|||
if (ctx->supports_matte) {
|
||||
snprintf(buf, sizeof(buf), "%08d", 1);
|
||||
if (ctx->buffctrl_offset) {
|
||||
memcpy(ctx->qty_offset, buf, 8);
|
||||
memcpy(ctx->buffctrl_offset, buf, 8);
|
||||
} else {
|
||||
dnpds40_build_cmd(&cmd, "CNTRL", "BUFFCNTRL", 8);
|
||||
if ((ret = dnpds40_do_cmd(ctx, &cmd, (uint8_t*)buf, 8)))
|
||||
|
@ -897,7 +897,6 @@ top:
|
|||
return CUPS_BACKEND_FAILED;
|
||||
dnpds40_cleanup_string((char*)resp, len);
|
||||
status = atoi((char*)resp);
|
||||
free(resp);
|
||||
|
||||
/* Figure out what's going on */
|
||||
switch(status) {
|
||||
|
@ -907,6 +906,7 @@ top:
|
|||
{
|
||||
int bufs;
|
||||
|
||||
if (resp) free(resp);
|
||||
/* Query buffer state */
|
||||
dnpds40_build_cmd(&cmd, "INFO", "FREE_PBUFFER", 0);
|
||||
resp = dnpds40_resp_cmd(ctx, &cmd, &len);
|
||||
|
@ -1621,6 +1621,7 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv)
|
|||
break;
|
||||
}
|
||||
j = dnpds620_standby_mode(ctx, time);
|
||||
break;
|
||||
}
|
||||
return 2;
|
||||
case 'K':
|
||||
|
@ -1637,6 +1638,7 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv)
|
|||
break;
|
||||
}
|
||||
j = dnpds620_media_keep_mode(ctx, keep);
|
||||
break;
|
||||
}
|
||||
return 2;
|
||||
default:
|
||||
|
@ -1652,7 +1654,7 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv)
|
|||
/* Exported */
|
||||
struct dyesub_backend dnpds40_backend = {
|
||||
.name = "DNP DS40/DS80/DSRX1/DS620",
|
||||
.version = "0.52",
|
||||
.version = "0.53",
|
||||
.uri_prefix = "dnpds40",
|
||||
.cmdline_usage = dnpds40_cmdline,
|
||||
.cmdline_arg = dnpds40_cmdline_arg,
|
||||
|
|
|
@ -371,7 +371,7 @@ static int kodak6800_get_tonecurve(struct kodak6800_ctx *ctx, char *fname)
|
|||
/* We're done */
|
||||
free(data);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int kodak6800_set_tonecurve(struct kodak6800_ctx *ctx, char *fname)
|
||||
|
|
|
@ -539,7 +539,7 @@ static int mitsu70x_query_status(struct mitsu70x_ctx *ctx)
|
|||
static int mitsu70x_query_serno(struct libusb_device_handle *dev, uint8_t endp_up, uint8_t endp_down, char *buf, int buf_len)
|
||||
{
|
||||
int ret, i;
|
||||
struct mitsu70x_status_resp resp;
|
||||
struct mitsu70x_status_resp resp = { 0 };
|
||||
|
||||
struct mitsu70x_ctx ctx = {
|
||||
.dev = dev,
|
||||
|
|
|
@ -1134,7 +1134,7 @@ static int get_tonecurve(struct shinkos2145_ctx *ctx, int type, char *fname)
|
|||
int ret, num = 0;
|
||||
|
||||
uint8_t *data;
|
||||
uint16_t curves[UPDATE_SIZE];
|
||||
uint16_t curves[UPDATE_SIZE] = { 0 } ;
|
||||
|
||||
int i,j;
|
||||
|
||||
|
@ -1159,6 +1159,7 @@ static int get_tonecurve(struct shinkos2145_ctx *ctx, int type, char *fname)
|
|||
if (!data) {
|
||||
ERROR("Memory allocation failure! (%d bytes)\n",
|
||||
resp->total_size * 2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
|
@ -1213,6 +1214,7 @@ static int set_tonecurve(struct shinkos2145_ctx *ctx, int target, char *fname)
|
|||
if (!data) {
|
||||
ERROR("Memory allocation failure! (%d bytes)\n",
|
||||
UPDATE_SIZE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Read in file */
|
||||
|
@ -1740,7 +1742,7 @@ static int shinkos2145_query_serno(struct libusb_device_handle *dev, uint8_t end
|
|||
|
||||
struct dyesub_backend shinkos2145_backend = {
|
||||
.name = "Shinko/Sinfonia CHC-S2145",
|
||||
.version = "0.42",
|
||||
.version = "0.43",
|
||||
.uri_prefix = "shinkos2145",
|
||||
.cmdline_usage = shinkos2145_cmdline,
|
||||
.cmdline_arg = shinkos2145_cmdline_arg,
|
||||
|
|
Loading…
Reference in a new issue