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

new return code DF_MISSING from df_readline · gnuplot/gnuplot@1d7f732 · GitHub

Repository navigation

Commit 1d7f732

Browse files
Ethan Merritt
committed
new return code DF_MISSING from df_readline
1 parent 70d622d commit 1d7f732

6 files changed

Lines changed: 30 additions & 8 deletions

File tree

‎ChangeLog‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2004-06-12 Ethan Merritt <merritt@u.washington.edu>
2+
3+
* datafile.h: define DF_MISSING as a return code from df_readline().
4+
* datatile.c (df_readline): If a data field contains the missing data
5+
string, return DF_MISSING rather than DF_UNDEFINED.
6+
* fit.c (fit_command): Explicitly ignore DF_MISSING data.
7+
* plot2d.c (get_data): Explicitly test for data marked DF_MISSING
8+
but treat it the same as DF_UNDEFINED.
9+
* plot3d.c (get_3ddata): Explicitly test for data marked DF_MISSING
10+
but treat it the same as DF_UNDEFINED.
11+
12+
These are trivial changes that do not affect the existing behavior of
13+
gnuplot. However, the core routines in plot2d and plot3d now have the
14+
information needed to treat missing data differently depending on the
15+
plot style if desired.
16+
117
2004-06-06 Ethan Merritt <merritt@u.washington.edu>
218

319
* src/command.c src/command.h src/mouse.c src/gplt_x11.c

‎src/datafile.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef lint
2-
static char *RCSid() { return RCSid("$Id: datafile.c,v 1.49 2004/04/13 17:23:52 broeker Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: datafile.c,v 1.50 2004/06/01 16:20:03 broeker Exp $"); }
33
#endif
44

55
/* GNUPLOT - datafile.c */
@@ -263,7 +263,7 @@ static char df_format[MAX_LINE_LEN + 1];
263263
typedef struct df_column_struct {
264264
double datum;
265265
enum {
266-
DF_MISSING, DF_BAD, DF_GOOD
266+
DF_BAD, DF_GOOD
267267
} good;
268268
char *position;
269269
} df_column_struct;
@@ -1165,7 +1165,7 @@ int max;
11651165
* noted also, but that would change existing default behavior.
11661166
*/
11671167
else if ((column <= df_no_cols) && (df_column[column - 1].good == DF_MISSING))
1168-
return DF_UNDEFINED;
1168+
return DF_MISSING;
11691169
else {
11701170
/* line bad only if user explicitly asked for this column */
11711171
if (df_no_use_specs)

‎src/datafile.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: datafile.h,v 1.10 2003/04/29 07:04:29 mikulik Exp $
2+
* $Id: datafile.h,v 1.11 2004/04/13 17:23:53 broeker Exp $
33
*/
44

55
/* GNUPLOT - datafile.h */
@@ -49,6 +49,7 @@
4949
#define DF_UNDEFINED (-2)
5050
#define DF_FIRST_BLANK (-3)
5151
#define DF_SECOND_BLANK (-4)
52+
#define DF_MISSING (-5)
5253

5354
#ifndef MAXINT /* should there be one already defined ? */
5455
# ifdef INT_MAX /* in limits.h ? */

‎src/fit.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef lint
2-
static char *RCSid() { return RCSid("$Id: fit.c,v 1.38 2004/04/10 14:28:02 broeker Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: fit.c,v 1.39 2004/04/13 17:23:53 broeker Exp $"); }
33
#endif
44

55
/* NOTICE: Change of Copyright Status
@@ -1416,6 +1416,7 @@ fit_command()
14161416
} /* if (need to extend storage space) */
14171417

14181418
switch (i) {
1419+
case DF_MISSING:
14191420
case DF_UNDEFINED:
14201421
case DF_FIRST_BLANK:
14211422
case DF_SECOND_BLANK:

‎src/plot2d.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef lint
2-
static char *RCSid() { return RCSid("$Id: plot2d.c,v 1.65 2004/05/20 14:43:47 broeker Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: plot2d.c,v 1.66 2004/05/20 16:56:43 broeker Exp $"); }
33
#endif
44

55
/* GNUPLOT - plot2d.c */
@@ -341,6 +341,10 @@ get_data(current_plot)
341341
df_close();
342342
int_error(c_token, "internal error : df_readline returned %d : datafile line %d", j, df_line_number);
343343
}
344+
345+
case DF_MISSING:
346+
/* Plot type specific handling of missing points could go here. */
347+
/* For now missing data is treated the same as undefined */
344348
case DF_UNDEFINED:
345349
/* bad result from extended using expression */
346350
current_plot->points[i].type = UNDEFINED;

‎src/plot3d.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef lint
2-
static char *RCSid() { return RCSid("$Id: plot3d.c,v 1.65 2004/02/23 13:29:34 broeker Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: plot3d.c,v 1.66 2004/04/13 17:23:59 broeker Exp $"); }
33
#endif
44

55
/* GNUPLOT - plot3d.c */
@@ -707,7 +707,7 @@ get_3ddata(this_plot)
707707
}
708708
cp = local_this_iso->points + xdatum;
709709

710-
if (j == DF_UNDEFINED) {
710+
if (j == DF_UNDEFINED || j == DF_MISSING) {
711711
cp->type = UNDEFINED;
712712
continue;
713713
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL