summaryrefslogtreecommitdiff
path: root/graphics/netpbm/patches/patch-eb
blob: 0cdb2fe278f4860ff7ae5159398980de03d13ab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
$NetBSD: patch-eb,v 1.2 2010/07/13 06:08:23 adam Exp $

--- converter/ppm/xpmtoppm.c.orig	2009-12-29 20:46:34.000000000 +0000
+++ converter/ppm/xpmtoppm.c
@@ -121,7 +121,7 @@ static bool backup;
 
 
 static void
-getline(char * const line,
+get_line(char * const line,
         size_t const size,
         FILE * const stream) {
 /*----------------------------------------------------------------------------
@@ -139,7 +139,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: get_line() received 'size' parameter "
                  "which is out of bounds");
 
     if (backup) {
@@ -355,7 +355,7 @@ readXpm3Header(FILE * const stream, int 
                int * const transparentP) {
 /*----------------------------------------------------------------------------
   Read the header of the XPM file on stream 'stream'.  Assume the
-  getline() stream is presently positioned to the beginning of the
+  get_line() 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.
 
@@ -386,25 +386,25 @@ readXpm3Header(FILE * const stream, int 
     *widthP = *heightP = *ncolorsP = *chars_per_pixelP = -1;
 
     /* Read the XPM signature comment */
-    getline(line, sizeof(line), stream);
+    get_line(line, sizeof(line), stream);
     if (strncmp(line, xpm3_signature, strlen(xpm3_signature)) != 0) 
         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), stream);
+    get_line(line, sizeof(line), stream);
     if (strncmp(line, "static char", 11) != 0)
         pm_error("Cannot find data structure declaration.  Expected a "
                  "line starting with 'static char', but found the line "
                  "'%s'.", line);
 
 	/* Read the hints line */
-    getline(line, sizeof(line), stream);
+    get_line(line, sizeof(line), stream);
     /* skip the comment line if any */
     if (!strncmp(line, "/*", 2)) {
         while (!strstr(line, "*/"))
-            getline(line, sizeof(line), stream);
-        getline(line, sizeof(line), stream);
+            get_line(line, sizeof(line), stream);
+        get_line(line, sizeof(line), stream);
     }
     if (sscanf(line, "\"%d %d %d %d\",", widthP, heightP,
                ncolorsP, chars_per_pixelP) != 4)
@@ -438,10 +438,10 @@ readXpm3Header(FILE * const stream, int 
         *transparentP = -1;  /* initial value */
 
         for (seqNum = 0; seqNum < *ncolorsP; seqNum++) {
-            getline(line, sizeof(line), stream);
+            get_line(line, sizeof(line), stream);
             /* skip the comment line if any */
             if (!strncmp(line, "/*", 2))
-                getline(line, sizeof(line), stream);
+                get_line(line, sizeof(line), stream);
             
             interpretXpm3ColorTableLine(line, seqNum, *chars_per_pixelP, 
                                         *colorsP, *ptabP, transparentP);
@@ -456,7 +456,7 @@ readXpm1Header(FILE * const stream, int 
                pixel ** const colorsP, int ** const ptabP) {
 /*----------------------------------------------------------------------------
   Read the header of the XPM file on stream 'stream'.  Assume the
-  getline() stream is presently positioned to the beginning of the
+  get_line() 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.
   
@@ -476,7 +476,7 @@ readXpm1Header(FILE * const stream, int 
     /* Read the initial defines. */
     processedStaticChar = FALSE;
     while (!processedStaticChar) {
-        getline(line, sizeof(line), stream);
+        get_line(line, sizeof(line), stream);
 
         if (sscanf(line, "#define %s %d", str1, &v) == 2) {
             char *t1;
@@ -524,7 +524,7 @@ readXpm1Header(FILE * const stream, int 
     /* If there's a monochrome color table, skip it. */
     if (!strncmp(t1, "mono", 4)) {
         for (;;) {
-            getline(line, sizeof(line), stream);
+            get_line(line, sizeof(line), stream);
             if (!strncmp(line, "static char", 11))
                 break;
         }
@@ -547,7 +547,7 @@ readXpm1Header(FILE * const stream, int 
 
     /* Read color table. */
     for (i = 0; i < *ncolorsP; ++i) {
-        getline(line, sizeof(line), stream);
+        get_line(line, sizeof(line), stream);
 
         if ((t1 = strchr(line, '"')) == NULL)
             pm_error("D error scanning color table");
@@ -583,7 +583,7 @@ readXpm1Header(FILE * const stream, int 
        "static char ...").
     */
     for (;;) {
-        getline(line, sizeof(line), stream);
+        get_line(line, sizeof(line), stream);
         if (strncmp(line, "static char", 11) == 0)
             break;
     }
@@ -687,7 +687,7 @@ ReadXPMFile(FILE * const stream, int * c
     backup = FALSE;
 
     /* Read the header line */
-    getline(line, sizeof(line), stream);
+    get_line(line, sizeof(line), stream);
     backup = TRUE;  /* back up so next read reads this line again */
     
     rc = sscanf(line, "/* %s */", str1);
@@ -707,7 +707,7 @@ ReadXPMFile(FILE * const stream, int * c
         pm_error("Could not get %d bytes of memory for image", totalpixels);
     cursor = *dataP;
     maxcursor = *dataP + totalpixels - 1;
-	getline(line, sizeof(line), stream); 
+	get_line(line, sizeof(line), stream); 
         /* read next line (first line may not always start with comment) */
     while (cursor <= maxcursor) {
         if (strncmp(line, "/*", 2) == 0) {
@@ -717,7 +717,7 @@ ReadXPMFile(FILE * const stream, int * c
                              ncolors, ptab, &cursor, maxcursor);
         }
         if (cursor <= maxcursor)
-            getline(line, sizeof(line), stream);
+            get_line(line, sizeof(line), stream);
     }
     if (ptab) free(ptab);
 }