diff options
-rw-r--r-- | converter/ppm/xpmtoppm.c | 36 | ||||
-rw-r--r-- | doc/HISTORY | 3 |
2 files changed, 21 insertions, 18 deletions
diff --git a/converter/ppm/xpmtoppm.c b/converter/ppm/xpmtoppm.c index 550128dc..de49a8dc 100644 --- a/converter/ppm/xpmtoppm.c +++ b/converter/ppm/xpmtoppm.c @@ -138,7 +138,7 @@ static bool backup; static void -getline(char * const line, +getLine(char * const line, size_t const size, FILE * const stream) { /*---------------------------------------------------------------------------- @@ -156,7 +156,7 @@ getline(char * const line, Exit program if the line doesn't fit in the buffer. -----------------------------------------------------------------------------*/ if (size > sizeof(lastInputLine)) - pm_error("INTERNAL ERROR: getline() received 'size' parameter " + pm_error("INTERNAL ERROR: getLine() received 'size' parameter " "which is out of bounds"); if (backup) { @@ -436,10 +436,10 @@ readV3ColorTable(FILE * const ifP, for (seqNum = 0; seqNum < nColors; ++seqNum) { char line[MAX_LINE+1]; - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); /* skip the comment line if any */ if (strneq(line, "/*", 2)) - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); interpretXpm3ColorTableLine(line, seqNum, charsPerPixel, colors, ptab, nColors, transparentP); @@ -462,7 +462,7 @@ readXpm3Header(FILE * const ifP, TransparentColor * const transparentP) { /*---------------------------------------------------------------------------- Read the header of the XPM file on stream *ifP. Assume the - getline() stream is presently positioned to the beginning of the + getLine() stream is presently positioned to the beginning of the file and it is a Version 3 XPM file. Leave the stream positioned after the header. @@ -495,25 +495,25 @@ readXpm3Header(FILE * const ifP, unsigned int charsPerPixel; /* Read the XPM signature comment */ - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); if (!strneq(line, xpm3_signature, strlen(xpm3_signature))) pm_error("Apparent XPM 3 file does not start with '/* XPM */'. " "First line is '%s'", xpm3_signature); /* Read the assignment line */ - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); if (!strneq(line, "static char", 11)) pm_error("Cannot find data structure declaration. Expected a " "line starting with 'static char', but found the line " "'%s'.", line); - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); /* Skip the comment block, if one starts here */ if (strneq(line, "/*", 2)) { while (!strstr(line, "*/")) - getline(line, sizeof(line), ifP); - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); } /* Parse the hints line */ @@ -577,7 +577,7 @@ readV1ColorTable(FILE * const ifP, char * t1; char * t2; - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); if ((t1 = strchr(line, '"')) == NULL) pm_error("D error scanning color table"); @@ -628,7 +628,7 @@ readXpm1Header(FILE * const ifP, unsigned int ** const ptabP) { /*---------------------------------------------------------------------------- Read the header of the XPM file on stream *ifP. Assume the - getline() stream is presently positioned to the beginning of the + getLine() stream is presently positioned to the beginning of the file and it is a Version 1 XPM file. Leave the stream positioned after the header. @@ -649,7 +649,7 @@ readXpm1Header(FILE * const ifP, char line[MAX_LINE+1]; char str1[MAX_LINE+1]; - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); if (sscanf(line, "#define %s %d", str1, &v) == 2) { if ((t1 = strrchr(str1, '_')) == NULL) @@ -700,7 +700,7 @@ readXpm1Header(FILE * const ifP, if (strneq(t1, "mono", 4)) { for (;;) { char line[MAX_LINE+1]; - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); if (strneq(line, "static char", 11)) break; } @@ -712,7 +712,7 @@ readXpm1Header(FILE * const ifP, */ for (;;) { char line[MAX_LINE+1]; - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); if (strneq(line, "static char", 11)) break; } @@ -837,7 +837,7 @@ readXpmFile(FILE * const ifP, backup = FALSE; /* Read the header line */ - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); backup = TRUE; /* back up so next read reads this line again */ rc = sscanf(line, "/* %s */", str1); @@ -857,7 +857,7 @@ readXpmFile(FILE * const ifP, pm_error("Could not get %u bytes of memory for image", totalpixels); cursor = &data[0]; maxCursor = &data[totalpixels - 1]; - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); /* read next line (first line may not always start with comment) */ while (cursor <= maxCursor) { if (strneq(line, "/*", 2)) { @@ -867,7 +867,7 @@ readXpmFile(FILE * const ifP, &cursor); } if (cursor <= maxCursor) - getline(line, sizeof(line), ifP); + getLine(line, sizeof(line), ifP); } if (ptab) free(ptab); *dataP = data; diff --git a/doc/HISTORY b/doc/HISTORY index b9d39af0..f4f575b7 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -15,6 +15,9 @@ not yet BJH Release 10.60.00 pamtosrf: fix storage corruption. Always broken (program added in 10.55 (June 2011). + Build: rename getline() in xpmtoppm.c to avoid collision + with some libc. Always broken. + 12.06.28 BJH Release 10.59.00 pamtogif: Make data blocks 255 bytes instead of 254. 255 is |