1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtcalc: Resolve 43 warnings that would be introduced with -Wunused-variable or -Wall

Basically 43 local variables declared in functions and then never used.
This commit is contained in:
Peter Howkins 2012-11-05 16:44:29 +00:00
parent 2c10f0d62b
commit a0da2db479
5 changed files with 11 additions and 37 deletions

View file

@ -378,7 +378,6 @@ int argc ;
char **argv ; char **argv ;
{ {
char *ptr ; char *ptr ;
int i ;
v->progname = argv[0] ; /* Save programs name. */ v->progname = argv[0] ; /* Save programs name. */
v->appname = NULL ; v->appname = NULL ;
@ -476,7 +475,7 @@ int
get_index(ch) get_index(ch)
char ch ; char ch ;
{ {
int n, val ; int n ;
for (n = 0; n < TITEMS; n++) { for (n = 0; n < TITEMS; n++) {
if (ch == buttons[n].value) if (ch == buttons[n].value)
@ -1253,9 +1252,9 @@ int
matherr(exc) /* Default math library exception handling routine. */ matherr(exc) /* Default math library exception handling routine. */
struct exception *exc ; struct exception *exc ;
{ {
#if 0
char msg[100]; char msg[100];
#if 0
if (exc) { if (exc) {
strcpy(msg, exc->name); strcpy(msg, exc->name);
strcat(msg, ": "); strcat(msg, ": ");
@ -1775,9 +1774,7 @@ void
write_resources(filename) write_resources(filename)
char *filename; char *filename;
{ {
char regval[5] ;
char intval[5] ; char intval[5] ;
int i;
int MPtemp[MP_SIZE]; int MPtemp[MP_SIZE];
SPRINTF(intval, "%d", v->accuracy) ; SPRINTF(intval, "%d", v->accuracy) ;

View file

@ -94,7 +94,7 @@ char *appname ; /* Application name. */
char *resource ; /* X resource to search for. */ char *resource ; /* X resource to search for. */
{ {
char app[MAXLINE], res[MAXLINE] ; char app[MAXLINE], res[MAXLINE] ;
char cstr[MAXLINE], nstr[MAXLINE], str[MAXLINE] ; char cstr[MAXLINE], nstr[MAXLINE] ;
char *str_type[20] ; char *str_type[20] ;
XrmValue value ; XrmValue value ;

View file

@ -76,8 +76,6 @@ do_accuracy() /* Set display accuracy. */
void void
do_ascii() /* Convert ASCII value. */ do_ascii() /* Convert ASCII value. */
{ {
int val ;
show_ascii_frame() ; show_ascii_frame() ;
} }
@ -112,8 +110,7 @@ do_business() /* Perform special business mode calculations. */
Boolean need_show = TRUE; Boolean need_show = TRUE;
char *display_number = NULL; char *display_number = NULL;
int MPbv[MP_SIZE], MP1[MP_SIZE], MP2[MP_SIZE], MP3[MP_SIZE], MP4[MP_SIZE] ; int MPbv[MP_SIZE], MP1[MP_SIZE], MP2[MP_SIZE], MP3[MP_SIZE], MP4[MP_SIZE] ;
int MP5[MP_SIZE]; int i, len, val, accSav ;
int i, len, val, val2, accSav ;
double result, w; double result, w;
if (IS_KEY(v->current, KEY_CTRM)) if (IS_KEY(v->current, KEY_CTRM))
@ -1166,7 +1163,7 @@ do_portion()
void void
do_shift() /* Perform bitwise shift on display value. */ do_shift() /* Perform bitwise shift on display value. */
{ {
int i, MPtemp[MP_SIZE], shift ; int MPtemp[MP_SIZE], shift ;
BOOLEAN temp ; BOOLEAN temp ;
double dval ; double dval ;

View file

@ -442,7 +442,6 @@ GetHelpDialog()
HelpStruct *pHelp; HelpStruct *pHelp;
Arg args[5]; Arg args[5];
int n;
if(pHelpCache == (HelpStruct *)NULL) if(pHelpCache == (HelpStruct *)NULL)
{ {

View file

@ -278,9 +278,7 @@ main(argc, argv)
int argc ; int argc ;
char **argv ; char **argv ;
{ {
char bind_home[MAXPATHLEN], **new_environ ;
Pixmap pixmap; Pixmap pixmap;
int i, j ;
XtSetLanguageProc(NULL, NULL, NULL); XtSetLanguageProc(NULL, NULL, NULL);
_DtEnvControl(DT_ENV_SET); _DtEnvControl(DT_ENV_SET);
@ -407,7 +405,6 @@ int row, column, maxrows, maxcols ;
enum menu_type mtype = buttons[n].mtype ; enum menu_type mtype = buttons[n].mtype ;
Widget button ; Widget button ;
XmString lstr ; XmString lstr ;
int result;
Pixel bg; Pixel bg;
get_label(n) ; get_label(n) ;
@ -756,7 +753,7 @@ Widget owner ;
static char *mnames[] = { "base", "ttype", "num", "hyp", static char *mnames[] = { "base", "ttype", "num", "hyp",
"inv", "op", "mode" } ; "inv", "op", "mode" } ;
int i, n, val; int i, n, val;
Widget basePulldown, numPulldown, modePulldown, trigPulldown, dummyText; Widget basePulldown, numPulldown, modePulldown, trigPulldown;
Arg args[10]; Arg args[10];
XmString label_string; XmString label_string;
Pixel tmp_pixelbg, tmp_pixelfg; Pixel tmp_pixelbg, tmp_pixelfg;
@ -1591,9 +1588,7 @@ int row, column, inverted ;
{ {
char str[10] ; char str[10] ;
Widget widget ; Widget widget ;
XmPushButtonWidget pb;
int i, j, row2, column2; int i, j, row2, column2;
static XtIntervalId timerId = 0;
if(inverted) if(inverted)
{ {
@ -2268,7 +2263,8 @@ int type;
{ {
char line[MAXLINE] ; /* Current memory register line. */ char line[MAXLINE] ; /* Current memory register line. */
char *ptr, *tmp, *tmpStr; char *ptr, *tmp, *tmpStr;
int i, savAcc ; int i;
/* int savAcc;*/
XmString str, numStr ; XmString str, numStr ;
int MPtemp[MP_SIZE]; int MPtemp[MP_SIZE];
@ -2614,7 +2610,7 @@ show_ascii_frame() /* Display ASCII popup. */
{ {
int j; int j;
XmString tstr ; XmString tstr ;
Widget sep, frame, form; Widget sep;
Arg args[15]; Arg args[15];
XmString label_string; XmString label_string;
@ -2991,8 +2987,6 @@ static void
switch_mode(curmode) switch_mode(curmode)
enum mode_type curmode ; enum mode_type curmode ;
{ {
int i ;
XmString lstr;
Arg args[2]; Arg args[2];
v->modetype = curmode ; v->modetype = curmode ;
@ -3349,7 +3343,7 @@ Widget widget ;
XtPointer client_data, call_data ; XtPointer client_data, call_data ;
{ {
Arg args[1]; Arg args[1];
int position, val, choice; int val, choice;
X->mtype = (enum menu_type) client_data ; X->mtype = (enum menu_type) client_data ;
XtSetArg (args[0], XmNuserData, &val); XtSetArg (args[0], XmNuserData, &val);
@ -3371,17 +3365,15 @@ create_menu_bar(parent)
Widget parent; Widget parent;
{ {
register int n; register int n;
int i, j, val, count; int count;
Widget WidgList[10]; Widget WidgList[10];
Arg args[5]; Arg args[5];
char *mnemonic; char *mnemonic;
XmString labelString; XmString labelString;
Widget child, mem_reg; Widget child, mem_reg;
Widget lastCascadeButtonGadget; Widget lastCascadeButtonGadget;
Widget lastCascadeButton;
Widget lastMenuPane; Widget lastMenuPane;
Widget helpPulldown; Widget helpPulldown;
Widget lastCascadeMenuPane;
/* Create the pulldown menu */ /* Create the pulldown menu */
@ -3673,7 +3665,6 @@ XtPointer call_data ;
void void
read_resources() /* Read all possible resources from the database. */ read_resources() /* Read all possible resources from the database. */
{ {
int boolval, i, intval ;
char str[MAXLINE] ; char str[MAXLINE] ;
char *msg; char *msg;
@ -3848,9 +3839,7 @@ XtPointer client_data, call_data ;
create_popup(parent) create_popup(parent)
Widget parent; Widget parent;
{ {
int n;
char *mnemonic; char *mnemonic;
Arg args[10];
XmString label; XmString label;
Widget dummyHelp1, dummyHelp2, memRegs; Widget dummyHelp1, dummyHelp2, memRegs;
Widget help, helpI, helpToc, helpT, helpR, helpO, helpU, helpV; Widget help, helpI, helpToc, helpT, helpR, helpO, helpU, helpV;
@ -4200,7 +4189,6 @@ XtPointer call_data ;
{ {
char *full_path = NULL; char *full_path = NULL;
char *file_name = NULL; char *file_name = NULL;
char *strPtr;
char *sessionFileName; char *sessionFileName;
char **restart_argv = NULL; char **restart_argv = NULL;
@ -4272,7 +4260,6 @@ SaveSession( path, file_name )
char *path ; char *path ;
char *file_name ; char *file_name ;
{ {
char workspaceNumber[5];
int fd; int fd;
Atom * ws_presence = NULL; Atom * ws_presence = NULL;
char * workspace_name; char * workspace_name;
@ -4287,12 +4274,8 @@ SaveSession( path, file_name )
Position x, y; Position x, y;
Dimension width, height; Dimension width, height;
char * command;
int command_len;
int i;
int j; int j;
char * msg; char * msg;
int view_index;
char * tmpStr; char * tmpStr;
XmVendorShellExtObject vendorExt; XmVendorShellExtObject vendorExt;
XmWidgetExtData extData; XmWidgetExtData extData;
@ -4399,11 +4382,9 @@ RestoreSession()
Boolean status=False; Boolean status=False;
char *path, *msg; char *path, *msg;
char str[MAXLINE] ; char str[MAXLINE] ;
char temp[MAXLINE] ;
char * full_path = NULL; char * full_path = NULL;
XrmDatabase db; XrmDatabase db;
int boolval, i, intval ; int boolval, i, intval ;
double result;
int MPtemp[MP_SIZE]; int MPtemp[MP_SIZE];
status = DtSessionRestorePath(X->kframe, &full_path, status = DtSessionRestorePath(X->kframe, &full_path,