summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-03-24 18:22:39 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-03-24 18:23:00 -0400
commit5116b74d4228f04e16e42b390aa4f2f1779b6cb0 (patch)
tree3512fe48b4c9cf9f841718642d046ea46e3ed517
parent7c1232887b7a5d6d5e2e2c765d7f6aa5e69700c4 (diff)
downloadselphy_print-5116b74d4228f04e16e42b390aa4f2f1779b6cb0.tar.gz
selphy_print-5116b74d4228f04e16e42b390aa4f2f1779b6cb0.tar.bz2
selphy_print-5116b74d4228f04e16e42b390aa4f2f1779b6cb0.zip
misc: Shut up a large pile of compile warnings with pedantic compilers
-rw-r--r--backend_canonselphy.c12
-rw-r--r--backend_canonselphyneo.c6
-rw-r--r--backend_common.c10
-rw-r--r--backend_common.h2
-rw-r--r--backend_dnpds40.c2
-rw-r--r--backend_hiti.c2
-rw-r--r--backend_kodak1400.c2
-rw-r--r--backend_kodak6800.c2
-rw-r--r--backend_magicard.c8
-rw-r--r--backend_mitsu.c2
-rw-r--r--backend_mitsu.h2
-rw-r--r--backend_mitsu70x.c12
-rw-r--r--backend_mitsu9550.c4
-rw-r--r--backend_mitsud90.c4
-rw-r--r--backend_shinkos1245.c6
-rw-r--r--backend_shinkos2145.c4
-rw-r--r--backend_shinkos6145.c2
-rw-r--r--backend_shinkos6245.c2
-rw-r--r--backend_sinfonia.c2
-rw-r--r--backend_sonyupd.c2
20 files changed, 42 insertions, 46 deletions
diff --git a/backend_canonselphy.c b/backend_canonselphy.c
index 807955d..3d4cd7e 100644
--- a/backend_canonselphy.c
+++ b/backend_canonselphy.c
@@ -67,7 +67,7 @@
struct printer_data {
int type; /* P_??? */
- char *model; /* eg "SELPHY ES1" */
+ const char *model; /* eg "SELPHY ES1" */
uint16_t init_length;
uint16_t foot_length;
int16_t init_readback[READBACK_LEN];
@@ -82,10 +82,10 @@ struct printer_data {
int8_t paper_code_offset; /* Offset in readback for paper type */
int8_t paper_code_offset2; /* Offset in readback for paper type (2nd) */
uint8_t (*error_detect)(uint8_t *rdbuf);
- char *(*pgcode_names)(uint8_t *rdbuf, struct printer_data *printer, int *numtype);
+ const char *(*pgcode_names)(uint8_t *rdbuf, struct printer_data *printer, int *numtype);
};
-static char *generic_pgcode_names(uint8_t *rdbuf, struct printer_data *printer, int *numtype)
+static const char *generic_pgcode_names(uint8_t *rdbuf, struct printer_data *printer, int *numtype)
{
uint8_t pgcode = 0, pgcode2 = 0;
@@ -226,7 +226,7 @@ static uint8_t cp790_error_detect(uint8_t *rdbuf)
return CUPS_BACKEND_OK;
}
-static char *cp10_pgcode_names(uint8_t *rdbuf, struct printer_data *printer, int *numtype)
+static const char *cp10_pgcode_names(uint8_t *rdbuf, struct printer_data *printer, int *numtype)
{
UNUSED(rdbuf);
UNUSED(printer);
@@ -605,8 +605,6 @@ static void *canonselphy_init(void)
return ctx;
}
-extern struct dyesub_backend canonselphy_backend;
-
static int canonselphy_attach(void *vctx, struct libusb_device_handle *dev, int type,
uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid)
{
@@ -682,7 +680,7 @@ static void canonselphy_cleanup_job(const void *vjob) {
if (job->footer)
free(job->footer);
- free((void*)job);
+ free((void*)vjob);
}
static int canonselphy_read_parse(void *vctx, const void **vjob, int data_fd, int copies)
diff --git a/backend_canonselphyneo.c b/backend_canonselphyneo.c
index df18e5c..b5175c0 100644
--- a/backend_canonselphyneo.c
+++ b/backend_canonselphyneo.c
@@ -65,7 +65,7 @@ struct selphyneo_ctx {
struct marker marker;
};
-static char *selphyneo_statuses(uint8_t sts)
+static const char *selphyneo_statuses(uint8_t sts)
{
switch(sts) {
case 0x01:
@@ -85,7 +85,7 @@ static char *selphyneo_statuses(uint8_t sts)
}
}
-static char *selphyneo_errors(uint8_t err)
+static const char *selphyneo_errors(uint8_t err)
{
switch(err) {
case 0x00:
@@ -111,7 +111,7 @@ static char *selphyneo_errors(uint8_t err)
}
}
-static char *selphynew_pgcodes(uint8_t type) {
+static const char *selphynew_pgcodes(uint8_t type) {
switch (type & 0xf) {
case 0x01:
diff --git a/backend_common.c b/backend_common.c
index 03d7e51..481bff0 100644
--- a/backend_common.c
+++ b/backend_common.c
@@ -1072,7 +1072,7 @@ void print_help(const char *argv0, const struct dyesub_backend *backend)
libusb_free_device_list(list, 1);
}
-int parse_cmdstream(struct dyesub_backend *backend, void *backend_ctx, int fd)
+static int parse_cmdstream(struct dyesub_backend *backend, void *backend_ctx, int fd)
{
FILE *fp = stdin;
char line[128];
@@ -1110,10 +1110,10 @@ int parse_cmdstream(struct dyesub_backend *backend, void *backend_ctx, int fd)
fclose(fp);
return CUPS_BACKEND_OK;
-};
+}
static int handle_input(struct dyesub_backend *backend, void *backend_ctx,
- char *fname, char *uri, char *type)
+ const char *fname, char *uri, char *type)
{
int ret = CUPS_BACKEND_OK;
#ifndef _WIN32
@@ -1265,7 +1265,7 @@ int main (int argc, char **argv)
int stats_only = 0;
char *uri;
char *type;
- char *fname = NULL;
+ const char *fname = NULL;
char *use_serno = NULL;
const char *backend_str = NULL;
int printer_type;
@@ -1777,7 +1777,7 @@ static int __dyesub_joblist_addjob(struct dyesub_joblist *list, const void *job)
list->entries[list->num_entries++] = job;
return CUPS_BACKEND_OK;
-};
+}
static int __dyesub_append_job(struct dyesub_joblist *list, const void **vjob, int polarity)
{
diff --git a/backend_common.h b/backend_common.h
index 9ff4a92..9f1d87b 100644
--- a/backend_common.h
+++ b/backend_common.h
@@ -189,7 +189,7 @@ struct printerstats {
const char *fwver; /* Firmware Version */
uint8_t decks; /* Number of "decks" (1 or 2) */
- char *name[DECKS_MAX]; /* Name */
+ const char *name[DECKS_MAX]; /* Name */
char *status[DECKS_MAX]; /* Status (dynamic) */
const char *mediatype[DECKS_MAX]; /* Media Type */
int32_t levelmax[DECKS_MAX]; /* Max media count (-1 if unknown) */
diff --git a/backend_dnpds40.c b/backend_dnpds40.c
index 455116b..598a522 100644
--- a/backend_dnpds40.c
+++ b/backend_dnpds40.c
@@ -383,7 +383,7 @@ done:
#undef JOB_EQUIV
-static void dnpds40_build_cmd(struct dnpds40_cmd *cmd, char *arg1, char *arg2, uint32_t arg3_len)
+static void dnpds40_build_cmd(struct dnpds40_cmd *cmd, const char *arg1, const char *arg2, uint32_t arg3_len)
{
memset(cmd, 0x20, sizeof(*cmd));
cmd->esc = 0x1b;
diff --git a/backend_hiti.c b/backend_hiti.c
index 2e65c20..1aab479 100644
--- a/backend_hiti.c
+++ b/backend_hiti.c
@@ -891,8 +891,6 @@ static void *hiti_init(void)
return ctx;
}
-extern struct dyesub_backend hiti_backend;
-
static int hiti_attach(void *vctx, struct libusb_device_handle *dev, int type,
uint8_t endp_up, uint8_t endp_down, int iface, uint8_t jobid)
{
diff --git a/backend_kodak1400.c b/backend_kodak1400.c
index 4e69411..940113a 100644
--- a/backend_kodak1400.c
+++ b/backend_kodak1400.c
@@ -246,7 +246,7 @@ static void kodak1400_cmdline(void)
DEBUG("\t\t[ -C filename ] # Set tone curve\n");
}
-int kodak1400_cmdline_arg(void *vctx, int argc, char **argv)
+static int kodak1400_cmdline_arg(void *vctx, int argc, char **argv)
{
struct kodak1400_ctx *ctx = vctx;
int i, j = 0;
diff --git a/backend_kodak6800.c b/backend_kodak6800.c
index e36cd36..622247e 100644
--- a/backend_kodak6800.c
+++ b/backend_kodak6800.c
@@ -267,7 +267,7 @@ static int kodak68x0_reset(struct kodak6800_ctx *ctx)
static void kodak68x0_dump_status(struct kodak6800_ctx *ctx, struct kodak68x0_status_readback *status)
{
- char *detail;
+ const char *detail;
switch (status->status) {
case STATUS_PRINTING:
diff --git a/backend_magicard.c b/backend_magicard.c
index b3b0d39..ea40146 100644
--- a/backend_magicard.c
+++ b/backend_magicard.c
@@ -138,8 +138,8 @@ struct magicard_resp_header {
};
struct magicard_requests {
- char *key;
- char *desc;
+ const char *key;
+ const char *desc;
uint8_t type;
};
@@ -198,7 +198,7 @@ static struct magicard_requests magicard_sta_requests[] = {
/* Helper functions */
static int magicard_build_cmd(uint8_t *buf,
- char *cmd, char *subcmd, char *arg)
+ const char *cmd, const char *subcmd, const char *arg)
{
struct magicard_cmd_header *hdr = (struct magicard_cmd_header *) buf;
@@ -217,7 +217,7 @@ static int magicard_build_cmd(uint8_t *buf,
}
static int magicard_build_cmd_simple(uint8_t *buf,
- char *cmd)
+ const char *cmd)
{
struct magicard_cmd_simple_header *hdr = (struct magicard_cmd_simple_header *) buf;
int len = strlen(cmd);
diff --git a/backend_mitsu.c b/backend_mitsu.c
index 41d1a58..af71e2d 100644
--- a/backend_mitsu.c
+++ b/backend_mitsu.c
@@ -140,7 +140,7 @@ int mitsu_destroylib(struct mitsu_lib *lib)
return CUPS_BACKEND_OK;
}
-int mitsu_apply3dlut(struct mitsu_lib *lib, char *lutfname, uint8_t *databuf,
+int mitsu_apply3dlut(struct mitsu_lib *lib, const char *lutfname, uint8_t *databuf,
uint16_t cols, uint16_t rows, uint16_t stride,
int rgb_bgr)
{
diff --git a/backend_mitsu.h b/backend_mitsu.h
index ab633e1..4ad45f2 100644
--- a/backend_mitsu.h
+++ b/backend_mitsu.h
@@ -121,7 +121,7 @@ struct mitsu_lib {
int mitsu_loadlib(struct mitsu_lib *lib, int type);
int mitsu_destroylib(struct mitsu_lib *lib);
-int mitsu_apply3dlut(struct mitsu_lib *lib, char *lutfname, uint8_t *databuf,
+int mitsu_apply3dlut(struct mitsu_lib *lib, const char *lutfname, uint8_t *databuf,
uint16_t cols, uint16_t rows, uint16_t stride,
int rgb_bgr);
int mitsu_readlamdata(const char *fname, uint16_t lamstride,
diff --git a/backend_mitsu70x.c b/backend_mitsu70x.c
index ca92ec1..00e0cdc 100644
--- a/backend_mitsu70x.c
+++ b/backend_mitsu70x.c
@@ -69,10 +69,10 @@ struct mitsu70x_printjob {
int sharpen; /* ie mhdr.sharpen - 1 */
int reverse;
- char *laminatefname;
- char *lutfname;
- char *cpcfname;
- char *ecpcfname;
+ const char *laminatefname;
+ const char *lutfname;
+ const char *cpcfname;
+ const char *ecpcfname;
};
struct mitsu70x_ctx {
@@ -95,8 +95,8 @@ struct mitsu70x_ctx {
struct mitsu_lib lib;
- char *last_cpcfname;
- char *last_ecpcfname;
+ const char *last_cpcfname;
+ const char *last_ecpcfname;
struct BandImage output;
};
diff --git a/backend_mitsu9550.c b/backend_mitsu9550.c
index 32572c0..8d67397 100644
--- a/backend_mitsu9550.c
+++ b/backend_mitsu9550.c
@@ -260,7 +260,7 @@ static int mitsu98xx_fillmatte(struct mitsu9550_printjob *job)
}
static int mitsu9550_get_status(struct mitsu9550_ctx *ctx, uint8_t *resp, int status, int status2, int media);
-static char *mitsu9550_media_types(uint8_t type, uint8_t is_s);
+static const char *mitsu9550_media_types(uint8_t type, uint8_t is_s);
static void *mitsu9550_init(void)
{
@@ -660,7 +660,7 @@ static int mitsu9550_get_status(struct mitsu9550_ctx *ctx, uint8_t *resp, int st
return CUPS_BACKEND_OK;
}
-static char *mitsu9550_media_types(uint8_t type, uint8_t is_s)
+static const char *mitsu9550_media_types(uint8_t type, uint8_t is_s)
{
if (is_s) {
switch (type & 0xf) { /* values can be 0x0? or 0x4? */
diff --git a/backend_mitsud90.c b/backend_mitsud90.c
index 7e04992..71b7931 100644
--- a/backend_mitsud90.c
+++ b/backend_mitsud90.c
@@ -242,7 +242,7 @@ struct mitsud90_memcheck_resp {
uint8_t mem_bad; /* 0x00 is ok */
} __attribute__((packed));
-const char *mitsud90_mecha_statuses(const uint8_t *code)
+static const char *mitsud90_mecha_statuses(const uint8_t *code)
{
switch (code[0]) {
case D90_MECHA_STATUS_IDLE:
@@ -279,7 +279,7 @@ const char *mitsud90_mecha_statuses(const uint8_t *code)
}
}
-const char *mitsud90_error_codes(const uint8_t *code)
+static const char *mitsud90_error_codes(const uint8_t *code)
{
switch(code[0]) {
case D90_ERROR_STATUS_OK:
diff --git a/backend_shinkos1245.c b/backend_shinkos1245.c
index 14c13a0..221d3b6 100644
--- a/backend_shinkos1245.c
+++ b/backend_shinkos1245.c
@@ -514,7 +514,7 @@ static int shinkos1245_get_matte(struct shinkos1245_ctx *ctx,
return CUPS_BACKEND_OK;
}
-static char* shinkos1245_tonecurves(int type, int table)
+static const char* shinkos1245_tonecurves(int type, int table)
{
switch (type) {
case TONE_TABLE_STANDARD:
@@ -552,7 +552,7 @@ static char* shinkos1245_tonecurves(int type, int table)
static void shinkos1245_dump_status(struct shinkos1245_ctx *ctx,
struct shinkos1245_resp_status *sts)
{
- char *detail;
+ const char *detail;
switch (sts->print_status) {
case STATUS_PRINTING:
detail = "Printing";
@@ -859,7 +859,7 @@ static void shinkos1245_cmdline(void)
DEBUG("\t\t[ -L filename ] # Set current tone curve\n");
}
-int shinkos1245_cmdline_arg(void *vctx, int argc, char **argv)
+static int shinkos1245_cmdline_arg(void *vctx, int argc, char **argv)
{
struct shinkos1245_ctx *ctx = vctx;
int i, j = 0;
diff --git a/backend_shinkos2145.c b/backend_shinkos2145.c
index a81a23b..0b35197 100644
--- a/backend_shinkos2145.c
+++ b/backend_shinkos2145.c
@@ -110,7 +110,7 @@ struct s2145_readtone_cmd {
#define FWINFO_TARGET_USB_APP 0x06
#define FWINFO_TARGET_TABLES 0x07
-static char *fwinfo_targets (uint8_t v) {
+static const char *fwinfo_targets (uint8_t v) {
switch (v) {
case FWINFO_TARGET_MAIN_BOOT:
return "Main Boot";
@@ -745,7 +745,7 @@ static void shinkos2145_cmdline(void)
DEBUG("\t\t[ -X jobid ] # Abort a printjob\n");
}
-int shinkos2145_cmdline_arg(void *vctx, int argc, char **argv)
+static int shinkos2145_cmdline_arg(void *vctx, int argc, char **argv)
{
struct shinkos2145_ctx *ctx = vctx;
int i, j = 0;
diff --git a/backend_shinkos6145.c b/backend_shinkos6145.c
index 5939a34..6b60424 100644
--- a/backend_shinkos6145.c
+++ b/backend_shinkos6145.c
@@ -860,7 +860,7 @@ static void shinkos6145_cmdline(void)
// DEBUG("\t\t[ -Z ] # Dump all parameters\n");
}
-int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
+static int shinkos6145_cmdline_arg(void *vctx, int argc, char **argv)
{
struct shinkos6145_ctx *ctx = vctx;
int i, j = 0;
diff --git a/backend_shinkos6245.c b/backend_shinkos6245.c
index e1bd758..1a1c267 100644
--- a/backend_shinkos6245.c
+++ b/backend_shinkos6245.c
@@ -865,7 +865,7 @@ static void shinkos6245_cmdline(void)
// DEBUG("\t\t[ -Z ] # Dump all parameters\n");
}
-int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
+static int shinkos6245_cmdline_arg(void *vctx, int argc, char **argv)
{
struct shinkos6245_ctx *ctx = vctx;
int i, j = 0;
diff --git a/backend_sinfonia.c b/backend_sinfonia.c
index 9c3aaa3..33076e1 100644
--- a/backend_sinfonia.c
+++ b/backend_sinfonia.c
@@ -769,7 +769,7 @@ int sinfonia_query_media(struct sinfonia_usbdev *dev,
return CUPS_BACKEND_OK;
}
-const char *dummy_error_codes(uint8_t major, uint8_t minor)
+static const char *dummy_error_codes(uint8_t major, uint8_t minor)
{
UNUSED(major);
UNUSED(minor);
diff --git a/backend_sonyupd.c b/backend_sonyupd.c
index 10478d5..e7e693b 100644
--- a/backend_sonyupd.c
+++ b/backend_sonyupd.c
@@ -151,7 +151,7 @@ static void upd_cleanup_job(const void *vjob)
// total prints (lifetime)
// f/w version
-static char* upd895_statuses(uint8_t code)
+static const char* upd895_statuses(uint8_t code)
{
switch (code) {
case UPD_STS1_IDLE: