mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Fixed compiler warnings
Fixed some compiler warnings. Added work around for a gcc warning bug.
This commit is contained in:
15
CHANGES
15
CHANGES
@@ -1,7 +1,18 @@
|
|||||||
The following are the changes from calc version 2.12.6.5 to date:
|
The following are the changes from calc version 2.12.6.6 to date:
|
||||||
|
|
||||||
|
For historical purposes, in lucas.cal, gen_v1(1, n) always returns 4.
|
||||||
|
|
||||||
|
Fixed some compiler warnings, thanks to a report by Mike
|
||||||
|
<michael dot d dot ince at gmail dot com>.
|
||||||
|
|
||||||
|
Added work around for a gcc warning bug, thanks to a report by Mike
|
||||||
|
<michael dot d dot ince at gmail dot com>.
|
||||||
|
|
||||||
|
|
||||||
|
The following are the changes from calc version 2.12.6.4 to 2.12.6.5:
|
||||||
|
|
||||||
Fixed warning about undefined operations involving the qlink(q)
|
Fixed warning about undefined operations involving the qlink(q)
|
||||||
macro by deplacing that macro with an inline-function. Thanks goes
|
macro by replacing that macro with an inline-function. Thanks goes
|
||||||
to David Haller <dnh at opensuse dot org> for this fix.
|
to David Haller <dnh at opensuse dot org> for this fix.
|
||||||
|
|
||||||
NOTE for Windows 10 users: Pavel Nemec <pane at seznam dot cz>
|
NOTE for Windows 10 users: Pavel Nemec <pane at seznam dot cz>
|
||||||
|
10
calc.c
10
calc.c
@@ -104,6 +104,7 @@ main(int argc, char **argv)
|
|||||||
int c; /* option */
|
int c; /* option */
|
||||||
int index;
|
int index;
|
||||||
int maxindex;
|
int maxindex;
|
||||||
|
int unusedint = 0; /* avoids gcc compiler warning bug - '...assigned, but never used...' */
|
||||||
char *cp;
|
char *cp;
|
||||||
char *endcp;
|
char *endcp;
|
||||||
char *bp;
|
char *bp;
|
||||||
@@ -278,7 +279,7 @@ main(int argc, char **argv)
|
|||||||
exit(6);
|
exit(6);
|
||||||
}
|
}
|
||||||
calc_debug = cp;
|
calc_debug = cp;
|
||||||
(void) strtol(cp, &endcp, 10);
|
unusedint = strtol(cp, &endcp, 10); /* avoids gcc compiler warning bug */
|
||||||
cp = endcp;
|
cp = endcp;
|
||||||
if (*cp != '\0' &&
|
if (*cp != '\0' &&
|
||||||
*cp != ' ' && *cp != ':') {
|
*cp != ' ' && *cp != ':') {
|
||||||
@@ -310,7 +311,7 @@ main(int argc, char **argv)
|
|||||||
exit(9);
|
exit(9);
|
||||||
}
|
}
|
||||||
resource_debug = cp;
|
resource_debug = cp;
|
||||||
(void) strtol(cp, &endcp, 10);
|
unusedint = strtol(cp, &endcp, 10); /* avoids gcc compiler warning bug */
|
||||||
cp = endcp;
|
cp = endcp;
|
||||||
if (*cp != '\0' &&
|
if (*cp != '\0' &&
|
||||||
*cp != ' ' && *cp != ':') {
|
*cp != ' ' && *cp != ':') {
|
||||||
@@ -340,7 +341,7 @@ main(int argc, char **argv)
|
|||||||
exit(12);
|
exit(12);
|
||||||
}
|
}
|
||||||
user_debug = cp;
|
user_debug = cp;
|
||||||
(void) strtol(cp, &endcp, 10);
|
unusedint = strtol(cp, &endcp, 10); /* avoids gcc compiler warning bug */
|
||||||
cp = endcp;
|
cp = endcp;
|
||||||
if (*cp != '\0' && *cp != ' ') {
|
if (*cp != '\0' && *cp != ' ') {
|
||||||
fprintf(stderr, "Bad syntax in"
|
fprintf(stderr, "Bad syntax in"
|
||||||
@@ -721,8 +722,9 @@ main(int argc, char **argv)
|
|||||||
printf("main: run_state = %s\n", run_state_name(run_state));
|
printf("main: run_state = %s\n", run_state_name(run_state));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* all done
|
* All done! - Jessica Noll, Age 2
|
||||||
*/
|
*/
|
||||||
|
unusedint++; /* avoids gcc compiler warning bug */
|
||||||
libcalc_call_me_last();
|
libcalc_call_me_last();
|
||||||
return (run_state == RUN_EXIT_WITH_ERROR ||
|
return (run_state == RUN_EXIT_WITH_ERROR ||
|
||||||
run_state == RUN_ZERO) ? 1 : 0;
|
run_state == RUN_ZERO) ? 1 : 0;
|
||||||
|
2
value.c
2
value.c
@@ -2944,7 +2944,7 @@ printestr(VALUE *vp)
|
|||||||
bp = vp->v_nblock->blk;
|
bp = vp->v_nblock->blk;
|
||||||
}
|
}
|
||||||
i = bp->datalen;
|
i = bp->datalen;
|
||||||
math_fmt("%ld,%d)", i, bp->blkchunk);
|
math_fmt("%ld,%d)", i, (int) bp->blkchunk);
|
||||||
cp = bp->data;
|
cp = bp->data;
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
math_str("={");
|
math_str("={");
|
||||||
|
Reference in New Issue
Block a user