jbig2dec
Ralph Giles <[email protected]> Thu, 15 Aug 2002 07:54:48 -0700
| Newsgroups | gmane.comp.printing.ghostscript.jbig2dec.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jbig2dec/jbig2dec
In directory usw-pr-cvs1:/tmp/cvs-serv9816
Modified Files:
jbig2_image.c jbig2_image_pbm.c jbig2_mmr.c jbig2_page.c
jbig2_symbol_dict.c jbig2_text.c jbig2dec.c
Log Message:
Remove //-style comments for the benifit of those not using gcc.
Index: jbig2_image.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_image.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- jbig2_image.c 20 Jul 2002 17:23:15 -0000 1.19
+++ jbig2_image.c 15 Aug 2002 14:54:45 -0000 1.20
@@ -83,7 +83,7 @@
w = src->width;
h = src->height;
ss = src->data;
- // FIXME: this isn't sufficient for the < 0 cases
+ /* FIXME: this isn't sufficient for the < 0 cases */
if (x < 0) { w += x; x = 0; }
if (y < 0) { h += y; y = 0; }
w = (x + w < dst->width) ? w : dst->width - x;
Index: jbig2_image_pbm.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_image_pbm.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- jbig2_image_pbm.c 14 Aug 2002 11:44:53 -0000 1.11
+++ jbig2_image_pbm.c 15 Aug 2002 14:54:45 -0000 1.12
@@ -72,7 +72,7 @@
return (image);
}
-// FIXME: should handle multi-image files
+/* FIXME: should handle multi-image files */
Jbig2Image *jbig2_image_read_pbm(Jbig2Ctx *ctx, FILE *in)
{
int i, dim[2];
Index: jbig2_mmr.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_mmr.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- jbig2_mmr.c 5 Aug 2002 23:07:54 -0000 1.10
+++ jbig2_mmr.c 15 Aug 2002 14:54:45 -0000 1.11
@@ -736,7 +736,7 @@
while (1)
{
uint32_t word = mmr->word;
- //printf ("%08x\n", word);
+ /* printf ("%08x\n", word); */
if ((word >> (32 - 3)) == 1)
{
int white_run, black_run;
@@ -744,46 +744,46 @@
jbig2_decode_mmr_consume(mmr, 3);
white_run = jbig2_decode_get_run(mmr, cf_white_decode, 8);
black_run = jbig2_decode_get_run(mmr, cf_black_decode, 7);
- //printf ("H %d %d\n", white_run, black_run);
+ /* printf ("H %d %d\n", white_run, black_run); */
}
else if ((word >> (32 - 4)) == 1)
{
- //printf ("P\n");
+ /* printf ("P\n"); */
jbig2_decode_mmr_consume(mmr, 3);
}
else if ((word >> (32 - 1)) == 1)
{
- //printf ("V(0)\n");
+ /* printf ("V(0)\n"); */
jbig2_decode_mmr_consume(mmr, 1);
}
else if ((word >> (32 - 3)) == 3)
{
- //printf ("VR(1)\n");
+ /* printf ("VR(1)\n"); */
jbig2_decode_mmr_consume(mmr, 3);
}
else if ((word >> (32 - 6)) == 3)
{
- //printf ("VR(2)\n");
+ /* printf ("VR(2)\n"); */
jbig2_decode_mmr_consume(mmr, 6);
}
else if ((word >> (32 - 7)) == 3)
{
- //printf ("VR(3)\n");
+ /* printf ("VR(3)\n"); */
jbig2_decode_mmr_consume(mmr, 7);
}
else if ((word >> (32 - 3)) == 2)
{
- //printf ("VL(1)\n");
+ /* printf ("VL(1)\n"); */
jbig2_decode_mmr_consume(mmr, 3);
}
else if ((word >> (32 - 6)) == 2)
{
- //printf ("VL(2)\n");
+ /* printf ("VL(2)\n"); */
jbig2_decode_mmr_consume(mmr, 6);
}
else if ((word >> (32 - 7)) == 2)
{
- //printf ("VL(3)\n");
+ /* printf ("VL(3)\n"); */
jbig2_decode_mmr_consume(mmr, 7);
}
else
Index: jbig2_page.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_page.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- jbig2_page.c 5 Aug 2002 22:46:00 -0000 1.14
+++ jbig2_page.c 15 Aug 2002 14:54:45 -0000 1.15
@@ -77,7 +77,7 @@
index = ctx->current_page;
while (ctx->pages[index].state != JBIG2_PAGE_FREE) {
index++;
- if (index >= ctx->max_page_index) { // FIXME: should also look for freed pages?
+ if (index >= ctx->max_page_index) { /* FIXME: should also look for freed pages? */
/* grow the list */
jbig2_realloc(ctx->allocator, ctx->pages, (ctx->max_page_index <<= 2) * sizeof(Jbig2Page));
for (j=index; j < ctx->max_page_index; j++) {
@@ -95,7 +95,7 @@
page->number = segment->page_association;
}
- // FIXME: would be nice if we tried to work around this
+ /* FIXME: would be nice if we tried to work around this */
if (segment->data_length < 19) {
return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
"segment too short");
Index: jbig2_symbol_dict.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_symbol_dict.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- jbig2_symbol_dict.c 20 Jul 2002 17:23:15 -0000 1.18
+++ jbig2_symbol_dict.c 15 Aug 2002 14:54:45 -0000 1.19
@@ -47,7 +47,7 @@
/* SDHUFFBMSIZE */
/* SDHUFFAGGINST */
int SDTEMPLATE;
- int8_t sdat[8]; // FIXME: do these need to be explicitly signed?
+ int8_t sdat[8];
bool SDRTEMPLATE;
int8_t sdrat[4];
} Jbig2SymbolDictParams;
@@ -62,7 +62,11 @@
fprintf(stderr, "dumping symbol dict as %d individual png files\n", dict->n_symbols);
for (index = 0; index < dict->n_symbols; index++) {
snprintf(filename, sizeof(filename), "symbol_%04d.png", index);
+#ifdef HAVE_LIBPNG
jbig2_image_write_png_file(dict->glyphs[index], filename);
+#else
+ jbig2_image_write_pbm_file(dict->glyphs[index], filename);
+#endif
}
}
#endif /* HAVE_LIBPNG */
@@ -296,8 +300,8 @@
segment_data + offset,
segment->data_length - offset,
GB_stats);
-#ifdef HAVE_LIBPNG
-// jbig2_dump_symbol_dict(segment->result);
+#ifdef DEBUG
+ jbig2_dump_symbol_dict(segment->result);
#endif
return 0;
Index: jbig2_text.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_text.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- jbig2_text.c 10 Aug 2002 10:39:20 -0000 1.19
+++ jbig2_text.c 15 Aug 2002 14:54:45 -0000 1.20
@@ -233,7 +233,7 @@
/* (3c.viii) */
if (!params->TRANSPOSED) {
- switch (params->REFCORNER) { // FIXME: double check offsets
+ switch (params->REFCORNER) { /* FIXME: double check offsets */
case JBIG2_CORNER_TOPLEFT: x = S; y = T; break;
case JBIG2_CORNER_TOPRIGHT: x = S - IB->width + 1; y = T; break;
case JBIG2_CORNER_BOTTOMLEFT: x = S; y = T - IB->height + 1; break;
@@ -280,7 +280,7 @@
{
int index, index_max = ctx->segment_index;
- // FIXME: binary search would be better?
+ /* FIXME: binary search would be better? */
for (index = index_max; index >= 0; index--)
if (ctx->segments[index]->number == number)
return (ctx->segments[index]);
Index: jbig2dec.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2dec.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- jbig2dec.c 15 Aug 2002 13:52:28 -0000 1.40
+++ jbig2dec.c 15 Aug 2002 14:54:45 -0000 1.41
@@ -111,9 +111,8 @@
"Vh?qvdo:t:", long_options, &option_idx);
if (option == -1) break;
- //fprintf(stderr, "option '%c' value '%s'\n", option, optarg);
switch (option) {
- case 0: // unknown long option
+ case 0: /* unknown long option */
if (!params->verbose) fprintf(stdout,
"unrecognized option: --%s\n",
long_options[option_idx].name);
@@ -324,7 +323,7 @@
jbig2dec_params_t params;
int filearg;
- // set defaults
+ /* set defaults */
params.mode = render;
params.verbose = 1;
params.hash = 0;
@@ -345,7 +344,7 @@
case render:
if ((argc - filearg) == 1)
- // only one argument--open as a jbig2 file
+ /* only one argument--open as a jbig2 file */
{
char *fn = argv[filearg];
@@ -357,7 +356,7 @@
}
}
else if ((argc - filearg) == 2)
- // two arguments open as separate global and page streams
+ /* two arguments open as separate global and page streams */
{
char *fn = argv[filearg];
char *fn_page = argv[filearg+1];
@@ -377,14 +376,14 @@
}
}
else
- // any other number of arguments
+ /* any other number of arguments */
return print_usage();
ctx = jbig2_ctx_new(NULL, f_page != NULL ? JBIG2_OPTIONS_EMBEDDED : 0,
NULL,
error_callback, ¶ms);
- // pull the whole file/global stream into memory
+ /* pull the whole file/global stream into memory */
for (;;)
{
int n_bytes = fread(buf, 1, sizeof(buf), f);
@@ -394,7 +393,7 @@
}
fclose(f);
- // if there's a local page stream read that in its entirety
+ /* if there's a local page stream read that in its entirety */
if (f_page != NULL)
{
Jbig2GlobalCtx *global_ctx = jbig2_make_global_ctx(ctx);
@@ -411,7 +410,7 @@
jbig2_global_ctx_free(global_ctx);
}
- // retrieve and output the returned pages
+ /* retrieve and output the returned pages */
{
Jbig2Image *image;
@@ -443,6 +442,6 @@
if (params.hash) hash_free(¶ms);
- // fin
+ /* fin */
return 0;
}