diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-20 18:10:56 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-20 18:10:56 +0000 |
commit | 5e96ff9268ee6c42a5265975a1657f4d20f21b5f (patch) | |
tree | 639aaf751e08a030ef7c2ebd55d77a2b46c9c868 /other | |
parent | 553be9f71998e872838769b1a9be6972ab8ccb8e (diff) | |
download | netpbm-mirror-5e96ff9268ee6c42a5265975a1657f4d20f21b5f.tar.gz netpbm-mirror-5e96ff9268ee6c42a5265975a1657f4d20f21b5f.tar.xz netpbm-mirror-5e96ff9268ee6c42a5265975a1657f4d20f21b5f.zip |
whitespace
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4673 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other')
-rw-r--r-- | other/pamchannel.c | 36 | ||||
-rw-r--r-- | other/pamdepth.c | 2 | ||||
-rw-r--r-- | other/pamlookup.c | 60 | ||||
-rw-r--r-- | other/pamsplit.c | 14 | ||||
-rw-r--r-- | other/pamsummcol.c | 46 | ||||
-rw-r--r-- | other/pamvalidate.c | 2 | ||||
-rw-r--r-- | other/pamx/fill.c | 8 | ||||
-rw-r--r-- | other/pamx/image.c | 10 | ||||
-rw-r--r-- | other/pamx/pamx.c | 26 | ||||
-rw-r--r-- | other/pamx/send.c | 118 | ||||
-rw-r--r-- | other/ppmdcfont.c | 14 | ||||
-rw-r--r-- | other/ppmddumpfont.c | 10 | ||||
-rw-r--r-- | other/ppmdmkfont.c | 56 | ||||
-rw-r--r-- | other/ppmsvgalib.c | 42 |
14 files changed, 222 insertions, 222 deletions
diff --git a/other/pamchannel.c b/other/pamchannel.c index e89a979b..0b9c3947 100644 --- a/other/pamchannel.c +++ b/other/pamchannel.c @@ -54,9 +54,9 @@ parseCommandLine(int argc, const char ** argv, MALLOCARRAY_NOFAIL(option_def, 100); option_def_index = 0; /* incremented by OPTENT3 */ - OPTENT3(0, "infile", OPT_STRING, &cmdlineP->inputFileName, + OPTENT3(0, "infile", OPT_STRING, &cmdlineP->inputFileName, &infileSpec, 0); - OPTENT3(0, "tupletype", OPT_STRING, &cmdlineP->tupletype, + OPTENT3(0, "tupletype", OPT_STRING, &cmdlineP->tupletype, &tupletypeSpec, 0); opt.opt_table = option_def; @@ -78,16 +78,16 @@ parseCommandLine(int argc, const char ** argv, (unsigned)sizeof(pam.tuple_type)); cmdlineP->n_channel = 0; /* initial value */ - { + { int argn; for (argn = 1; argn < argc; argn++) { int n; char *endptr; - if (cmdlineP->n_channel >= MAX_CHANNELS) + if (cmdlineP->n_channel >= MAX_CHANNELS) pm_error("You may not specify more than %d channels.", MAX_CHANNELS); - + n = strtol(argv[argn], &endptr, 10); if (n < 0) pm_error("Channel numbers cannot be negative. " @@ -95,7 +95,7 @@ parseCommandLine(int argc, const char ** argv, if (endptr == NULL) pm_error("non-numeric channel number argument: '%s'", argv[argn]); - + cmdlineP->channel_to_extract[cmdlineP->n_channel++] = n; } } @@ -106,13 +106,13 @@ parseCommandLine(int argc, const char ** argv, static void -validateChannels(int const n_channel, - unsigned int const channels[], +validateChannels(int const n_channel, + unsigned int const channels[], int const depth) { int i; - for (i = 0; i < n_channel; i++) + for (i = 0; i < n_channel; i++) if (channels[i] > depth-1) pm_error("You specified channel number %d. The highest numbered\n" "channel in the input image is %d.", @@ -140,18 +140,18 @@ doOneImage(FILE * const ifP, outpam.depth = nChannel; outpam.format = PAM_FORMAT; strcpy(outpam.tuple_type, tupletype); - + pnm_writepaminit(&outpam); { tuple * inrow; tuple * outrow; - - inrow = pnm_allocpamrow(&inpam); + + inrow = pnm_allocpamrow(&inpam); outrow = pnm_allocpamrow(&outpam); - { + { unsigned int row; - + for (row = 0; row < inpam.height; ++row) { unsigned int col; @@ -159,15 +159,15 @@ doOneImage(FILE * const ifP, for (col = 0; col < inpam.width; ++col) { unsigned int plane; - for (plane = 0; plane < nChannel; ++plane) - outrow[col][plane] = + for (plane = 0; plane < nChannel; ++plane) + outrow[col][plane] = inrow[col][channelToExtract[plane]]; } pnm_writepamrow(&outpam, outrow); } } pnm_freepamrow(outrow); - pnm_freepamrow(inrow); + pnm_freepamrow(inrow); } } @@ -183,7 +183,7 @@ main(int argc, const char *argv[]) { pm_proginit(&argc, argv); parseCommandLine(argc, argv, &cmdline); - + ifP = pm_openr(cmdline.inputFileName); eof = FALSE; diff --git a/other/pamdepth.c b/other/pamdepth.c index 46601864..4349f5ea 100644 --- a/other/pamdepth.c +++ b/other/pamdepth.c @@ -124,7 +124,7 @@ transformRaster(struct pam * const inpamP, tuplerow[col][plane] = sampleMap[tuplerow[col][plane]]; } pnm_writepamrow(outpamP, tuplerow); - } + } pnm_freepamrow(tuplerow); diff --git a/other/pamlookup.c b/other/pamlookup.c index d57546d9..23a113c3 100644 --- a/other/pamlookup.c +++ b/other/pamlookup.c @@ -4,7 +4,7 @@ Look up integers or ordered pairs from an index image in a lookup table and produce a corresponding image containing the results of the lookups. - + The index image and lookup table are PAM images. The output image is a PAM image with the width and height of the index image and tuples of the kind in the lookup table. @@ -26,7 +26,7 @@ struct CmdlineInfo { /* All the information the user supplied in the command line, in a form easy for the program to use. */ - const char * indexFilespec; + const char * indexFilespec; char * lookupFilespec; char * missingcolor; /* null if not specified */ unsigned int fit; @@ -48,19 +48,19 @@ parseCommandLine(int argc, const char ** const argv, optStruct3 opt; unsigned int option_def_index; - + unsigned int lookupfileSpec, missingcolorSpec; MALLOCARRAY_NOFAIL(option_def, 100); option_def_index = 0; /* incremented by OPTENTRY */ - OPTENT3(0, "lookupfile", OPT_STRING, &cmdlineP->lookupFilespec, + OPTENT3(0, "lookupfile", OPT_STRING, &cmdlineP->lookupFilespec, &lookupfileSpec, 0); - OPTENT3(0, "missingcolor", OPT_STRING, + OPTENT3(0, "missingcolor", OPT_STRING, &cmdlineP->missingcolor, &missingcolorSpec, 0); - OPTENT3(0, "fit", OPT_FLAG, + OPTENT3(0, "fit", OPT_FLAG, NULL, &cmdlineP->fit, 0); - OPTENT3(0, "byplane", OPT_FLAG, + OPTENT3(0, "byplane", OPT_FLAG, NULL, &cmdlineP->byplane, 0); opt.opt_table = option_def; @@ -85,12 +85,12 @@ parseCommandLine(int argc, const char ** const argv, cmdlineP->indexFilespec = argv[1]; free(option_def); -} +} static void -fitLookup(tuple ** const inputLookup, +fitLookup(tuple ** const inputLookup, struct pam const inputLookuppam, tuple *** const fitLookupP, struct pam * const fitLookuppamP, @@ -115,7 +115,7 @@ fitLookup(tuple ** const inputLookup, inPamtuples.tuplesP = (tuple ***) &inputLookup; outPamtuples.pamP = fitLookuppamP; outPamtuples.tuplesP = fitLookupP; - + pm_system_lp("pamscale", &pm_feed_from_pamtuples, &inPamtuples, &pm_accept_to_pamtuples, &outPamtuples, @@ -128,7 +128,7 @@ fitLookup(tuple ** const inputLookup, static void -getLookup(const char * const lookupFileName, +getLookup(const char * const lookupFileName, unsigned int const indexDegree, unsigned int const indexMaxval, tuple *** const lookupP, @@ -136,7 +136,7 @@ getLookup(const char * const lookupFileName, bool const fit) { /*---------------------------------------------------------------------------- Get the lookup image (the one that maps integers to tuples, e.g. a - color index / color map / palette) from the file named + color index / color map / palette) from the file named 'lookupFileName'. Interpret the lookup image for use with indices that are ntuples of size @@ -154,25 +154,25 @@ getLookup(const char * const lookupFileName, tuple ** inputLookup; lookupfileP = pm_openr(lookupFileName); - inputLookup = pnm_readpam(lookupfileP, + inputLookup = pnm_readpam(lookupfileP, &inputLookuppam, PAM_STRUCT_SIZE(tuple_type)); pm_close(lookupfileP); - + if (fit) { fitLookup(inputLookup, inputLookuppam, lookupP, lookuppamP, - indexMaxval + 1, + indexMaxval + 1, indexDegree > 1 ? indexMaxval + 1 : 1); pnm_freepamarray(inputLookup, &inputLookuppam); } else { *lookupP = inputLookup; *lookuppamP = inputLookuppam; } - + if (indexDegree == 1 && lookuppamP->height != 1) pm_error("Your index image has integer indices, " "so the lookup table image must be one row. " - "Yours is %d rows.", + "Yours is %d rows.", lookuppamP->height); if (lookuppamP->width - 1 > indexMaxval) @@ -190,9 +190,9 @@ getLookup(const char * const lookupFileName, static void -computeDefaultTuple(struct CmdlineInfo const cmdline, +computeDefaultTuple(struct CmdlineInfo const cmdline, tuple ** const lookup, - struct pam * const lookuppamP, + struct pam * const lookuppamP, tuple * const defaultTupleP) { tuple retval; @@ -204,10 +204,10 @@ computeDefaultTuple(struct CmdlineInfo const cmdline, lookup table. We should probably check here for a lookup file that has a visual image tuple type, but we don't out of laziness. The program probably ought to have a generic - "missing tuple type" option too. + "missing tuple type" option too. */ if (cmdline.missingcolor) { - pixel const color = + pixel const color = ppm_parsecolor(cmdline.missingcolor, lookuppamP->maxval); if (lookuppamP->depth >= 3) { @@ -224,7 +224,7 @@ computeDefaultTuple(struct CmdlineInfo const cmdline, else retval[0] = PPM_GETR(color); } - } else + } else pnm_assigntuple(lookuppamP, retval, lookup[0][0]); *defaultTupleP = retval; @@ -261,7 +261,7 @@ doLookupByPlane(struct pam const indexpam, outpam = indexpam; /* initial value */ outpam.maxval = lookuppam.maxval; outpam.file = ofP; - + tuplerowIndex = pnm_allocpamrow(&indexpam); tuplerowOut = pnm_allocpamrow(&outpam); @@ -273,7 +273,7 @@ doLookupByPlane(struct pam const indexpam, for (row = 0; row < indexpam.height; ++row) { unsigned int col; pnm_readpamrow(&indexpam, tuplerowIndex); - + for (col = 0; col < indexpam.width; ++col) { unsigned int plane; @@ -320,7 +320,7 @@ doLookupWholeTuple(struct pam const indexpam, outpam.height = indexpam.height; outpam.width = indexpam.width; outpam.file = ofP; - + tuplerowIndex = pnm_allocpamrow(&indexpam); tuplerowOut = pnm_allocpamrow(&outpam); @@ -329,11 +329,11 @@ doLookupWholeTuple(struct pam const indexpam, for (row = 0; row < outpam.height; ++row) { unsigned int col; pnm_readpamrow(&indexpam, tuplerowIndex); - + for (col = 0; col < outpam.width; ++col) { unsigned int indexRow, indexCol; tuple v; - + if (indexpam.depth < 2) { indexRow = 0; indexCol = tuplerowIndex[col][0]; @@ -368,7 +368,7 @@ main(int argc, const char ** const argv) { tuple ** lookup; tuple defaultTuple; - + pm_proginit(&argc, argv); parseCommandLine(argc, argv, &cmdline); @@ -385,7 +385,7 @@ main(int argc, const char ** const argv) { indexDegree = cmdline.byplane ? 1 : indexpam.depth; - getLookup(cmdline.lookupFilespec, indexDegree, indexpam.maxval, + getLookup(cmdline.lookupFilespec, indexDegree, indexpam.maxval, &lookup, &lookuppam, cmdline.fit || cmdline.byplane); computeDefaultTuple(cmdline, lookup, &lookuppam, &defaultTuple); @@ -399,7 +399,7 @@ main(int argc, const char ** const argv) { pnm_freepamtuple(defaultTuple); pnm_freepamarray(lookup, &lookuppam); - + return 0; } diff --git a/other/pamsplit.c b/other/pamsplit.c index 93c1726a..8c7aff11 100644 --- a/other/pamsplit.c +++ b/other/pamsplit.c @@ -66,7 +66,7 @@ parseCommandLine(int argc, const char ** argv, if (!padnameSpec) cmdlineP->padname = 0; - if (argc - 1 < 1) + if (argc - 1 < 1) cmdlineP->inputFileName = "-"; else cmdlineP->inputFileName = argv[1]; @@ -91,7 +91,7 @@ extractOneImage(FILE * const infileP, struct pam inpam; struct pam outpam; enum pm_check_code checkRetval; - + unsigned int row; tuple * tuplerow; @@ -115,7 +115,7 @@ extractOneImage(FILE * const infileP, static void -computeOutputName(char const outputFilePattern[], +computeOutputName(char const outputFilePattern[], unsigned int const padCount, unsigned int const imageSeq, const char ** const outputNameP) { @@ -157,13 +157,13 @@ main(int argc, const char *argv[]) { FILE * ifP; int eof; /* No more images in input */ - unsigned int imageSeq; + unsigned int imageSeq; /* Sequence of current image in input file. First = 0 */ pm_proginit(&argc, argv); parseCommandLine(argc, argv, &cmdline); - + ifP = pm_openr(cmdline.inputFileName); eof = FALSE; @@ -171,7 +171,7 @@ main(int argc, const char *argv[]) { FILE * ofP; const char * outputFileName; /* malloc'ed */ - computeOutputName(cmdline.outputFilePattern, cmdline.padname, + computeOutputName(cmdline.outputFilePattern, cmdline.padname, imageSeq, &outputFileName); pm_message("WRITING %s", outputFileName); @@ -185,7 +185,7 @@ main(int argc, const char *argv[]) { pnm_nextimage(ifP, &eof); } pm_close(ifP); - + return 0; } diff --git a/other/pamsummcol.c b/other/pamsummcol.c index c84f38ad..673eaf57 100644 --- a/other/pamsummcol.c +++ b/other/pamsummcol.c @@ -68,18 +68,18 @@ parseCommandLine(int argc, char ** const argv, cmdlineP->function = FN_MIN; } else if (maxSpec) { cmdlineP->function = FN_MAX; - } else + } else pm_error("You must specify one of -sum, -min, or -max"); - + if (argc-1 > 1) pm_error("Too many arguments (%d). File spec is the only argument.", argc-1); if (argc-1 < 1) cmdlineP->inputFilespec = "-"; - else + else cmdlineP->inputFilespec = argv[1]; - + } @@ -98,7 +98,7 @@ createAccumulator(enum function const function, unsigned int const cols, unsigned int const planes, struct accum *** const accumulatorP) { - + struct accum ** accumulator; unsigned int col; @@ -115,7 +115,7 @@ createAccumulator(enum function const function, case FN_MEAN: accumulator[col][plane].u.sum = 0; break; case FN_MIN: accumulator[col][plane].u.min = UINT_MAX; break; case FN_MAX: accumulator[col][plane].u.max = 0; break; - } + } } } *accumulatorP = accumulator; @@ -148,14 +148,14 @@ aggregate(struct pam * const inpamP, unsigned int plane; for (plane = 0; plane < inpamP->depth; ++plane) { switch(function) { - case FN_ADD: - case FN_MEAN: - if (accumulator[col][plane].u.sum > + case FN_ADD: + case FN_MEAN: + if (accumulator[col][plane].u.sum > UINT_MAX - tupleRow[col][plane]) pm_error("Numerical overflow in Column %u", col); accumulator[col][plane].u.sum += tupleRow[col][plane]; break; - case FN_MIN: + case FN_MIN: if (tupleRow[col][plane] < accumulator[col][plane].u.min) accumulator[col][plane].u.min = tupleRow[col][plane]; break; @@ -163,7 +163,7 @@ aggregate(struct pam * const inpamP, if (tupleRow[col][plane] > accumulator[col][plane].u.min) accumulator[col][plane].u.min = tupleRow[col][plane]; break; - } + } } } } @@ -176,31 +176,31 @@ makeSummaryRow(struct accum ** const accumulator, struct pam * const pamP, enum function const function, tuple * const tupleRow) { - + unsigned int col; for (col = 0; col < pamP->width; ++col) { unsigned int plane; for (plane = 0; plane < pamP->depth; ++plane) { switch(function) { - case FN_ADD: - tupleRow[col][plane] = + case FN_ADD: + tupleRow[col][plane] = MIN(accumulator[col][plane].u.sum, pamP->maxval); break; - case FN_MEAN: - tupleRow[col][plane] = + case FN_MEAN: + tupleRow[col][plane] = ROUNDU((double)accumulator[col][plane].u.sum / count); break; - case FN_MIN: - tupleRow[col][plane] = + case FN_MIN: + tupleRow[col][plane] = accumulator[col][plane].u.min; break; case FN_MAX: - tupleRow[col][plane] = + tupleRow[col][plane] = accumulator[col][plane].u.max; break; } - } + } } } @@ -226,7 +226,7 @@ main(int argc, char *argv[]) { pnm_readpaminit(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); - createAccumulator(cmdline.function, inpam.width, inpam.depth, + createAccumulator(cmdline.function, inpam.width, inpam.depth, &accumulator); inputRow = pnm_allocpamrow(&inpam); @@ -244,7 +244,7 @@ main(int argc, char *argv[]) { aggregate(&inpam, inputRow, cmdline.function, accumulator); } - makeSummaryRow(accumulator, inpam.height, &outpam, cmdline.function, + makeSummaryRow(accumulator, inpam.height, &outpam, cmdline.function, outputRow); pnm_writepamrow(&outpam, outputRow); @@ -253,6 +253,6 @@ main(int argc, char *argv[]) { destroyAccumulator(accumulator, inpam.width); pm_close(inpam.file); pm_close(outpam.file); - + return 0; } diff --git a/other/pamvalidate.c b/other/pamvalidate.c index a7b08b8e..613df736 100644 --- a/other/pamvalidate.c +++ b/other/pamvalidate.c @@ -74,7 +74,7 @@ main(int argc, const char * argv[]) { if (ferror(tmpfile)) pm_error("Error reading from temporary file. " - "Incomplete output. " + "Incomplete output. " "Errno = %s (%d)", strerror(errno), errno); else fwrite(buffer, 1, bytesReadCt, stdout); diff --git a/other/pamx/fill.c b/other/pamx/fill.c index 13a2b21e..dc61ce33 100644 --- a/other/pamx/fill.c +++ b/other/pamx/fill.c @@ -1,8 +1,8 @@ -/* +/* fill an image area with a particular pixel value - + By Jim Frost 1989.10.02, Bryan Henderson 2006.03.25. - + See COPYRIGHT file for copyright information. */ @@ -52,7 +52,7 @@ fill(Image * const imageP, } } } break; - + case IRGB: case ITRUE: { unsigned int const linelen= imageP->width * imageP->pixlen; diff --git a/other/pamx/image.c b/other/pamx/image.c index 0e719438..fc256ae1 100644 --- a/other/pamx/image.c +++ b/other/pamx/image.c @@ -1,8 +1,8 @@ /* Functions to allocate and deallocate structures and structure data - + By Jim Frost 1989.09.29, Bryan Henderson 2006.03.25. - + See COPYRIGHT file for copyright information. */ @@ -156,7 +156,7 @@ Image * newRGBImage(unsigned int const width, unsigned int const height, unsigned int const depth) { - + unsigned int const pixlen = depth > 0 ? (depth + 7) / 8 : 1; /* Special case for "zero" depth image, which is sometimes interpreted as "one color" @@ -164,7 +164,7 @@ newRGBImage(unsigned int const width, unsigned int const numcolors = depthToColors(depth); Image * imageP; - + MALLOCVAR_NOFAIL(imageP); imageP->type = IRGB; newRGBMapData(&imageP->rgb, numcolors); @@ -191,7 +191,7 @@ newTrueImage(unsigned int const width, unsigned int const height) { unsigned int const pixlen = 3; - + Image * imageP; MALLOCVAR_NOFAIL(imageP); diff --git a/other/pamx/pamx.c b/other/pamx/pamx.c index 35900f82..cc2a70ae 100644 --- a/other/pamx/pamx.c +++ b/other/pamx/pamx.c @@ -1,4 +1,4 @@ -/* By Bryan Henderson 2006.03.25 +/* By Bryan Henderson 2006.03.25 Copyright information is in the file COPYRIGHT */ @@ -52,13 +52,13 @@ struct cmdlineInfo { -static void -parseCommandLine(int argc, - char ** argv, +static void +parseCommandLine(int argc, + char ** argv, struct cmdlineInfo * const cmdlineP) { /* -------------------------------------------------------------------------- Parse program command line described in Unix standard form by argc - and argv. Return the information in the options as *cmdlineP. + and argv. Return the information in the options as *cmdlineP. If command line is internally inconsistent (invalid options, etc.), issue error message to stderr and abort program. @@ -69,7 +69,7 @@ parseCommandLine(int argc, optEntry *option_def; /* Instructions to pm_optParseOptions3 on how to parse our options. */ optStruct3 opt; - + unsigned int option_def_index; unsigned int displaySpec, titleSpec, foregroundSpec, backgroundSpec, @@ -111,7 +111,7 @@ parseCommandLine(int argc, opt.opt_table = option_def; opt.short_allowed = FALSE; /* We have no short (old-fashioned) options */ opt.allowNegNum = FALSE; /* We have no parms that are negative numbers */ - + pm_optParseOptions3(&argc, argv, opt, sizeof(opt), 0); /* Uses and sets argc, argv, and some of *cmdlineP and others. */ @@ -194,7 +194,7 @@ fillRow(struct pam * const pamP, for its contents, according to 'depth'. -----------------------------------------------------------------------------*/ unsigned int col; - + for (col = 0; col < pamP->width; ++col) { /* Truecolor image data has 3 bytes per pixel, one each for red, green, and blue. @@ -238,7 +238,7 @@ loadPamImage(FILE * const ifP, for (row = 0; row < pam.height; ++row) { pnm_readpamrow(&pam, tuplerow); - + /* This semantically wasteful code allows a dumb compiler optimizer to recognize that the depth is constant and therefore not generate code that checks the depth every @@ -288,7 +288,7 @@ processImage(Image * const imageP, imageP->rgb.grn[FOREGROUND_IDX] = color.green; imageP->rgb.blu[FOREGROUND_IDX] = color.blue; } - } + } } @@ -296,9 +296,9 @@ processImage(Image * const imageP, static void determineTitle(struct cmdlineInfo const cmdline, const char ** const titleP) { - + const char * title; - + if (cmdline.title) title = strdup(cmdline.title); else { @@ -332,7 +332,7 @@ main(int argc, parseCommandLine(argc, argv, &cmdline); ifP = pm_openr(cmdline.inputFileName); - + dispP = XOpenDisplay(cmdline.display); if (!dispP) pm_error("Cannot open display '%s'", XDisplayName(cmdline.display)); diff --git a/other/pamx/send.c b/other/pamx/send.c index 3c3852e2..c33c5c06 100644 --- a/other/pamx/send.c +++ b/other/pamx/send.c @@ -1,10 +1,10 @@ /* - + Send an Image to an X pixmap By Jim Frost 1989.10.02, Bryan Henderson 2006.03.25. - + Copyright 1989, 1990, 1991 Jim Frost. See COPYRIGHT file for copyright information. */ @@ -59,7 +59,7 @@ ximageToPixmap(Display * const disp, XErrorHandler old_handler; Pixmap pixmap; - + GotError = FALSE; old_handler = XSetErrorHandler(pixmapErrorTrap); XSync(disp, False); @@ -114,7 +114,7 @@ bitsPerPixelAtDepth(Display * const disp, fprintf(stderr, "bitsPerPixelAtDepth: Can't find pixmap depth info!\n"); exit(1); } - + static void @@ -130,7 +130,7 @@ findColors(const Image * const imageP, for (color = 0; color < 32768; ++color) pixelCt[color] = 0; /* initial value */ - + for (y = 0, pixel = imageP->data; y < imageP->height; ++y) { unsigned int x; for (x = 0; x < imageP->width; ++x) { @@ -184,7 +184,7 @@ pseudoColorImageFromItrue(Image * const imageP, /* Put the color in the color map */ newImageP->rgb.red[colorCt] = red<<11; - newImageP->rgb.grn[colorCt] = grn<<11; + newImageP->rgb.grn[colorCt] = grn<<11; newImageP->rgb.blu[colorCt] = blu<<11; /* Reverse-index it */ @@ -192,9 +192,9 @@ pseudoColorImageFromItrue(Image * const imageP, ++colorCt; } - } + } newImageP->rgb.used = colorCt; - + for (y = 0, pixel = imageP->data, dpixel = newImageP->data; y < imageP->height; ++y) { @@ -241,7 +241,7 @@ makeUsableVisual(Image * const origImageP, visualP->class); } break; - + case IRGB: switch(visualP->class) { case TrueColor: @@ -253,13 +253,13 @@ makeUsableVisual(Image * const origImageP, pm_error("INTERNAL ERROR: impossible visual class %u", visualP->class); } - + case IBITMAP: /* no processing ever needs to be done for bitmaps */ *newImagePP = origImageP; break; } -} +} @@ -271,7 +271,7 @@ makeColorMap1(Display * const disp, Pixel ** const redvalueP, Pixel ** const grnvalueP, Pixel ** const bluvalueP) { - + Pixel * redvalue; Pixel * grnvalue; Pixel * bluvalue; @@ -281,22 +281,22 @@ makeColorMap1(Display * const disp, unsigned int redbottom, grnbottom, blubottom; unsigned int redtop, grntop, blutop; unsigned int a; - + MALLOCARRAY_NOFAIL(redvalue, 256); MALLOCARRAY_NOFAIL(grnvalue, 256); MALLOCARRAY_NOFAIL(bluvalue, 256); - + if (visualP == DefaultVisual(disp, scrn)) *cmapP = DefaultColormap(disp, scrn); else *cmapP = XCreateColormap(disp, RootWindow(disp, scrn), visualP, AllocNone); - + retry_direct: /* tag we hit if a DirectColor allocation fails on * default colormap */ - + /* calculate number of distinct colors in each band */ - + redcolors = grncolors = blucolors = 1; for (pixval = 1; pixval; pixval <<= 1) { if (pixval & visualP->red_mask) @@ -306,16 +306,16 @@ makeColorMap1(Display * const disp, if (pixval & visualP->blue_mask) blucolors <<= 1; } - + /* sanity check */ - + if ((redcolors > visualP->map_entries) || (grncolors > visualP->map_entries) || (blucolors > visualP->map_entries)) { pm_message("Warning: inconsistency in color information " "(this may be ugly)"); } - + redstep= 256 / redcolors; grnstep= 256 / grncolors; blustep= 256 / blucolors; @@ -329,7 +329,7 @@ makeColorMap1(Display * const disp, grntop = grnbottom + grnstep; if (blubottom < 256) blutop = blubottom + blustep; - + xcolor.flags = DoRed | DoGreen | DoBlue; xcolor.red = (redtop - 1) << 8; xcolor.green = (grntop - 1) << 8; @@ -347,15 +347,15 @@ makeColorMap1(Display * const disp, visualP, AllocNone); goto retry_direct; } - + /* something completely unexpected happened */ - + pm_error("INTERNAL ERROR: XAllocColor failed on a " "TrueColor/Directcolor visual"); } - + /* fill in pixel values for each band at this intensity */ - + while ((redbottom < 256) && (redbottom < redtop)) redvalue[redbottom++] = xcolor.pixel & visualP->red_mask; while ((grnbottom < 256) && (grnbottom < grntop)) @@ -369,7 +369,7 @@ makeColorMap1(Display * const disp, } - + static void allocColorCells(Display * const disp, Colormap const cmap, @@ -379,7 +379,7 @@ allocColorCells(Display * const disp, bool outOfCells; unsigned int cellCount; - + outOfCells = false; /* initial value */ cellCount = 0; /* initial value */ while (cellCount < colorCount && !outOfCells) { @@ -392,7 +392,7 @@ allocColorCells(Display * const disp, *cellCountP = cellCount; } - + static void @@ -412,9 +412,9 @@ makeColorMap2(Display * const disp, Pixel * colorIndex; MALLOCARRAY_NOFAIL(colorIndex, rgb.used); - + /* 'privateCmap' is invalid if not a dynamic visual */ - + switch (visualP->class) { case StaticColor: case StaticGray: @@ -422,9 +422,9 @@ makeColorMap2(Display * const disp, default: privateCmap = userWantsPrivateCmap; } - + /* get the colormap to use. */ - + if (privateCmap) { /* user asked us to use a private cmap */ newmap = TRUE; fit = FALSE; @@ -433,7 +433,7 @@ makeColorMap2(Display * const disp, (visualP->class == StaticColor) || (visualP->class == TrueColor) || (visualP->class == DirectColor)) { - + unsigned int a; fit = userWantsFit; @@ -442,16 +442,16 @@ makeColorMap2(Display * const disp, shareable. otherwise we're using a static visual and should treat it accordingly. */ - + if (visualP == DefaultVisual(disp, scrn)) *cmapP = DefaultColormap(disp, scrn); else *cmapP = XCreateColormap(disp, RootWindow(disp, scrn), visualP, AllocNone); newmap = FALSE; - + /* allocate colors shareable (if we can) */ - + for (a = 0; a < rgb.used; ++a) { Status rc; XColor xcolor; @@ -484,7 +484,7 @@ makeColorMap2(Display * const disp, newmap = TRUE; fit = FALSE; } - + if (newmap) { /* Either create a new colormap or fit the image into the one we have. To create a new one, we create a private @@ -497,10 +497,10 @@ makeColorMap2(Display * const disp, 4. reduce the depth of the image to fit. 5. allocate the colors again shareable. 6. ungrab the server and continue on our way. - + Someone should shoot the people who designed X color allocation. */ - + unsigned int a; if (fit) { @@ -510,13 +510,13 @@ makeColorMap2(Display * const disp, } else { if (verbose) pm_message("Using private colormap"); - + /* create new colormap */ - + *cmapP = XCreateColormap(disp, RootWindow(disp, scrn), visualP, AllocNone); } - + allocColorCells(disp, *cmapP, colorIndex, rgb.used, &a); if (fit) { @@ -525,10 +525,10 @@ makeColorMap2(Display * const disp, if (a <= 2) pm_error("Cannot fit into default colormap"); } - + if (a == 0) pm_error("Color allocation failed!"); - + if (fit) { unsigned int a; for (a = 0; a < rgb.used; ++a) { @@ -537,7 +537,7 @@ makeColorMap2(Display * const disp, xcolor.red = rgb.red[a]; xcolor.green = rgb.grn[a]; xcolor.blue = rgb.blu[a]; - + if (!XAllocColor(disp, *cmapP, &xcolor)) pm_error("XAllocColor failed while fitting colormap!"); colorIndex[a] = xcolor.pixel; @@ -574,7 +574,7 @@ doColorAllocation(XImageInfo * const ximageinfoP, Pixel ** const redvalP, Pixel ** const grnvalP, Pixel ** const bluvalP) { - + if ((visualP->class == TrueColor || visualP->class == DirectColor) && !BITMAPP(imageP)) { makeColorMap1(disp, scrn, visualP, &ximageinfoP->cmap, @@ -584,11 +584,11 @@ doColorAllocation(XImageInfo * const ximageinfoP, makeColorMap2(disp, scrn, visualP, imageP->rgb, userWantsPrivateCmap, userWantsFit, verbose, &ximageinfoP->cmap, colorIndexP); - + *redvalP = *grnvalP = *bluvalP = NULL; } } - + @@ -637,19 +637,19 @@ makeXImage(XImageInfo * const ximageinfoP, case IRGB: case ITRUE: { /* Modify image data to match visual and colormap */ - + unsigned int const dbits = bitsPerPixelAtDepth(disp, scrn, ddepth); unsigned int const dpixlen = (dbits + 7) / 8; ximageinfoP->depth = ddepth; - + switch (visualP->class) { case DirectColor: case TrueColor: { unsigned char * data; unsigned char * destptr; unsigned char * srcptr; - + ximageinfoP->ximageP = XCreateImage(disp, visualP, ddepth, ZPixmap, 0, NULL, imageP->width, imageP->height, 8, 0); @@ -702,7 +702,7 @@ makeXImage(XImageInfo * const ximageinfoP, } break; default: { - + /* only IRGB images make it this far. */ /* If our XImage doesn't have modulus 8 bits per pixel, @@ -734,7 +734,7 @@ makeXImage(XImageInfo * const ximageinfoP, ximageinfoP->ximageP->byte_order = MSBFirst; for (a= 0; a < dbits; ++a) { Pixel const pixmask = 1 << a; - unsigned char * const destdata = + unsigned char * const destdata = data + ((ddepth - a - 1) * imageP->height * linelen); unsigned int y; @@ -792,7 +792,7 @@ makeXImage(XImageInfo * const ximageinfoP, } } } break; - } + } } break; } if (verbose) @@ -819,7 +819,7 @@ imageToXImage(Display * const disp, Pixel * bluvalue; assertGoodImage(origImageP); - + MALLOCVAR_NOFAIL(ximageinfoP); ximageinfoP->disp = disp; ximageinfoP->scrn = scrn; @@ -828,7 +828,7 @@ imageToXImage(Display * const disp, ximageinfoP->foreground = ximageinfoP->background = 0; ximageinfoP->gc = NULL; ximageinfoP->ximageP = NULL; - + makeUsableVisual(origImageP, visualP, ddepth, &imageP); assertGoodImage(imageP); @@ -849,7 +849,7 @@ imageToXImage(Display * const disp, } if (imageP != origImageP) freeImage(imageP); - + return ximageinfoP; } @@ -870,7 +870,7 @@ sendXImage(XImageInfo * const ximageinfoP, XGCValues gcv; /* build and cache the GC */ - + if (!ximageinfoP->gc) { gcv.function = GXcopy; if (ximageinfoP->ximageP->depth == 1) { @@ -885,7 +885,7 @@ sendXImage(XImageInfo * const ximageinfoP, XCreateGC(ximageinfoP->disp, ximageinfoP->drawable, GCFunction, &gcv); } - + XPutImage(ximageinfoP->disp, ximageinfoP->drawable, ximageinfoP->gc, ximageinfoP->ximageP, src_x, src_y, dst_x, dst_y, w, h); } diff --git a/other/ppmdcfont.c b/other/ppmdcfont.c index 130b6383..a8bcbcd8 100644 --- a/other/ppmdcfont.c +++ b/other/ppmdcfont.c @@ -30,10 +30,10 @@ generateGlyphCommand(struct ppmd_glyphCommand const glyphCommand) { case CMD_DRAWLINE: verb = "CMD_DRAWLINE"; break; case CMD_MOVEPEN: verb = "CMD_MOVEPEN"; break; } - + fprintf(stdout, " {/* glyphCommand */ %s, %u, %u }\n", verb, glyphCommand.x, glyphCommand.y); - + } @@ -76,7 +76,7 @@ generateCommandTables(const struct ppmd_font * const fontP, pm_asprintf(&commandTableVariableName, "%s_cmd_%u", glyphTableVariableName, fontP->header.firstCodePoint + relativeCodePoint); - + generateCommandTable(fontP->glyphTable[relativeCodePoint], commandTableVariableName); @@ -133,7 +133,7 @@ generateGlyphTable(const struct ppmd_font * const fontP, pm_asprintf(&commandTableVariableName, "%s_cmd_%u", variableName, fontP->header.firstCodePoint + relativeCodePoint); - + generateGlyph(fontP->glyphTable[relativeCodePoint], commandTableVariableName); @@ -154,7 +154,7 @@ generateFont(const struct ppmd_font * const fontP, const char * const glyphTableVariableName) { fprintf(stdout, "struct ppmd_font const %s = {\n", fontVariableName); - + generateHeader(fontP->header); fprintf(stdout, " ,\n"); @@ -189,12 +189,12 @@ main(int argc, char **argv) { generateGlyphTable(fontP, glyphTableVariableName); fprintf(stdout, "\n"); - + generateFont(fontP, fontVariableName, glyphTableVariableName); pm_strfree(glyphTableVariableName); ppmd_free_font(fontP); - + return 0; } diff --git a/other/ppmddumpfont.c b/other/ppmddumpfont.c index 3ab477ab..1c3474e8 100644 --- a/other/ppmddumpfont.c +++ b/other/ppmddumpfont.c @@ -19,7 +19,7 @@ untwos(unsigned char const arg) { static void dumpHeader(struct ppmd_fontHeader const fontHeader) { - + pm_message("Font has %u characters", fontHeader.characterCount); pm_message("Font has code points %u through %u", fontHeader.firstCodePoint, @@ -34,7 +34,7 @@ dumpGlyph(struct ppmd_glyph const glyph) { unsigned int commandNum; pm_message(" skip before: %u pixels; skip after: %u pixels; " - "%u commands:", + "%u commands:", glyph.header.skipBefore, glyph.header.skipAfter, glyph.header.commandCount); @@ -42,10 +42,10 @@ dumpGlyph(struct ppmd_glyph const glyph) { for (commandNum = 0; commandNum < glyph.header.commandCount; ++commandNum) { - + struct ppmd_glyphCommand const glyphCommand = glyph.commandList[commandNum]; - + const char * verbDisp; switch (glyphCommand.verb) { @@ -84,6 +84,6 @@ main(int argc, char **argv) { } ppmd_free_font(fontP); - + return 0; } diff --git a/other/ppmdmkfont.c b/other/ppmdmkfont.c index 7cf1256f..f340e4f4 100644 --- a/other/ppmdmkfont.c +++ b/other/ppmdmkfont.c @@ -63,7 +63,7 @@ static unsigned char char37[] = 250, 244, 252, 244, 254, 245, 1, 246, 4, 246, 7, 245, 9, 244, 192, 0, 5, 2, 3, 3, 2, 5, 2, 7, 4, 9, 6, 9, 8, 8, 9, 6, 9, 4, 7, 2, 5, 2 }; - + static unsigned char char38[] = { 34, 243, 13, 10, 253, 10, 252, 9, 251, 8, 251, 7, 252, 6, 254, 4, @@ -155,7 +155,7 @@ static unsigned char char54[] = static unsigned char char55[] = { 5, 246, 10, 7, 244, 253, 9, 192, 0, 249, 244, 7, 244 }; - + static unsigned char char56[] = { 29, 246, 10, 254, 244, 251, 245, 250, 247, 250, 249, 251, 251, @@ -169,12 +169,12 @@ static unsigned char char57[] = 254, 249, 251, 249, 250, 250, 247, 252, 245, 255, 244, 0, 244, 3, 245, 5, 247, 6, 251, 6, 0, 5, 5, 3, 8, 0, 9, 254, 9, 251, 8, 250, 6 }; - + static unsigned char char58[] = { 11, 251, 5, 0, 251, 255, 252, 0, 253, 1, 252, 0, 251, 192, 0, 0, 7, 255, 8, 0, 9, 1, 8, 0, 7 }; - + static unsigned char char59[] = { 14, 251, 5, 0, 251, 255, 252, 0, 253, 1, 252, 0, 251, 192, 0, 1, @@ -208,7 +208,7 @@ static unsigned char char64[] = 248, 247, 250, 246, 253, 246, 0, 247, 3, 248, 5, 250, 7, 252, 8, 255, 9, 2, 9, 5, 8, 7, 7, 8, 6, 192, 0, 6, 249, 5, 1, 5, 3, 6, 4 }; - + static unsigned char char65[] = { 8, 247, 9, 0, 244, 248, 9, 192, 0, 0, 244, 8, 9, 192, 0, 251, 2, @@ -266,7 +266,7 @@ static unsigned char char75[] = 249, 244, 249, 9, 192, 0, 7, 244, 249, 2, 192, 0, 254, 253, 7, 9 }; -static unsigned char char76[] = +static unsigned char char76[] = { 3, 246, 7, 250, 244, 250, 9, 6, 9 }; @@ -274,12 +274,12 @@ static unsigned char char77[] = { 11, 244, 12, 248, 244, 248, 9, 192, 0, 248, 244, 0, 9, 192, 0, 8, 244, 0, 9, 192, 0, 8, 244, 8, 9 }; - + static unsigned char char78[] = { 8, 245, 11, 249, 244, 249, 9, 192, 0, 249, 244, 7, 9, 192, 0, 7, 244, 7, 9 }; - + static unsigned char char79[] = { 21, 245, 11, 254, 244, 252, 245, 250, 247, 249, 249, 248, 252, @@ -297,7 +297,7 @@ static unsigned char char81[] = 248, 1, 249, 4, 250, 6, 252, 8, 254, 9, 2, 9, 4, 8, 6, 6, 7, 4, 8, 1, 8, 252, 7, 249, 6, 247, 4, 245, 2, 244, 254, 244, 192, 0, 1, 5, 7, 11 }; - + static unsigned char char82[] = { 16, 245, 10, 249, 244, 249, 9, 192, 0, 249, 244, 2, 244, 5, 245, @@ -372,13 +372,13 @@ static unsigned char char97[] = 6, 251, 6, 9, 192, 0, 6, 254, 4, 252, 2, 251, 255, 251, 253, 252, 251, 254, 250, 1, 250, 3, 251, 6, 253, 8, 255, 9, 2, 9, 4, 8, 6, 6 }; - + static unsigned char char98[] = { 17, 246, 9, 250, 244, 250, 9, 192, 0, 250, 254, 252, 252, 254, 251, 1, 251, 3, 252, 5, 254, 6, 1, 6, 3, 5, 6, 3, 8, 1, 9, 254, 9, 252, 8, 250, 6 }; - + static unsigned char char99[] = { 14, 247, 9, 6, 254, 4, 252, 2, 251, 255, 251, 253, 252, 251, 254, @@ -389,7 +389,7 @@ static unsigned char char100[] = 6, 244, 6, 9, 192, 0, 6, 254, 4, 252, 2, 251, 255, 251, 253, 252, 251, 254, 250, 1, 250, 3, 251, 6, 253, 8, 255, 9, 2, 9, 4, 8, 6, 6 }; - + static unsigned char char101[] = { 17, 247, 9, 250, 1, 6, 1, 6, 255, 5, 253, 4, 252, 2, 251, 255, @@ -429,7 +429,7 @@ static unsigned char char107[] = static unsigned char char108[] = { 2, 252, 4, 0, 244, 0, 9 }; - + static unsigned char char109[] = { 18, 241, 15, 245, 251, 245, 9, 192, 0, 245, 255, 248, 252, 250, @@ -458,12 +458,12 @@ static unsigned char char113[] = 6, 251, 6, 16, 192, 0, 6, 254, 4, 252, 2, 251, 255, 251, 253, 252, 251, 254, 250, 1, 250, 3, 251, 6, 253, 8, 255, 9, 2, 9, 4, 8, 6, 6 }; - + static unsigned char char114[] = { 8, 249, 6, 253, 251, 253, 9, 192, 0, 253, 1, 254, 254, 0, 252, 2, 251, 5, 251 }; - + static unsigned char char115[] = { 17, 248, 9, 6, 254, 5, 252, 2, 251, 255, 251, 252, 252, 251, @@ -482,7 +482,7 @@ static unsigned char char117[] = static unsigned char char118[] = { 5, 248, 8, 250, 251, 0, 9, 192, 0, 6, 251, 0, 9 }; - + static unsigned char char119[] = { 11, 245, 11, 248, 251, 252, 9, 192, 0, 0, 251, 252, 9, 192, 0, @@ -496,7 +496,7 @@ static unsigned char char121[] = { 9, 248, 8, 250, 251, 0, 9, 192, 0, 6, 251, 0, 9, 254, 13, 252, 15, 250, 16, 249, 16 }; - + static unsigned char char122[] = { 8, 248, 9, 6, 251, 251, 9, 192, 0, 251, 251, 6, 251, 192, 0, @@ -554,7 +554,7 @@ writeGlyphCommand(FILE * const ofP, fputc(glyphCommand.verb, ofP); fputc(glyphCommand.x, ofP); fputc(glyphCommand.y, ofP); -} +} @@ -563,11 +563,11 @@ writeMovePen(FILE * const ofP, const unsigned char * const glyphData) { struct ppmd_glyphCommand glyphCommand; - + glyphCommand.verb = CMD_MOVEPEN; glyphCommand.x = glyphData[0]; glyphCommand.y = glyphData[1]; - + writeGlyphCommand(ofP, glyphCommand); } @@ -578,13 +578,13 @@ writeMovePenNoop(FILE * const ofP, const unsigned char * const glyphData) { struct ppmd_glyphCommand glyphCommand; - + glyphCommand.verb = CMD_MOVEPEN; glyphCommand.x = glyphData[0]; glyphCommand.y = glyphData[1]; - + writeGlyphCommand(ofP, glyphCommand); - + glyphCommand.verb = CMD_NOOP; glyphCommand.x = 0; glyphCommand.y = 0; @@ -603,10 +603,10 @@ writeDrawLine(FILE * const ofP, glyphCommand.verb = CMD_DRAWLINE; glyphCommand.x = glyphData[0]; glyphCommand.y = glyphData[1]; - + writeGlyphCommand(ofP, glyphCommand); } - + static void @@ -616,7 +616,7 @@ writeGlyphHeader(FILE * const ofP, fputc(glyphHeader.commandCount, ofP); fputc(glyphHeader.skipBefore, ofP); fputc(glyphHeader.skipAfter, ofP); -} +} @@ -638,7 +638,7 @@ writeBuiltinCharacter(FILE * const ofP, commandNum = 0; while (commandNum < glyphHeader.commandCount) { - + if (commandNum == 0) { writeMovePen(ofP, &glyphData[3 + commandNum * 2]); commandNum += 1; @@ -700,6 +700,6 @@ main(int argc, char **argv) { ppm_init(&argc, argv); writeBuiltinFont(stdout); - + return 0; } diff --git a/other/ppmsvgalib.c b/other/ppmsvgalib.c index c5700992..97cef286 100644 --- a/other/ppmsvgalib.c +++ b/other/ppmsvgalib.c @@ -6,7 +6,7 @@ By Bryan Henderson, San Jose CA 2002.01.06. Contributed to the public domain. - + ******************************************************************************/ #define _XOPEN_SOURCE /* Make sure modern signal stuff is in signal.h */ @@ -37,7 +37,7 @@ parseCommandLine (int argc, char ** argv, struct cmdlineInfo *cmdlineP) { /*---------------------------------------------------------------------------- parse program command line described in Unix standard form by argc - and argv. Return the information in the options as *cmdlineP. + and argv. Return the information in the options as *cmdlineP. If command line is internally inconsistent (invalid options, etc.), issue error message to stderr and abort program. @@ -83,10 +83,10 @@ parseCommandLine (int argc, char ** argv, static void -displayImage(FILE * const ifP, - int const cols, +displayImage(FILE * const ifP, + int const cols, int const rows, - pixval const maxval, + pixval const maxval, int const format, int const originCol, int const originRow) { @@ -107,7 +107,7 @@ displayImage(FILE * const ifP, pixelrow = ppm_allocrow(cols); - /* Implementation note: It might be faster to use + /* Implementation note: It might be faster to use vga_drawscansegment() instead of vga_drawpixel() */ @@ -143,13 +143,13 @@ sigintHandler(int const signal) { -static void +static void waitforSigint(void) { struct sigaction oldsigaction; struct sigaction newsigaction; int rc; - + newsigaction.sa_handler = &sigintHandler; sigemptyset(&newsigaction.sa_mask); newsigaction.sa_flags = 0; @@ -166,19 +166,19 @@ waitforSigint(void) { static void -display(FILE * const ifP, - int const cols, - int const rows, - pixval const maxval, - int const format, - int const videoMode, +display(FILE * const ifP, + int const cols, + int const rows, + pixval const maxval, + int const format, + int const videoMode, bool const verbose) { int xmax, ymax; vga_modeinfo *modeinfo; modeinfo = vga_getmodeinfo(videoMode); - + if (verbose) { pm_message("Screen Width: %d Height: %d Colors: %d", modeinfo->width, @@ -193,18 +193,18 @@ display(FILE * const ifP, if (modeinfo->colors <= 256) pm_error("This video mode has %d or fewer colors, which means " "it is colormapped (aka paletted, aka pseudocolor). " - "This program cannot drive colormapped modes.", + "This program cannot drive colormapped modes.", modeinfo->colors); if (cols > modeinfo->width) pm_error("Image is too wide (%d columns) for screen (%d columns). " - "Use Pamcut to select part to display.", + "Use Pamcut to select part to display.", cols, modeinfo->width); if (rows > modeinfo->height) pm_error("Image is too tall (%d rows) for screen (%d rows). " "Use Pamcut to select part to display.", rows, modeinfo->height); - + /* The program must not terminate after we set the video mode and before we reset it to text mode. Note that vga_setmode() sets up handlers for signals such as SIGINT that attempt to restore modes and then exit @@ -241,7 +241,7 @@ display(FILE * const ifP, -int +int main(int argc, char *argv[]) { FILE * ifP; @@ -261,7 +261,7 @@ main(int argc, char *argv[]) { { enum pm_check_code checkResult; - ppm_check(ifP, PM_CHECK_BASIC, format, cols, rows, maxval, + ppm_check(ifP, PM_CHECK_BASIC, format, cols, rows, maxval, &checkResult); } @@ -274,7 +274,7 @@ main(int argc, char *argv[]) { pm_error("Svgalib unable to allocate a virtual console."); if (vga_hasmode(cmdline.mode)) - display(ifP, cols, rows, maxval, format, + display(ifP, cols, rows, maxval, format, cmdline.mode, cmdline.verbose); else { pm_error("Svgalib video mode #%d not available. Either the " |