Some code cleanup
This commit is contained in:
parent
f928b61bea
commit
d735c9a871
|
|
@ -62,7 +62,7 @@ hlp_read(fplace *place)
|
|||
wordlist *wl, *end = NULL;
|
||||
int i, fchanges;
|
||||
char *s;
|
||||
bool mof;
|
||||
bool mof = FALSE;
|
||||
|
||||
if (!place)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ clip_line(int *pX1, int *pY1, int *pX2, int *pY2, int l, int b, int r, int t)
|
|||
int y1 = *pY1;
|
||||
int x2 = *pX2;
|
||||
int y2 = *pY2;
|
||||
int x,y,c,c1,c2;
|
||||
int x = 0, y = 0;
|
||||
int c,c1,c2;
|
||||
|
||||
CODE(x1,y1,c1)
|
||||
CODE(x2,y2,c2)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Author: 1988 Jeffrey M. Hsu
|
|||
#include "ftedev.h"
|
||||
#include <terminal.h>
|
||||
#include <variable.h>
|
||||
|
||||
#include "../terminal.h"
|
||||
#include "graf.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis)
|
|||
int mag, mag2, mag3;
|
||||
double hmt, lmt, dst;
|
||||
int nsp;
|
||||
double tenpowmag, tenpowmag2, step, spacing;
|
||||
double tenpowmag = 0.0, tenpowmag2, step, spacing;
|
||||
bool onedec = FALSE;
|
||||
int margin;
|
||||
int max;
|
||||
|
|
@ -1111,7 +1111,7 @@ drawsmithgrid(GRAPH *graph)
|
|||
{
|
||||
double mx, my, tenpowmag, d, dphi[CMAX], minrad, maxrad, rnorm[CMAX];
|
||||
double pixperunit;
|
||||
int mag, i, j, k;
|
||||
int mag, i = 0, j = 0, k;
|
||||
double ir[CMAX], rr[CMAX], ki[CMAX], kr[CMAX], ks[CMAX];
|
||||
int xoff, yoff, zheight;
|
||||
int basemag, plen;
|
||||
|
|
@ -1405,7 +1405,7 @@ static double
|
|||
cliparc(double cx, double cy, double rad, double start, double end, int iclipx, int iclipy, int icliprad, int flag)
|
||||
{
|
||||
double clipx, clipy, cliprad;
|
||||
double sclip, eclip;
|
||||
double sclip = 0.0, eclip = 0.0;
|
||||
double x, y, tx, ty, dist;
|
||||
double alpha, theta, phi, a1, a2, d, l;
|
||||
bool in;
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart)
|
|||
register int i, j, l;
|
||||
double *scratch, *result, *gridbuf, *mm;
|
||||
register double *xdata, *ydata;
|
||||
bool rot, increasing;
|
||||
double dx, dy, lx = 0, ly = 0;
|
||||
bool rot, increasing = FALSE;
|
||||
double dx = 0.0, dy = 0.0, lx = 0.0, ly = 0.0;
|
||||
int dir;
|
||||
|
||||
/* if already started, use saved degree */
|
||||
|
|
|
|||
|
|
@ -369,13 +369,13 @@ X11_NewViewport(GRAPH *graph)
|
|||
viewargs,
|
||||
XtNumber(viewargs));
|
||||
XtAddEventHandler(DEVDEP(graph).view, ButtonPressMask, FALSE,
|
||||
handlebuttonev, graph);
|
||||
(XtEventHandler) handlebuttonev, graph);
|
||||
XtAddEventHandler(DEVDEP(graph).view, KeyPressMask, FALSE,
|
||||
handlekeypressed, graph);
|
||||
(XtEventHandler) handlekeypressed, graph);
|
||||
XtAddEventHandler(DEVDEP(graph).view, StructureNotifyMask, FALSE,
|
||||
resize, graph);
|
||||
(XtEventHandler) resize, graph);
|
||||
XtAddEventHandler(DEVDEP(graph).view, ExposureMask, FALSE,
|
||||
redraw, graph);
|
||||
(XtEventHandler) redraw, graph);
|
||||
|
||||
/* set up button box */
|
||||
XtSetArg(bboxargs[1], XtNfromHoriz, DEVDEP(graph).view);
|
||||
|
|
@ -388,14 +388,14 @@ X11_NewViewport(GRAPH *graph)
|
|||
DEVDEP(graph).buttons[0] = XtCreateManagedWidget("quit",
|
||||
commandWidgetClass, DEVDEP(graph).buttonbox,
|
||||
buttonargs, 1);
|
||||
XtAddCallback(DEVDEP(graph).buttons[0], XtNcallback, killwin, graph);
|
||||
XtAddCallback(DEVDEP(graph).buttons[0], XtNcallback, (XtCallbackProc) killwin, graph);
|
||||
|
||||
XtSetArg(buttonargs[0], XtNlabel, "hardcopy");
|
||||
XtSetArg(bboxargs[1], XtNfromVert, DEVDEP(graph).buttons[0]);
|
||||
DEVDEP(graph).buttons[1] = XtCreateManagedWidget("hardcopy",
|
||||
commandWidgetClass, DEVDEP(graph).buttonbox,
|
||||
buttonargs, 1);
|
||||
XtAddCallback(DEVDEP(graph).buttons[1], XtNcallback, hardcopy, graph);
|
||||
XtAddCallback(DEVDEP(graph).buttons[1], XtNcallback, (XtCallbackProc) hardcopy, graph);
|
||||
|
||||
/* set up fonts */
|
||||
if (!cp_getvar("font", VT_STRING, fontname)) {
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ cp_remvar(char *varname)
|
|||
/* Determine the value of a variable. Fail if the variable is unset,
|
||||
* and if the type doesn't match, try and make it work... */
|
||||
bool
|
||||
cp_getvar(char *name, int type, char *retval)
|
||||
cp_getvar(char *name, int type, void *retval)
|
||||
{
|
||||
struct variable *v;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ wordlist * cp_varwl(struct variable *var);
|
|||
void cp_vset(char *varname, char type, char *value);
|
||||
struct variable * cp_setparse(wordlist *wl);
|
||||
void cp_remvar(char *varname);
|
||||
bool cp_getvar(char *name, int type, char *retval);
|
||||
bool cp_getvar(char *name, int type, void *retval);
|
||||
wordlist * cp_variablesubst(wordlist *wlist);
|
||||
wordlist * vareval(char *string);
|
||||
void cp_vprint(void);
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ extern void cp_vprint(void);
|
|||
extern void com_set(wordlist *wl);
|
||||
extern void com_unset(wordlist *wl);
|
||||
extern void com_shift(wordlist *wl);
|
||||
extern bool cp_getvar(char *name, int type, char *retval);
|
||||
extern bool cp_getvar(char *name, int type, void *retval);
|
||||
|
||||
/* cpinterface.c etc -- stuff CP needs from FTE */
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ static unsigned int Debug = 0;
|
|||
*/
|
||||
#endif
|
||||
|
||||
extern void zaddeq(double *a, int *amag, double x, int xmag, double y, int ymag);
|
||||
|
||||
extern int CKTpzTrapped;
|
||||
double NIpzK;
|
||||
int NIpzK_mag;
|
||||
|
|
@ -215,7 +217,7 @@ NIpzSym2(PZtrial **set, PZtrial *new)
|
|||
int tmag;
|
||||
int error;
|
||||
int disc_mag;
|
||||
int new_mag;
|
||||
int new_mag = 0;
|
||||
|
||||
error = OK;
|
||||
|
||||
|
|
|
|||
|
|
@ -1709,9 +1709,13 @@ int Step;
|
|||
long MinMarkowitzProduct, *pMarkowitzProduct;
|
||||
int I;
|
||||
ElementPtr pDiag;
|
||||
int NumberOfTies, Size = Matrix->Size;
|
||||
int NumberOfTies = 0;
|
||||
int Size = Matrix->Size;
|
||||
|
||||
ElementPtr ChosenPivot;
|
||||
RealNumber Magnitude, Ratio, RatioOfAccepted, LargestInCol;
|
||||
RealNumber Magnitude, Ratio;
|
||||
RealNumber RatioOfAccepted = 0;
|
||||
RealNumber LargestInCol;
|
||||
RealNumber FindBiggestInColExclude();
|
||||
|
||||
/* Begin `SearchDiagonal'. */
|
||||
|
|
@ -1838,10 +1842,13 @@ int Step;
|
|||
{
|
||||
int I, Size = Matrix->Size;
|
||||
ElementPtr pElement;
|
||||
int NumberOfTies;
|
||||
int NumberOfTies = 0;
|
||||
long Product, MinMarkowitzProduct;
|
||||
ElementPtr ChosenPivot, pLargestElement;
|
||||
RealNumber Magnitude, LargestElementMag, Ratio, RatioOfAccepted, LargestInCol;
|
||||
ElementPtr ChosenPivot;
|
||||
ElementPtr pLargestElement = NULL;
|
||||
RealNumber Magnitude, LargestElementMag, Ratio;
|
||||
RealNumber RatioOfAccepted = 0;
|
||||
RealNumber LargestInCol;
|
||||
RealNumber FindLargestInCol();
|
||||
|
||||
/* Begin `SearchEntireMatrix'. */
|
||||
|
|
|
|||
|
|
@ -137,7 +137,9 @@ spPrint(void *eMatrix, int PrintReordered, int Data, int Header)
|
|||
int J = 0;
|
||||
int I, Row, Col, Size, Top;
|
||||
int StartCol = 1, StopCol, Columns, ElementCount = 0;
|
||||
double Magnitude, SmallestDiag, SmallestElement;
|
||||
double Magnitude;
|
||||
double SmallestDiag = 0;
|
||||
double SmallestElement = 0;
|
||||
double LargestElement = 0.0, LargestDiag = 0.0;
|
||||
ElementPtr pElement, *pImagElements;
|
||||
int *PrintOrdToIntRowMap, *PrintOrdToIntColMap;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ cp_printword(s)
|
|||
*/
|
||||
|
||||
bool
|
||||
cp_getvar(char *n, int t, char *r)
|
||||
cp_getvar(char *n, int t, void *r)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue