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

Includes, local vars shadowing fixed. · gnuplot/gnuplot-old@38bac87 · GitHub

Repository navigation

Commit 38bac87

Browse files
lhecking
committed
Includes, local vars shadowing fixed.
1 parent 34f1bb7 commit 38bac87

2 files changed

Lines changed: 46 additions & 33 deletions

File tree

‎src/fit.c‎

Lines changed: 17 additions & 10 deletions
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.16 1999/10/01 14:54:30 lhecking Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: fit.c,v 1.17 1999/10/29 18:50:55 lhecking Exp $"); }
33
#endif
44

55
/* NOTICE: Change of Copyright Status
@@ -62,10 +62,17 @@ static char *RCSid() { return RCSid("$Id: fit.c,v 1.16 1999/10/01 14:54:30 lheck
6262
#include <signal.h>
6363

6464
#include "plot.h"
65-
#include "matrix.h"
66-
#include "fit.h"
67-
#include "setshow.h" /* for load_range */
6865
#include "alloc.h"
66+
#include "command.h"
67+
#include "datafile.h"
68+
#include "eval.h"
69+
#include "fit.h"
70+
#include "graphics.h"
71+
#include "matrix.h"
72+
#include "misc.h"
73+
#include "parse.h"
74+
#include "setshow.h"
75+
#include "util.h"
6976

7077
/* Just temporary */
7178
#if defined(VA_START) && defined(ANSI_C)
@@ -683,22 +690,22 @@ double a[];
683690
/* compute errors in the parameters */
684691

685692
if (num_data == num_params) {
686-
int i;
693+
int k;
687694

688695
Dblf("\nExactly as many data points as there are parameters.\n");
689696
Dblf("In this degenerate case, all errors are zero by definition.\n\n");
690697
Dblf("Final set of parameters \n");
691698
Dblf("======================= \n\n");
692-
for (i = 0; i < num_params; i++)
693-
Dblf3("%-15.15s = %-15g\n", par_name[i], a[i]);
699+
for (k = 0; k < num_params; k++)
700+
Dblf3("%-15.15s = %-15g\n", par_name[k], a[k]);
694701
} else if (chisq < NEARLY_ZERO) {
695-
int i;
702+
int k;
696703

697704
Dblf("\nHmmmm.... Sum of squared residuals is zero. Can't compute errors.\n\n");
698705
Dblf("Final set of parameters \n");
699706
Dblf("======================= \n\n");
700-
for (i = 0; i < num_params; i++)
701-
Dblf3("%-15.15s = %-15g\n", par_name[i], a[i]);
707+
for (k = 0; k < num_params; k++)
708+
Dblf3("%-15.15s = %-15g\n", par_name[k], a[k]);
702709
} else {
703710
Dblf2("degrees of freedom (ndf) : %d\n", num_data - num_params);
704711
Dblf2("rms of residuals (stdfit) = sqrt(WSSR/ndf) : %g\n", sqrt(chisq /

‎src/graph3d.c‎

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef lint
2-
static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.16 1999/10/21 21:05:18 lhecking Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.17 1999/10/29 18:51:21 lhecking Exp $"); }
33
#endif
44

55
/* GNUPLOT - graph3d.c */
@@ -51,9 +51,15 @@ static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.16 1999/10/21 21:05:18 l
5151
*/
5252

5353
#include "plot.h"
54-
#include "graph3d.h" /* HBB 990826: new file */
54+
#include "alloc.h"
55+
#include "graph3d.h"
56+
#include "graphics.h"
5557
#include "hidden3d.h"
58+
#include "misc.h"
5659
#include "setshow.h"
60+
#include "term_api.h"
61+
#include "util.h"
62+
#include "util3d.h"
5763

5864
static int p_height;
5965
static int p_width; /* pointsize * t->h_tic */
@@ -235,7 +241,7 @@ struct lp_style_type style;
235241
}
236242

237243
/* And the functions to map from user 3D space to terminal coordinates */
238-
void
244+
static void
239245
map3d_xy(x, y, z, xt, yt)
240246
double x, y, z;
241247
unsigned int *xt, *yt;
@@ -1003,8 +1009,8 @@ static void
10031009
plot3d_impulses(plot)
10041010
struct surface_points *plot;
10051011
{
1006-
int i; /* point index */
1007-
unsigned int x, y, x0, y0; /* point in terminal coordinates */
1012+
int i; /* point index */
1013+
unsigned int x, y, xx0, yy0; /* point in terminal coordinates */
10081014
struct iso_curve *icrvs = plot->iso_crvs;
10091015

10101016
while (icrvs) {
@@ -1017,14 +1023,14 @@ struct surface_points *plot;
10171023
map3d_xy(points[i].x, points[i].y, points[i].z, &x, &y);
10181024

10191025
if (inrange(0.0, min3d_z, max3d_z)) {
1020-
map3d_xy(points[i].x, points[i].y, 0.0, &x0, &y0);
1026+
map3d_xy(points[i].x, points[i].y, 0.0, &xx0, &yy0);
10211027
} else if (inrange(min3d_z, 0.0, points[i].z)) {
1022-
map3d_xy(points[i].x, points[i].y, min3d_z, &x0, &y0);
1028+
map3d_xy(points[i].x, points[i].y, min3d_z, &xx0, &yy0);
10231029
} else {
1024-
map3d_xy(points[i].x, points[i].y, max3d_z, &x0, &y0);
1030+
map3d_xy(points[i].x, points[i].y, max3d_z, &xx0, &yy0);
10251031
}
10261032

1027-
clip_move(x0, y0);
1033+
clip_move(xx0, yy0);
10281034
clip_vector(x, y);
10291035

10301036
break;
@@ -1037,7 +1043,7 @@ struct surface_points *plot;
10371043

10381044
if (inrange(0.0, min3d_z, max3d_z)) {
10391045
/* zero point is INRANGE */
1040-
map3d_xy(points[i].x, points[i].y, 0.0, &x0, &y0);
1046+
map3d_xy(points[i].x, points[i].y, 0.0, &xx0, &yy0);
10411047

10421048
/* must cross z = min3d_z or max3d_z limits */
10431049
if (inrange(min3d_z, 0.0, points[i].z) &&
@@ -1052,14 +1058,14 @@ struct surface_points *plot;
10521058
inrange(max3d_z, 0.0, points[i].z)) {
10531059
/* crosses z = min3d_z or max3d_z limits */
10541060
map3d_xy(points[i].x, points[i].y, max3d_z, &x, &y);
1055-
map3d_xy(points[i].x, points[i].y, min3d_z, &x0, &y0);
1061+
map3d_xy(points[i].x, points[i].y, min3d_z, &xx0, &yy0);
10561062
} else {
10571063
/* doesn't cross z = min3d_z or max3d_z limits */
10581064
break;
10591065
}
10601066
}
10611067

1062-
clip_move(x0, y0);
1068+
clip_move(xx0, yy0);
10631069
clip_vector(x, y);
10641070

10651071
break;
@@ -1087,7 +1093,7 @@ plot3d_lines(plot)
10871093
struct surface_points *plot;
10881094
{
10891095
int i;
1090-
unsigned int x, y, x0, y0; /* point in terminal coordinates */
1096+
unsigned int x, y, xx0, yy0; /* point in terminal coordinates */
10911097
double clip_x, clip_y, clip_z;
10921098
struct iso_curve *icrvs = plot->iso_crvs;
10931099
struct coordinate GPHUGE *points;
@@ -1122,9 +1128,9 @@ struct surface_points *plot;
11221128
*/
11231129
edge3d_intersect(points, i, &clip_x, &clip_y, &clip_z);
11241130

1125-
map3d_xy(clip_x, clip_y, clip_z, &x0, &y0);
1131+
map3d_xy(clip_x, clip_y, clip_z, &xx0, &yy0);
11261132

1127-
clip_move(x0, y0);
1133+
clip_move(xx0, yy0);
11281134
clip_vector(x, y);
11291135
}
11301136
} else {
@@ -1145,9 +1151,9 @@ struct surface_points *plot;
11451151

11461152
edge3d_intersect(points, i, &clip_x, &clip_y, &clip_z);
11471153

1148-
map3d_xy(clip_x, clip_y, clip_z, &x0, &y0);
1154+
map3d_xy(clip_x, clip_y, clip_z, &xx0, &yy0);
11491155

1150-
clip_vector(x0, y0);
1156+
clip_vector(xx0, yy0);
11511157
}
11521158
} else if (prev == OUTRANGE) {
11531159
/* from outrange to outrange */
@@ -1160,10 +1166,10 @@ struct surface_points *plot;
11601166

11611167
map3d_xy(lx[0], ly[0], lz[0], &x, &y);
11621168

1163-
map3d_xy(lx[1], ly[1], lz[1], &x0, &y0);
1169+
map3d_xy(lx[1], ly[1], lz[1], &xx0, &yy0);
11641170

11651171
clip_move(x, y);
1166-
clip_vector(x0, y0);
1172+
clip_vector(xx0, yy0);
11671173
}
11681174
}
11691175
}
@@ -1247,17 +1253,17 @@ cntr3d_impulses(cntr, plot)
12471253
struct gnuplot_contours *cntr;
12481254
struct surface_points *plot;
12491255
{
1250-
int i; /* point index */
1251-
unsigned int x, y, x0, y0; /* point in terminal coordinates */
1256+
int i; /* point index */
1257+
unsigned int x, y, xx0, yy0; /* point in terminal coordinates */
12521258

12531259
if (draw_contour & CONTOUR_SRF) {
12541260
for (i = 0; i < cntr->num_pts; i++) {
12551261
map3d_xy(cntr->coords[i].x, cntr->coords[i].y, cntr->coords[i].z,
12561262
&x, &y);
12571263
map3d_xy(cntr->coords[i].x, cntr->coords[i].y, base_z,
1258-
&x0, &y0);
1264+
&xx0, &yy0);
12591265

1260-
clip_move(x0, y0);
1266+
clip_move(xx0, yy0);
12611267
clip_vector(x, y);
12621268
}
12631269
} else {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL