diff options
-rw-r--r-- | lpg/libqr/code-parse.c | 4 | ||||
-rw-r--r-- | lpg/libqr/data-create.c | 20 | ||||
-rw-r--r-- | lpg/libqr/qrparse.c | 2 |
3 files changed, 15 insertions, 11 deletions
diff --git a/lpg/libqr/code-parse.c b/lpg/libqr/code-parse.c index 3fca4b2..a84df72 100644 --- a/lpg/libqr/code-parse.c +++ b/lpg/libqr/code-parse.c @@ -216,10 +216,10 @@ int qr_code_parse(const void * buffer, struct qr_code code; enum qr_ec_level ec; int mask; - struct qr_bitstream * data_bits; + struct qr_bitstream * data_bits = NULL; int status; - fprintf(stderr, "parsing code bitmap %lux%lu\n", line_bits, line_count); + fprintf(stderr, "parsing code bitmap %lux%lu\n", (unsigned long) line_bits, (unsigned long) line_count); if (line_bits != line_count || line_bits < 21 diff --git a/lpg/libqr/data-create.c b/lpg/libqr/data-create.c index 8ab127d..09d6653 100644 --- a/lpg/libqr/data-create.c +++ b/lpg/libqr/data-create.c @@ -19,7 +19,7 @@ static void write_type_and_length(struct qr_data * data, } static struct qr_data * encode_numeric(struct qr_data * data, - const char * input, + const unsigned char * input, size_t length) { struct qr_bitstream * stream = data->bits; @@ -92,7 +92,7 @@ static int get_alpha_code(char c) } static struct qr_data * encode_alpha(struct qr_data * data, - const char * input, + const unsigned char * input, size_t length) { struct qr_bitstream * stream = data->bits; @@ -135,7 +135,7 @@ static struct qr_data * encode_alpha(struct qr_data * data, } static struct qr_data * encode_8bit(struct qr_data * data, - const char * input, + const unsigned char * input, size_t length) { struct qr_bitstream * stream = data->bits; @@ -158,7 +158,7 @@ static struct qr_data * encode_8bit(struct qr_data * data, } static struct qr_data * encode_kanji(struct qr_data * data, - const char * input, + const unsigned char * input, size_t length) { return 0; @@ -213,13 +213,17 @@ struct qr_data * qr_data_create(int version, switch (type) { case QR_DATA_NUMERIC: - ret = encode_numeric(data, input, length); break; + ret = encode_numeric(data, (const unsigned char *) input, length); + break; case QR_DATA_ALPHA: - ret = encode_alpha(data, input, length); break; + ret = encode_alpha(data, (const unsigned char *) input, length); + break; case QR_DATA_8BIT: - ret = encode_8bit(data, input, length); break; + ret = encode_8bit(data, (const unsigned char *) input, length); + break; case QR_DATA_KANJI: - ret = encode_kanji(data, input, length); break; + ret = encode_kanji(data, (const unsigned char *) input, length); + break; default: /* unsupported / invalid */ ret = 0; diff --git a/lpg/libqr/qrparse.c b/lpg/libqr/qrparse.c index 013066b..1b5c80e 100644 --- a/lpg/libqr/qrparse.c +++ b/lpg/libqr/qrparse.c @@ -49,7 +49,7 @@ int main(int argc, char ** argv) case QR_DATA_FNC1: type_str = "FNC1"; break; default: type_str = "(unknown)"; break; } - fprintf(stderr, "Data type: %s; %lu bytes\nContent: %s\n", type_str, data_len, data_str); + fprintf(stderr, "Data type: %s; %lu bytes\nContent: %s\n", type_str, (unsigned long) data_len, data_str); free(data_str); qr_data_destroy(data); } |