FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Final cleanups and fixes. · gnuplot/gnuplot@fb27ec0 · GitHub

Repository navigation

Commit fb27ec0

Browse files
Lars Hecking
committed
Final cleanups and fixes.
1 parent 1aaf1b3 commit fb27ec0

5 files changed

Lines changed: 26 additions & 22 deletions

File tree

‎docs/doc2gih.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include "ansichek.h"
5757
#include "stdfn.h"
5858

59-
#define MAX_LINE_LEN 256
59+
#define MAX_LINE_LEN 255
6060
#ifdef TRUE
6161
# undef TRUE
6262
# undef FALSE
@@ -77,7 +77,7 @@ int main(argc, argv)
7777
int argc;
7878
char **argv;
7979
{
80-
char line[MAX_LINE_LEN + 1];
80+
char line[MAX_LINE_LEN+1];
8181
FILE *infile;
8282
FILE *outfile;
8383

‎docs/doc2hlp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static char *RCSid = "$Id: doc2hlp.c,v 1.15 1998/04/14 00:16:58 drd Exp $";
5555
#include "ansichek.h"
5656
#include "stdfn.h"
5757

58-
#define MAX_LINE_LEN 256
58+
#define MAX_LINE_LEN 255
5959
#ifdef TRUE
6060
# undef TRUE
6161
# undef FALSE
@@ -76,7 +76,7 @@ int main(argc, argv)
7676
int argc;
7777
char **argv;
7878
{
79-
char line[MAX_LINE_LEN + 1];
79+
char line[MAX_LINE_LEN+1];
8080
FILE *infile;
8181
FILE *outfile;
8282

‎docs/doc2info.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@
5656

5757
#include "ansichek.h"
5858
#include "stdfn.h"
59-
#include "xref.h"
6059

61-
#undef MAX_LINE_LEN
6260
#define MAX_LINE_LEN 255
61+
#include "xref.h"
6362

6463
struct BUFFER { /* buffer to reformat paragraphs with xrefs */
6564
char *content;

‎docs/doc2ipf.c‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ static char *RCSid = "$Id: doc2ipf.c,v 1.20 1998/04/14 00:16:59 drd Exp $";
5353

5454
#include "ansichek.h"
5555
#include "stdfn.h"
56+
#include "xref.h"
5657

57-
#define MAX_LINE_LEN 1023
5858
#define MAX_COL 6
5959
#ifdef TRUE
6060
# undef TRUE
@@ -63,8 +63,13 @@ static char *RCSid = "$Id: doc2ipf.c,v 1.20 1998/04/14 00:16:59 drd Exp $";
6363
#define TRUE 1
6464
#define FALSE 0
6565

66-
#include "termdoc.c"
67-
#include "xref.c"
66+
/* Replase the previous #ifdef */
67+
int single_top_level = 0;
68+
69+
/* We are using the fgets() replacement from termdoc.c */
70+
extern char *get_line __PROTO((char *, int, FILE *));
71+
/* From xref.c */
72+
extern void *xmalloc __PROTO((size_t));
6873

6974
void convert __PROTO((FILE * a, FILE * b));
7075
void process_line __PROTO((char *line, FILE * b));
@@ -76,12 +81,10 @@ struct TABENTRY { /* may have MAX_COL column tables */
7681
char col[MAX_COL][256];
7782
};
7883

79-
struct TABENTRY table =
80-
{NULL};
84+
struct TABENTRY table = { NULL };
8185
struct TABENTRY *tableins = &table;
8286
int tablecols = 0;
83-
int tablewidth[MAX_COL] =
84-
{0, 0, 0, 0, 0, 0}; /* there must be the correct */
87+
int tablewidth[MAX_COL] = {0, 0, 0, 0, 0, 0}; /* there must be the correct */
8588
int tablelines = 0; /* number of zeroes here */
8689

8790
int debug = FALSE;
@@ -98,20 +101,22 @@ char **argv;
98101

99102
if (argc != 3 && !debug) {
100103
fprintf(stderr, "Usage: %s infile outfile\n", argv[0]);
101-
return (1);
104+
exit(EXIT_FAILURE);
102105
}
103106
if ((infile = fopen(argv[1], "r")) == (FILE *) NULL) {
104107
fprintf(stderr, "%s: Can't open %s for reading\n",
105108
argv[0], argv[1]);
106-
return (1);
109+
exit(EXIT_FAILURE);
107110
}
108111
if ((outfile = fopen(argv[2], "w")) == (FILE *) NULL) {
109112
fprintf(stderr, "%s: Can't open %s for writing\n",
110113
argv[0], argv[2]);
114+
fclose(infile);
115+
exit(EXIT_FAILURE);
111116
}
112117
parse(infile);
113118
convert(infile, outfile);
114-
return (0);
119+
exit(EXIT_SUCCESS);
115120
}
116121

117122
void convert(a, b)
@@ -174,12 +179,12 @@ FILE *b;
174179
nblanks = 0;
175180
while (line[nblanks] == ' ')
176181
++nblanks;
177-
while (line[i] != '\0') {
182+
while (line[i] != NUL) {
178183
if (introffheader) {
179184
if (line[i] != '\n')
180185
line2[j] = line[i];
181186
else
182-
line2[j] = '\0';
187+
line2[j] = NUL;
183188
} else
184189
switch (line[i]) {
185190
case '$':
@@ -275,7 +280,7 @@ FILE *b;
275280
fprintf(stderr, "Possible missing link character (`) near above line number\n");
276281
abort();
277282
}
278-
line2[j] = '\0';
283+
line2[j] = NUL;
279284
}
280285

281286
i = 1;
@@ -364,7 +369,7 @@ FILE *b;
364369
tabledelim[1] = tablechar;
365370
line2[0] = tablechar;
366371
while ((pt = strtok(tablerow, tabledelim + 1)) != NULL) {
367-
if (*pt != '\0') { /* ignore null columns */
372+
if (*pt != NUL) { /* ignore null columns */
368373
/* this fails on format line */
369374
assert(j < MAX_COL);
370375
strcpy(tableins->col[j], pt);
@@ -378,7 +383,7 @@ FILE *b;
378383
}
379384
}
380385
for (j; j < MAX_COL; j++)
381-
tableins->col[j][0] = '\0';
386+
tableins->col[j][0] = NUL;
382387
}
383388
break; /* ignore */
384389
}

‎docs/doc2ms.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ FILE *file;
285285
{
286286
static boolean inquote = FALSE;
287287

288-
while (*s != '\0') {
288+
while (*s != NUL) {
289289
switch (*s) {
290290
case '`':{ /* backquote -> boldface */
291291
if (inquote) {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL