aboutsummaryrefslogtreecommitdiff
path: root/lpg
diff options
context:
space:
mode:
authorLeo Howell <leo@lwh.jp>2009-10-08 16:48:51 +0900
committerLeo Howell <leo@lwh.jp>2009-10-08 16:48:51 +0900
commit5d9157331d8dd08010790bc9d17053bac279f524 (patch)
tree02239cb615b04de1a95211c179c74d7c86c32915 /lpg
parentce330147acca10cd66c370847bdc3e824a83a0c6 (diff)
downloadpdf-simple-sign-5d9157331d8dd08010790bc9d17053bac279f524.tar.gz
pdf-simple-sign-5d9157331d8dd08010790bc9d17053bac279f524.tar.xz
pdf-simple-sign-5d9157331d8dd08010790bc9d17053bac279f524.zip
debug output to stderr
Diffstat (limited to 'lpg')
-rw-r--r--lpg/libqr/code-create.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lpg/libqr/code-create.c b/lpg/libqr/code-create.c
index 9936981..2e0a0b2 100644
--- a/lpg/libqr/code-create.c
+++ b/lpg/libqr/code-create.c
@@ -39,13 +39,13 @@ static void x_dump(struct qr_bitstream * bits)
qr_bitstream_seek(bits, 0);
n = qr_bitstream_size(bits);
for (i = 0; i < n; ++i) {
- printf("%d", qr_bitstream_read(bits, 1));
+ fprintf(stderr, "%d", qr_bitstream_read(bits, 1));
if (i % 8 == 7)
- printf(" ");
+ fputc(' ', stderr);
if ((i+1) % (7 * 8) == 0)
- printf("\n");
+ fputc('\n', stderr);
}
- printf("\n");
+ fputc('\n', stderr);
}
static void setpx(struct qr_bitmap * bmp, int x, int y)
@@ -185,7 +185,7 @@ static struct qr_bitstream * make_data(int version,
if (pad_data(dcopy, data_words * 8) != 0)
goto fail;
- puts("Pad data:");
+ fputs("Pad data:\n", stderr);
x_dump(dcopy);
/* Make space for the RS blocks */
@@ -195,7 +195,7 @@ static struct qr_bitstream * make_data(int version,
/* Generate RS codewords */
qr_bitstream_seek(dcopy, 0);
- puts("Generate RS blocks:");
+ fputs("Generate RS blocks:\n", stderr);
for (i = 0; i < block_count; ++i) {
/* XXX: some blocks may be longer */
blocks[i] = rs_generate_words(dcopy, data_words, rs_words);
@@ -215,7 +215,7 @@ static struct qr_bitstream * make_data(int version,
qr_bitstream_cat(out, blocks[0]);
qr_bitstream_write(out, 0, total_bits - total_words * 8);
- puts("Final bitstream:");
+ fputs("Final bitstream:\n", stderr);
x_dump(out);
exit:
if (blocks) {
@@ -304,7 +304,7 @@ static int mask_data(struct qr_code * code)
return -1;
}
score = score_mask(test);
- printf("mask %d scored %d\n", i, score);
+ fprintf(stderr, "mask %d scored %d\n", i, score);
if (!mask || score < best) {
best = score;
selected = i;
@@ -314,7 +314,7 @@ static int mask_data(struct qr_code * code)
qr_bitmap_destroy(test);
}
}
- printf("Selected mask %d (%d)\n", selected, best);
+ fprintf(stderr, "Selected mask %d (%d)\n", selected, best);
qr_bitmap_destroy(code->modules);
code->modules = mask;