Skip to content

Commit

Permalink
Fix compiler warning for unused local variables
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jan 24, 2024
1 parent 0d44776 commit a58a745
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/gplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,8 +1206,8 @@ GPLOT *
gplotRead(const char *filename)
{
char buf[Bufsize];
char *rootname, *title, *xlabel, *ylabel, *ignores;
l_int32 outformat, ret, version, ignore;
char *rootname, *title, *xlabel, *ylabel;
l_int32 outformat, ret, version;
FILE *fp;
GPLOT *gplot;

Expand All @@ -1230,16 +1230,16 @@ GPLOT *gplot;
filename, __func__, NULL);
}

ignore = fscanf(fp, "Rootname: %511s\n", buf); /* Bufsize - 1 */
(void)fscanf(fp, "Rootname: %511s\n", buf); /* Bufsize - 1 */
rootname = stringNew(buf);
ignore = fscanf(fp, "Output format: %d\n", &outformat);
ignores = fgets(buf, Bufsize, fp); /* Title: ... */
(void)fscanf(fp, "Output format: %d\n", &outformat);
(void)fgets(buf, Bufsize, fp); /* Title: ... */
title = stringNew(buf + 7);
title[strlen(title) - 1] = '\0';
ignores = fgets(buf, Bufsize, fp); /* X axis label: ... */
(void)fgets(buf, Bufsize, fp); /* X axis label: ... */
xlabel = stringNew(buf + 14);
xlabel[strlen(xlabel) - 1] = '\0';
ignores = fgets(buf, Bufsize, fp); /* Y axis label: ... */
(void)fgets(buf, Bufsize, fp); /* Y axis label: ... */
ylabel = stringNew(buf + 14);
ylabel[strlen(ylabel) - 1] = '\0';

Expand All @@ -1258,23 +1258,23 @@ GPLOT *gplot;
sarrayDestroy(&gplot->plotlabels);
numaDestroy(&gplot->plotstyles);

ignore = fscanf(fp, "Commandfile name: %s\n", buf); /* Bufsize - 1 */
(void)fscanf(fp, "Commandfile name: %s\n", buf); /* Bufsize - 1 */
stringReplace(&gplot->cmdname, buf);
ignore = fscanf(fp, "\nCommandfile data:");
(void)fscanf(fp, "\nCommandfile data:");
gplot->cmddata = sarrayReadStream(fp);
ignore = fscanf(fp, "\nDatafile names:");
(void)fscanf(fp, "\nDatafile names:");
gplot->datanames = sarrayReadStream(fp);
ignore = fscanf(fp, "\nPlot data:");
(void)fscanf(fp, "\nPlot data:");
gplot->plotdata = sarrayReadStream(fp);
ignore = fscanf(fp, "\nPlot titles:");
(void)fscanf(fp, "\nPlot titles:");
gplot->plotlabels = sarrayReadStream(fp);
ignore = fscanf(fp, "\nPlot styles:");
(void)fscanf(fp, "\nPlot styles:");
gplot->plotstyles = numaReadStream(fp);

ignore = fscanf(fp, "Number of plots: %d\n", &gplot->nplots);
ignore = fscanf(fp, "Output file name: %s\n", buf);
(void)fscanf(fp, "Number of plots: %d\n", &gplot->nplots);
(void)fscanf(fp, "Output file name: %s\n", buf);
stringReplace(&gplot->outname, buf);
ignore = fscanf(fp, "Axis scaling: %d\n", &gplot->scaling);
(void)fscanf(fp, "Axis scaling: %d\n", &gplot->scaling);

fclose(fp);
return gplot;
Expand Down

0 comments on commit a58a745

Please sign in to comment.