mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
dtcalc: remove some pointless macroing of function names to uppercase versionss
This commit is contained in:
parent
e4024b0bf9
commit
aef196c6ca
6 changed files with 105 additions and 122 deletions
|
@ -318,7 +318,7 @@ clear_display(void)
|
|||
v->defState = 1 ;
|
||||
i = 0 ;
|
||||
mpcim(&i, v->MPdisp_val) ;
|
||||
STRCPY(v->display, make_number(v->MPdisp_val, FALSE)) ;
|
||||
strcpy(v->display, make_number(v->MPdisp_val, FALSE)) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
|
||||
v->hyperbolic = 0 ;
|
||||
|
@ -419,7 +419,7 @@ void
|
|||
doerr(char *errmes)
|
||||
{
|
||||
if (!v->started) return ;
|
||||
STRCPY(v->display, errmes) ;
|
||||
strcpy(v->display, errmes) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
v->error = 1 ;
|
||||
beep() ;
|
||||
|
@ -434,7 +434,7 @@ get_bool_resource(enum res_type rtype, int *boolval)
|
|||
int len, n ;
|
||||
|
||||
if ((val = get_resource(rtype)) == NULL) return(0) ;
|
||||
STRCPY(tempstr, val) ;
|
||||
strcpy(tempstr, val) ;
|
||||
len = strlen(tempstr) ;
|
||||
for (n = 0; n < len; n++)
|
||||
if (isupper(tempstr[n])) tempstr[n] = tolower(tempstr[n]) ;
|
||||
|
@ -504,9 +504,9 @@ get_label(int n)
|
|||
temp = buttons[n].str;
|
||||
|
||||
if(temp != NULL)
|
||||
STRCPY(v->pstr, temp) ;
|
||||
strcpy(v->pstr, temp) ;
|
||||
else
|
||||
STRCPY(v->pstr, "");
|
||||
strcpy(v->pstr, "");
|
||||
}
|
||||
|
||||
/* Extract command line options. */
|
||||
|
@ -546,7 +546,7 @@ get_options(int argc, char *argv[])
|
|||
sprintf(msg, opts[(int) O_MODE], next);
|
||||
getparam(next, argv, msg) ;
|
||||
XtFree(msg);
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
@ -571,7 +571,7 @@ get_options(int argc, char *argv[])
|
|||
break ;
|
||||
case 'b' : INC ;
|
||||
getparam(next, argv, opts[(int) O_BASE]) ;
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
@ -605,7 +605,7 @@ get_options(int argc, char *argv[])
|
|||
sprintf(msg, opts[(int) O_DISPLAY], next);
|
||||
getparam(next, argv, msg) ;
|
||||
XtFree(msg);
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
@ -645,7 +645,7 @@ get_options(int argc, char *argv[])
|
|||
sprintf(msg, opts[(int) O_TRIG], next);
|
||||
getparam(next, argv, msg) ;
|
||||
XtFree(msg);
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
@ -695,14 +695,14 @@ getparam(char *s, char *argv[], char *errmes)
|
|||
{
|
||||
char *msg;
|
||||
|
||||
if (*argv != NULL && argv[0][0] != '-') STRCPY(s, *argv) ;
|
||||
if (*argv != NULL && argv[0][0] != '-') strcpy(s, *argv) ;
|
||||
else
|
||||
{
|
||||
msg = (char *) XtMalloc(strlen(mess[(int) MESS_PARAM]) +
|
||||
strlen(errmes) + 3);
|
||||
sprintf(msg, mess[(int) MESS_PARAM], errmes);
|
||||
_DtSimpleError (v->appname, DtError, NULL, msg);
|
||||
FPRINTF(stderr, mess[(int) MESS_PARAM], errmes) ;
|
||||
fprintf(stderr, mess[(int) MESS_PARAM], errmes) ;
|
||||
exit(1) ;
|
||||
}
|
||||
}
|
||||
|
@ -783,8 +783,8 @@ get_rcfile(char *name)
|
|||
}
|
||||
else if (isval == 'f')
|
||||
{
|
||||
SSCANF(&line[3], "%s", tmp) ;
|
||||
STRCPY(v->fun_vals[i], convert(tmp)) ;
|
||||
sscanf(&line[3], "%s", tmp) ;
|
||||
strcpy(v->fun_vals[i], convert(tmp)) ;
|
||||
}
|
||||
else if (isval == 'r')
|
||||
{
|
||||
|
@ -800,18 +800,18 @@ get_rcfile(char *name)
|
|||
line[strlen(line)-1] = '\0' ;
|
||||
if (isval == 'c')
|
||||
{
|
||||
STRCPY(tmp, make_number(v->MPcon_vals[i], TRUE)) ;
|
||||
SPRINTF(v->con_names[i], "%1d: %s [%s]",
|
||||
strcpy(tmp, make_number(v->MPcon_vals[i], TRUE)) ;
|
||||
sprintf(v->con_names[i], "%1d: %s [%s]",
|
||||
i, tmp, &line[n]) ;
|
||||
}
|
||||
else
|
||||
SPRINTF(v->fun_names[i], "%1d: %s [%s]",
|
||||
sprintf(v->fun_names[i], "%1d: %s [%s]",
|
||||
i, tmp, &line[n]) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
FCLOSE(rcfd) ;
|
||||
fclose(rcfd) ;
|
||||
}
|
||||
|
||||
/* Get a string resource from database. */
|
||||
|
@ -822,7 +822,7 @@ get_str_resource(enum res_type rtype, char *strval)
|
|||
int i, len ;
|
||||
|
||||
if ((val = get_resource(rtype)) == NULL) return(0) ;
|
||||
STRCPY(strval, val) ;
|
||||
strcpy(strval, val) ;
|
||||
len = strlen(strval) ;
|
||||
if(rtype != R_TRIG && rtype != R_DISPLAY)
|
||||
{
|
||||
|
@ -1013,7 +1013,7 @@ make_eng_sci(int *MPnumber)
|
|||
}
|
||||
}
|
||||
|
||||
STRCPY(fixed, make_fixed(MPmant, MAX_DIGITS-6)) ;
|
||||
strcpy(fixed, make_fixed(MPmant, MAX_DIGITS-6)) ;
|
||||
len = strlen(fixed) ;
|
||||
for (i = 0; i < len; i++) *optr++ = fixed[i] ;
|
||||
|
||||
|
@ -1515,7 +1515,7 @@ process_stack(int startop, int startnum, int n)
|
|||
int i ;
|
||||
int nptr ; /* Pointer to next number from numeric stack. */
|
||||
|
||||
STRCPY(sdisp, v->display) ; /* Save current display. */
|
||||
strcpy(sdisp, v->display) ; /* Save current display. */
|
||||
nptr = startnum ;
|
||||
v->pending = 0 ;
|
||||
v->cur_op = '?' ; /* Current operation is initially undefined. */
|
||||
|
@ -1546,7 +1546,7 @@ process_stack(int startop, int startnum, int n)
|
|||
v->opsptr = startop - 1 ;
|
||||
push_op(-1) ;
|
||||
save_pending_values(KEY_LPAR) ;
|
||||
STRCPY(v->display, sdisp) ; /* Restore current display. */
|
||||
strcpy(v->display, sdisp) ; /* Restore current display. */
|
||||
}
|
||||
|
||||
|
||||
|
@ -1557,8 +1557,8 @@ process_str(char *str, enum menu_type mtype)
|
|||
char save[80];
|
||||
|
||||
len = strlen(str) ;
|
||||
STRCPY(save, v->display) ;
|
||||
STRCPY(v->display, " ") ;
|
||||
strcpy(save, v->display) ;
|
||||
strcpy(v->display, " ") ;
|
||||
set_item(DISPLAYITEM, v->display);
|
||||
for (i = 0 ; i < len; i++)
|
||||
{
|
||||
|
@ -1568,7 +1568,7 @@ process_str(char *str, enum menu_type mtype)
|
|||
{
|
||||
if(mtype == M_FUN)
|
||||
{
|
||||
STRCPY(v->display, save);
|
||||
strcpy(v->display, save);
|
||||
set_item(DISPLAYITEM, v->display);
|
||||
v->error = 0;
|
||||
}
|
||||
|
@ -1613,11 +1613,11 @@ read_rcfiles(void) /* Read .dtcalcrc's from home and current directories. */
|
|||
|
||||
for (n = 0; n < MAXREGS; n++)
|
||||
{
|
||||
STRCPY(tmp, make_number(v->MPcon_vals[n], FALSE)) ;
|
||||
SPRINTF(name, "%1d: %s [%s]", n, tmp, v->con_names[n]) ;
|
||||
strcpy(tmp, make_number(v->MPcon_vals[n], FALSE)) ;
|
||||
sprintf(name, "%1d: %s [%s]", n, tmp, v->con_names[n]) ;
|
||||
|
||||
STRCPY(v->con_names[n], name) ;
|
||||
STRCPY(v->fun_vals[n], "") ; /* Initially empty function strings. */
|
||||
strcpy(v->con_names[n], name) ;
|
||||
strcpy(v->fun_vals[n], "") ; /* Initially empty function strings. */
|
||||
}
|
||||
|
||||
if ((home = getenv("HOME")) == NULL)
|
||||
|
@ -1638,7 +1638,7 @@ show_display(int *MPval)
|
|||
{
|
||||
if (!v->error)
|
||||
{
|
||||
STRCPY(v->display, make_number(MPval, TRUE)) ;
|
||||
strcpy(v->display, make_number(MPval, TRUE)) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
}
|
||||
}
|
||||
|
@ -1647,9 +1647,9 @@ show_display(int *MPval)
|
|||
void
|
||||
usage(char *progname)
|
||||
{
|
||||
FPRINTF(stderr, ustrs[(int) USAGE1], PATCHLEVEL) ;
|
||||
FPRINTF(stderr, "%s", ustrs[(int) USAGE2]) ;
|
||||
FPRINTF(stderr, "%s", ustrs[(int) USAGE3]) ;
|
||||
fprintf(stderr, ustrs[(int) USAGE1], PATCHLEVEL) ;
|
||||
fprintf(stderr, "%s", ustrs[(int) USAGE2]) ;
|
||||
fprintf(stderr, "%s", ustrs[(int) USAGE3]) ;
|
||||
exit(1) ;
|
||||
}
|
||||
|
||||
|
@ -1668,7 +1668,7 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen
|
|||
struct passwd *entry ; /* The user's /etc/passwd entry. */
|
||||
|
||||
rcexists = 0 ;
|
||||
SPRINTF(rcname, "%s/%s", getcwd(pathname, MAXPATHLEN), RCNAME) ;
|
||||
sprintf(rcname, "%s/%s", getcwd(pathname, MAXPATHLEN), RCNAME) ;
|
||||
if (access(rcname, F_OK) == 0) rcexists = 1 ;
|
||||
else
|
||||
{
|
||||
|
@ -1677,17 +1677,17 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen
|
|||
if ((entry = getpwuid(getuid())) == NULL) return ;
|
||||
home = entry->pw_dir ;
|
||||
}
|
||||
SPRINTF(rcname, "%s/%s", home, RCNAME) ;
|
||||
sprintf(rcname, "%s/%s", home, RCNAME) ;
|
||||
if (access(rcname, F_OK) == 0) rcexists = 1 ;
|
||||
}
|
||||
STRCPY(tmp_filename, "/tmp/.dtcalcrcXXXXXX") ;
|
||||
MKTEMP(tmp_filename) ;
|
||||
strcpy(tmp_filename, "/tmp/.dtcalcrcXXXXXX") ;
|
||||
mktemp(tmp_filename) ;
|
||||
if ((tmpfd = fopen(tmp_filename, "w+")) == NULL) return ;
|
||||
|
||||
if (rcexists)
|
||||
{
|
||||
rcfd = fopen(rcname, "r") ;
|
||||
SPRINTF(sval, " %1d", cfno) ;
|
||||
sprintf(sval, " %1d", cfno) ;
|
||||
while (fgets(str, MAXLINE, rcfd))
|
||||
{
|
||||
if (exists)
|
||||
|
@ -1695,40 +1695,40 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen
|
|||
switch (mtype)
|
||||
{
|
||||
case M_CON : sval[0] = 'c' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
sval[0] = 'C' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
break ;
|
||||
case M_FUN : sval[0] = 'f' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
sval[0] = 'F' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
FPRINTF(tmpfd, "%s", str) ;
|
||||
fprintf(tmpfd, "%s", str) ;
|
||||
}
|
||||
FCLOSE(rcfd) ;
|
||||
fclose(rcfd) ;
|
||||
}
|
||||
|
||||
switch (mtype)
|
||||
{
|
||||
case M_CON : FPRINTF(tmpfd, "\nC%1d %s %s\n", cfno, val, comment) ;
|
||||
case M_CON : fprintf(tmpfd, "\nC%1d %s %s\n", cfno, val, comment) ;
|
||||
break ;
|
||||
case M_FUN :
|
||||
if(strcmp(val, "") != 0)
|
||||
FPRINTF(tmpfd, "\nF%1d %s %s\n", cfno, val, comment) ;
|
||||
fprintf(tmpfd, "\nF%1d %s %s\n", cfno, val, comment) ;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
UNLINK(rcname) ;
|
||||
unlink(rcname) ;
|
||||
rcfd = fopen(rcname, "w") ;
|
||||
REWIND(tmpfd) ;
|
||||
while (fgets(str, MAXLINE, tmpfd)) FPRINTF(rcfd, "%s", str) ;
|
||||
FCLOSE(rcfd) ;
|
||||
FCLOSE(tmpfd);
|
||||
UNLINK(tmp_filename) ;
|
||||
rewind(tmpfd) ;
|
||||
while (fgets(str, MAXLINE, tmpfd)) fprintf(rcfd, "%s", str) ;
|
||||
fclose(rcfd) ;
|
||||
fclose(tmpfd);
|
||||
unlink(tmp_filename) ;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1738,7 +1738,7 @@ write_resources(char *filename)
|
|||
char intval[5] ;
|
||||
int MPtemp[MP_SIZE];
|
||||
|
||||
SPRINTF(intval, "%d", v->accuracy) ;
|
||||
sprintf(intval, "%d", v->accuracy) ;
|
||||
put_resource(R_ACCURACY, intval) ;
|
||||
put_resource(R_DISPLAYED, v->display) ;
|
||||
put_resource(R_BASE, base_str[(int) v->base]) ;
|
||||
|
|
|
@ -111,19 +111,6 @@ extern char *_DtGetMessage(char *filename, int set, int n, char *s);
|
|||
|
||||
#define MP_SIZE 150 /* Size of the multiple precision values. */
|
||||
|
||||
#define FCLOSE (void) fclose /* To make lint happy. */
|
||||
#define FPRINTF (void) fprintf
|
||||
#define FPUTS (void) fputs
|
||||
#define FREE (void) free
|
||||
#define MEMCPY (void) memcpy
|
||||
#define MKTEMP (void) mktemp
|
||||
#define REWIND (void) rewind
|
||||
#define SPRINTF (void) sprintf
|
||||
#define SSCANF (void) sscanf
|
||||
#define STRCPY (void) strcpy
|
||||
#define STRNCAT (void) strncat
|
||||
#define UNLINK (void) unlink
|
||||
|
||||
/* Various pseudo events used by the dtcalc program. */
|
||||
#define KEYBOARD_DOWN 100 /* Keyboard character was pressed. */
|
||||
#define KEYBOARD_UP 101 /* Keyboard character was released. */
|
||||
|
|
|
@ -36,18 +36,14 @@
|
|||
#include <stdlib.h>
|
||||
#include "ds_common.h"
|
||||
|
||||
#define FREE (void) free
|
||||
#define STRCPY (void) strcpy
|
||||
|
||||
|
||||
void
|
||||
read_str(char **str, char *value)
|
||||
{
|
||||
if (*str != NULL) FREE(*str) ;
|
||||
if (*str != NULL) free(*str) ;
|
||||
if (value != NULL && strlen(value))
|
||||
{
|
||||
*str = (char *) malloc((unsigned) (strlen(value) + 1)) ;
|
||||
STRCPY(*str, value) ;
|
||||
strcpy(*str, value) ;
|
||||
}
|
||||
else *str = NULL ;
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ do_business(void) /* Perform special business mode calculations. */
|
|||
make_registers(FIN) ;
|
||||
v->funstate = 1;
|
||||
|
||||
STRCPY(v->display, display_number);
|
||||
strcpy(v->display, display_number);
|
||||
set_item(DISPLAYITEM, v->display);
|
||||
need_show = FALSE;
|
||||
}
|
||||
|
@ -641,15 +641,15 @@ do_expno(void) /* Get exponential number. */
|
|||
v->pointed = (strchr(v->display, '.') != NULL) ;
|
||||
if (!v->new_input)
|
||||
{
|
||||
STRCPY(v->display, "1.0 +") ;
|
||||
strcpy(v->display, "1.0 +") ;
|
||||
v->new_input = v->pointed = 1 ;
|
||||
}
|
||||
else if (!v->pointed)
|
||||
{
|
||||
STRNCAT(v->display, ". +", 3) ;
|
||||
strncat(v->display, ". +", 3) ;
|
||||
v->pointed = 1 ;
|
||||
}
|
||||
else if (!v->key_exp) STRNCAT(v->display, " +", 2) ;
|
||||
else if (!v->key_exp) strncat(v->display, " +", 2) ;
|
||||
v->toclear = 0 ;
|
||||
v->key_exp = 1 ;
|
||||
v->exp_posn = strchr(v->display, '+') ;
|
||||
|
@ -910,7 +910,7 @@ do_number(void)
|
|||
|
||||
if (v->toclear)
|
||||
{
|
||||
SPRINTF(v->display, "%c", nextchar) ;
|
||||
sprintf(v->display, "%c", nextchar) ;
|
||||
v->toclear = 0 ;
|
||||
}
|
||||
else
|
||||
|
@ -990,7 +990,7 @@ do_paren(void)
|
|||
if(tmpdb == 0.0)
|
||||
{
|
||||
v->cur_op = '?';
|
||||
STRCPY(v->display, "") ;
|
||||
strcpy(v->display, "") ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
}
|
||||
else
|
||||
|
@ -1009,7 +1009,7 @@ do_paren(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
STRCPY(v->display, "") ;
|
||||
strcpy(v->display, "") ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
}
|
||||
}
|
||||
|
@ -1127,10 +1127,10 @@ do_point(void) /* Handle numeric point. */
|
|||
{
|
||||
if (v->toclear)
|
||||
{
|
||||
STRCPY(v->display, ".") ;
|
||||
strcpy(v->display, ".") ;
|
||||
v->toclear = 0 ;
|
||||
}
|
||||
else STRNCAT(v->display, ".", 1) ;
|
||||
else strncat(v->display, ".", 1) ;
|
||||
v->pointed = 1 ;
|
||||
}
|
||||
else
|
||||
|
@ -1644,7 +1644,7 @@ process_parens(char current)
|
|||
{
|
||||
set_item(DISPLAYITEM, vstrs[(int) V_ERROR]) ;
|
||||
set_item(OPITEM, vstrs[(int) V_CLR]) ;
|
||||
STRCPY(v->display, vstrs[(int) V_ERROR]) ;
|
||||
strcpy(v->display, vstrs[(int) V_ERROR]) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1664,7 +1664,7 @@ push_num(int *MPval) /* Try to push value onto the numeric stack. */
|
|||
if (v->numsptr < 0) return ;
|
||||
if (v->numsptr >= MAXSTACK)
|
||||
{
|
||||
STRCPY(v->display, vstrs[(int) V_NUMSTACK]) ;
|
||||
strcpy(v->display, vstrs[(int) V_NUMSTACK]) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
v->error = 1 ;
|
||||
beep() ;
|
||||
|
@ -1686,7 +1686,7 @@ push_op(int val) /* Try to push value onto the operand stack. */
|
|||
if (v->opsptr < 0) return ;
|
||||
if (v->opsptr >= MAXSTACK)
|
||||
{
|
||||
STRCPY(v->display, vstrs[(int) V_OPSTACK]) ;
|
||||
strcpy(v->display, vstrs[(int) V_OPSTACK]) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
v->error = 1 ;
|
||||
set_item(OPITEM, vstrs[(int) V_CLR]) ;
|
||||
|
|
|
@ -295,7 +295,7 @@ main(int argc, char **argv)
|
|||
|
||||
tmpStr = GETMESSAGE(2, 31, "Could not open display.\n");
|
||||
msg = XtNewString(tmpStr);
|
||||
FPRINTF(stderr, "%s", msg) ;
|
||||
fprintf(stderr, "%s", msg) ;
|
||||
exit(1) ;
|
||||
}
|
||||
|
||||
|
@ -504,7 +504,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
|||
XmNdefaultPosition, FALSE,
|
||||
NULL) ;
|
||||
|
||||
SPRINTF(str, "register%1d", 0) ;
|
||||
sprintf(str, "register%1d", 0) ;
|
||||
X->registers[0] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
|
@ -518,7 +518,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
|||
|
||||
for (i = 1; i < MAXREGS; i++)
|
||||
{
|
||||
SPRINTF(str, "register%1d", i) ;
|
||||
sprintf(str, "register%1d", i) ;
|
||||
X->registers[i] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
|
@ -587,7 +587,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
|||
XmNdefaultPosition, FALSE,
|
||||
NULL) ;
|
||||
|
||||
SPRINTF(str, "fregister%1d", 0) ;
|
||||
sprintf(str, "fregister%1d", 0) ;
|
||||
X->fregisters[0] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
|
@ -601,7 +601,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
|||
|
||||
for (i = 1; i < FINREGS; i++)
|
||||
{
|
||||
SPRINTF(str, "fregister%1d", i) ;
|
||||
sprintf(str, "fregister%1d", i) ;
|
||||
X->fregisters[i] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
|
@ -615,7 +615,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
|||
NULL) ;
|
||||
}
|
||||
|
||||
SPRINTF(str, "fregistervals%1d", 0) ;
|
||||
sprintf(str, "fregistervals%1d", 0) ;
|
||||
X->fregistersvals[0] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
|
@ -632,7 +632,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
|||
|
||||
for (i = 1; i < FINREGS; i++)
|
||||
{
|
||||
SPRINTF(str, "fregistervals%1d", i) ;
|
||||
sprintf(str, "fregistervals%1d", i) ;
|
||||
X->fregistersvals[i] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
|
@ -1825,7 +1825,7 @@ ProcessMotifSelection(Widget W)
|
|||
display[i+1] = '\0';
|
||||
}
|
||||
|
||||
STRCPY(v->display, display);
|
||||
strcpy(v->display, display);
|
||||
XtFree(display);
|
||||
}
|
||||
|
||||
|
@ -2054,7 +2054,7 @@ get_resource(enum res_type rtype)
|
|||
{
|
||||
char str[MAXLINE] ;
|
||||
|
||||
STRCPY(str, calc_res[(int) rtype]) ;
|
||||
strcpy(str, calc_res[(int) rtype]) ;
|
||||
return(ds_get_resource(X->rDB, v->appname, str)) ;
|
||||
}
|
||||
|
||||
|
@ -2174,7 +2174,7 @@ make_frames(void)
|
|||
{
|
||||
tool_label = (char *) calloc(1, strlen(lstrs[(int) L_UCALC]) + 3);
|
||||
|
||||
SPRINTF(tool_label, "%s", lstrs[(int) L_UCALC]);
|
||||
sprintf(tool_label, "%s", lstrs[(int) L_UCALC]);
|
||||
}
|
||||
else read_str(&tool_label, v->titleline) ;
|
||||
|
||||
|
@ -2227,7 +2227,7 @@ make_registers(int type)
|
|||
{
|
||||
for (i = 0; i < MAXREGS; i++)
|
||||
{
|
||||
SPRINTF(line, "%s: %s", menu_entries[i + 10].str,
|
||||
sprintf(line, "%s: %s", menu_entries[i + 10].str,
|
||||
make_number(v->MPmvals[i], FALSE)) ;
|
||||
|
||||
{
|
||||
|
@ -2975,7 +2975,7 @@ update_cf_value(void)
|
|||
}
|
||||
/* need to run a "compute" of what was typed in */
|
||||
len = strlen(X->vval) ;
|
||||
STRCPY(str, X->vval);
|
||||
strcpy(str, X->vval);
|
||||
if(X->vval[len - 1] != '=')
|
||||
{
|
||||
/* need to add an '=' at the end of the string so it
|
||||
|
@ -3007,8 +3007,8 @@ update_cf_value(void)
|
|||
toclear = v->toclear;
|
||||
tstate = v->tstate;
|
||||
pending = v->pending;
|
||||
STRCPY(display, v->display);
|
||||
STRCPY(fnum, v->fnum);
|
||||
strcpy(display, v->display);
|
||||
strcpy(fnum, v->fnum);
|
||||
mpstr(v->MPdisp_val, MPdisp_val);
|
||||
mpstr(v->MPlast_input, MPlast_input);
|
||||
mpstr(v->MPresult, MPresult);
|
||||
|
@ -3025,7 +3025,7 @@ update_cf_value(void)
|
|||
/* get the computed value */
|
||||
accuracy = v->accuracy;
|
||||
v->accuracy = 9 ;
|
||||
STRCPY(result, make_number(v->MPresult, FALSE)) ;
|
||||
strcpy(result, make_number(v->MPresult, FALSE)) ;
|
||||
v->accuracy = accuracy ;
|
||||
|
||||
/* return to previous state */
|
||||
|
@ -3036,8 +3036,8 @@ update_cf_value(void)
|
|||
v->toclear = toclear;
|
||||
v->tstate = tstate;
|
||||
v->pending = pending;
|
||||
STRCPY(v->display, display);
|
||||
STRCPY(v->fnum, fnum);
|
||||
strcpy(v->display, display);
|
||||
strcpy(v->fnum, fnum);
|
||||
mpstr(MPdisp_val, v->MPdisp_val);
|
||||
mpstr(MPlast_input, v->MPlast_input);
|
||||
mpstr(MPresult, v->MPresult);
|
||||
|
@ -3048,7 +3048,7 @@ update_cf_value(void)
|
|||
ptr = DtStrchr(result, 'e');
|
||||
if (n != 1 || ptr != NULL || v->error == TRUE)
|
||||
{
|
||||
SPRINTF(message, "%s\n%s", vstrs[(int) V_INVCON],
|
||||
sprintf(message, "%s\n%s", vstrs[(int) V_INVCON],
|
||||
vstrs[(int) V_NOCHANGE]) ;
|
||||
do_continue_notice(X->CFframe, message) ;
|
||||
set_item(OPITEM, "") ;
|
||||
|
@ -3066,7 +3066,7 @@ update_cf_value(void)
|
|||
{
|
||||
len = strlen(result);
|
||||
|
||||
STRCPY(str, result);
|
||||
strcpy(str, result);
|
||||
for(i=0; i < len; i++)
|
||||
str[i] = str[i+1];
|
||||
MPstr_to_num(str, DEC, v->MPcon_vals[X->cfno]) ;
|
||||
|
@ -3085,7 +3085,7 @@ update_cf_value(void)
|
|||
len--;
|
||||
}
|
||||
}
|
||||
SPRINTF(v->con_names[X->cfno], "%1d: %s [%s]",
|
||||
sprintf(v->con_names[X->cfno], "%1d: %s [%s]",
|
||||
X->cfno, result, X->dval) ;
|
||||
break ;
|
||||
case M_FUN : tmpStr = GETMESSAGE(3, 45, ".");
|
||||
|
@ -3100,14 +3100,14 @@ update_cf_value(void)
|
|||
ptr = DtStrchr(X->vval, tmpStr[0]);
|
||||
}
|
||||
}
|
||||
STRCPY(v->fun_vals[X->cfno], convert(X->vval)) ;
|
||||
strcpy(v->fun_vals[X->cfno], convert(X->vval)) ;
|
||||
if(strcmp(X->vval, "") != 0)
|
||||
{
|
||||
SPRINTF(v->fun_names[X->cfno], "%1d: %s [%s]",
|
||||
sprintf(v->fun_names[X->cfno], "%1d: %s [%s]",
|
||||
X->cfno, X->vval, X->dval) ;
|
||||
}
|
||||
else
|
||||
STRCPY(v->fun_names[X->cfno], "");
|
||||
strcpy(v->fun_names[X->cfno], "");
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
|
@ -3211,13 +3211,13 @@ write_cf_value(Widget widget, XtPointer client_data, XtPointer call_data)
|
|||
X->dval[40] = '\0';
|
||||
X->vval = XmTextFieldGetString(X->CFpi_vtext->textfield);
|
||||
X->cfval = XmTextFieldGetString(X->CFpi_cftext->textfield);
|
||||
SSCANF(X->cfval, "%d", &X->cfno) ;
|
||||
sscanf(X->cfval, "%d", &X->cfno) ;
|
||||
if ((strcmp(X->cfval, "") == 0) || X->cfval[0] < '0' || X->cfval[0] > '9' ||
|
||||
X->cfno < 0 || X->cfno > 9)
|
||||
{
|
||||
SPRINTF(str, "%s", (X->CFtype == M_CON) ? vstrs[(int) V_LCON]
|
||||
sprintf(str, "%s", (X->CFtype == M_CON) ? vstrs[(int) V_LCON]
|
||||
: vstrs[(int) V_LFUN]) ;
|
||||
SPRINTF(message, "%s\n%s", str, vstrs[(int) V_RANGE]) ;
|
||||
sprintf(message, "%s\n%s", str, vstrs[(int) V_RANGE]) ;
|
||||
do_continue_notice(X->CFframe, message) ;
|
||||
return ;
|
||||
}
|
||||
|
@ -3234,10 +3234,10 @@ write_cf_value(Widget widget, XtPointer client_data, XtPointer call_data)
|
|||
}
|
||||
if (X->cfexists)
|
||||
{
|
||||
SPRINTF(str, mess[(int) MESS_CON],
|
||||
sprintf(str, mess[(int) MESS_CON],
|
||||
(X->CFtype == M_CON) ? vstrs[(int) V_UCON]
|
||||
: vstrs[(int) V_UFUN], X->cfno) ;
|
||||
SPRINTF(message, "%s\n%s", str, vstrs[(int) V_OWRITE]) ;
|
||||
sprintf(message, "%s\n%s", str, vstrs[(int) V_OWRITE]) ;
|
||||
XtUnmanageChild(X->CFframe) ;
|
||||
do_confirm_notice(X->CFframe, message) ;
|
||||
}
|
||||
|
@ -4402,7 +4402,7 @@ RestoreSession(void)
|
|||
|
||||
if (get_str_resource(R_DISPLAYED, str))
|
||||
{
|
||||
STRCPY(v->display, str);
|
||||
strcpy(v->display, str);
|
||||
MPstr_to_num(str, v->base, v->MPdisp_val) ;
|
||||
}
|
||||
|
||||
|
|
|
@ -395,16 +395,16 @@ init_text(void) /* Setup text strings depending upon language. */
|
|||
calc_res[(int) R_MENUBAR] = DGET("postMenuBar") ;
|
||||
calc_res[(int) R_KEYS] = DGET("keys") ;
|
||||
|
||||
STRCPY(v->con_names[0], LGET(GETMESSAGE(3, 119, "kilometers per hour <=> miles per hour."))) ;
|
||||
STRCPY(v->con_names[1], LGET(GETMESSAGE(3, 120, "square root of 2."))) ;
|
||||
STRCPY(v->con_names[2], LGET(GETMESSAGE(3, 121, "e."))) ;
|
||||
STRCPY(v->con_names[3], LGET(GETMESSAGE(3, 122, "pi."))) ;
|
||||
STRCPY(v->con_names[4], LGET(GETMESSAGE(3, 123, "centimeters <=> inch."))) ;
|
||||
STRCPY(v->con_names[5], LGET(GETMESSAGE(3, 124, "degrees in a radian."))) ;
|
||||
STRCPY(v->con_names[6], LGET(GETMESSAGE(3, 125, "2 ^ 20."))) ;
|
||||
STRCPY(v->con_names[7], LGET(GETMESSAGE(3, 126, "grams <=> ounce."))) ;
|
||||
STRCPY(v->con_names[8], LGET(GETMESSAGE(3, 127, "kilojoules <=> British thermal units."))) ;
|
||||
STRCPY(v->con_names[9], LGET(GETMESSAGE(3, 128, "cubic centimeters <=> cubic inches."))) ;
|
||||
strcpy(v->con_names[0], LGET(GETMESSAGE(3, 119, "kilometers per hour <=> miles per hour."))) ;
|
||||
strcpy(v->con_names[1], LGET(GETMESSAGE(3, 120, "square root of 2."))) ;
|
||||
strcpy(v->con_names[2], LGET(GETMESSAGE(3, 121, "e."))) ;
|
||||
strcpy(v->con_names[3], LGET(GETMESSAGE(3, 122, "pi."))) ;
|
||||
strcpy(v->con_names[4], LGET(GETMESSAGE(3, 123, "centimeters <=> inch."))) ;
|
||||
strcpy(v->con_names[5], LGET(GETMESSAGE(3, 124, "degrees in a radian."))) ;
|
||||
strcpy(v->con_names[6], LGET(GETMESSAGE(3, 125, "2 ^ 20."))) ;
|
||||
strcpy(v->con_names[7], LGET(GETMESSAGE(3, 126, "grams <=> ounce."))) ;
|
||||
strcpy(v->con_names[8], LGET(GETMESSAGE(3, 127, "kilojoules <=> British thermal units."))) ;
|
||||
strcpy(v->con_names[9], LGET(GETMESSAGE(3, 128, "cubic centimeters <=> cubic inches."))) ;
|
||||
|
||||
/* Keyboard equivalents for the dtcalc menu entries. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue