summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
12 daysnegf: Fix -Wformat-truncation warningHEADmasterAlan Coopersmith1-1/+1
math.c: In function ‘negf’: math.c:474:36: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] 474 | snprintf(tmp, sizeof(tmp), "-%s", dispstr); | ^ math.c:474:5: note: ‘snprintf’ output between 2 and 33 bytes into a destination of size 32 474 | snprintf(tmp, sizeof(tmp), "-%s", dispstr); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xcalc/-/merge_requests/13>
2023-05-04xcalc 1.1.2xcalc-1.1.2Alan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-18Accept number keys on main keyboard when NumLock is onAlan Coopersmith1-0/+10
Adds translations with NumLock modifier active, since removing "None" from the existing translations would make shifted keys enter numbers instead of doing the operations corresponding to the shifted character. Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=173314 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-05Add -help optionAlan Coopersmith2-10/+23
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-05Stop casting function returns to voidAlan Coopersmith2-13/+13
This was used with old versions of lint to stop warnings about unused return values. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-05Fix -version handling to not require opening a display firstAlan Coopersmith1-11/+15
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-28Add -version optionAlan Coopersmith2-1/+14
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-26Key color highlighting still incorrectMichael Bäuerle1-15/+41
Update red keys on right and make the hexadecimal digit keys white too Fixes: 19eb8ce ("TI mode: correct key color highlighting") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-16gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-03xcalc 1.1.1xcalc-1.1.1Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-02man page: remove out-of-date COPYRIGHT sectionAlan Coopersmith1-4/+0
The information previously listed here didn't match what is present in the source code or the COPYING file, and the X(7) man page doesn't list any license information as this had claimed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-04Build xz tarballs instead of bzip2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-04gitlab CI: add a basic build testAlan Coopersmith1-0/+98
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-28Fix spelling/wording issuesAlan Coopersmith2-2/+2
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-09-17TI mode: correct key color highlightingAlan Coopersmith1-39/+43
Decimal number key mapping in XCalc-color was offset after adding the bitwise ops & base conversion keys in commit c4f1bdb1 Fixes: #2 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-09xcalc 1.1.0xcalc-1.1.0Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-01Fix -Wsign-compare warning in quit() functionAlan Coopersmith1-1/+2
Reported by gcc 7.3: actions.c: In function ‘quit’: actions.c:414:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (ev->type == ClientMessage && ev->xclient.data.l[0] != wm_delete_window) ^~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-01Fix -Wsign-compare warning in Syntax() functionAlan Coopersmith1-4/+2
Reported by gcc 7.3: xcalc.c: In function ‘Syntax’: xcalc.c:322:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i=0; i < XtNumber(Options); i++) ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-01Pass -D_CONST_X_STRING to make libXt declare String as const char *Alan Coopersmith1-1/+1
Clears up 58 of 62 gcc -Wdiscarded-qualifiers warnings in the xcalc build Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-01Add bitwise ops and base conversion (DEC/OCT/HEX) to man pageAlan Coopersmith1-1/+45
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-18Add bitwise ops and base conversion (DEC/OCT/HEX) in TI modeTim Hentenaar5-95/+426
These operations implicitly truncate their parameters, and result to integers: * not * and * or * xor * shl * shr * mod * trunc Base 2 was left out of the base conversion code intentionally as it would require making the UI at least one third wider. Attempts to change base with negative values will simply display "error." Note that with larger numbers, the result may be inaccurate due to rounding. I've also bound the Return key to the equal() action. Signed-off-by: Tim Hentenaar <tim@hentenaar.com>
2019-02-17xcalc 1.0.7xcalc-1.0.7Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-01-06Reduce scope of i (cppcheck --verbose --enable=all)Stéphane Aulery1-2/+1
Signed-off-by: Stéphane Aulery <lkppo@free.fr> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-01-06Reduce scope of cell (cppcheck --verbose --enable=all)Stéphane Aulery1-2/+3
Signed-off-by: Stéphane Aulery <lkppo@free.fr> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-21Update configure.ac bug URL for gitlab migrationAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-16Update README for gitlab migrationAlan Coopersmith3-26/+19
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-05-05Reword fall through comments to appease gcc -Wimplicit-fallthroughAlan Coopersmith1-3/+3
Gets rid of these warnings: math.c:707:24: warning: this statement may fall through [-Wimplicit-fallthrough=] case kSQR: flagINV = !flagINV; /* fall through to */ ~~~~~~~~^~~~~~~~~~ math.c:708:3: note: here case kSQRT: if (flagINV) dnum=dnum*dnum; ^~~~ math.c:711:24: warning: this statement may fall through [-Wimplicit-fallthrough=] case k10X: flagINV = !flagINV; /* fall through to */ ~~~~~~~~^~~~~~~~~~ math.c:712:3: note: here case kLOG: if (flagINV) dnum=pow(10.0,dnum); ^~~~ math.c:715:24: warning: this statement may fall through [-Wimplicit-fallthrough=] case kEXP: flagINV = !flagINV; /* fall through to */ ~~~~~~~~^~~~~~~~~~ math.c:716:3: note: here case kLN: if (flagINV) dnum=exp(dnum); ^~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-05-05Fix misleading indentation in math.cAlan Coopersmith1-4/+4
math.c: In function ‘numeric’: math.c:267:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentat ion] if ((int) strlen(dispstr) >= MAXDISP) ^~ math.c:270:5: note: ...this statement, but the latter is misleadingly indented a s if it were guarded by the ‘if’ switch (keynum){ ^~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26autogen: add default patch prefixMihail Konev1-0/+3
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov1-4/+4
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer1-1/+1
Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2015-01-19xcalc 1.0.6xcalc-1.0.6Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-08-07Replace index() call with strchr()Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-02autogen.sh: Honor NOCONFIGURE=1Alan Coopersmith1-2/+3
See http://people.gnome.org/~walters/docs/build-api.txt Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-02configure: Drop AM_MAINTAINER_MODEAlan Coopersmith2-2/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-12-18Replace signal_t with voidGaetan Nadon2-7/+4
Now that Imake SIGNALRETURNSINT has been removed, the signal handler function return type can only be void. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-12-16Assume signal handlers return void, as C89 requiresGaetan Nadon1-4/+0
Drops use of Imake's obsolete SIGNALRETURNSINT. Reviewd-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2013-07-09Mark functions noreturn as suggested by gcc -Wmissing-noreturnAlan Coopersmith2-4/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-09Rename "e" arguments to "ev" to avoid shadowing e() functionAlan Coopersmith1-84/+84
Resolves many gcc warnings of the form: actions.c: In function ‘add’: actions.c:142:35: warning: declaration of ‘e’ shadows a global declaration actions.c:57:13: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-09Remove redundant redeclaration of ‘factorial’Alan Coopersmith1-1/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-09Replace sprintf & strcpy calls with snprintf & strlcpyAlan Coopersmith3-33/+52
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-06Remove unused min & max macros from math.cAlan Coopersmith1-2/+1
Flagged by clang: math.c:33:9: warning: macro is not used [-Wunused-macros] #define min(a,b) ((a) < (b) ? (a) : (b)) ^ math.c:34:9: warning: macro is not used [-Wunused-macros] #define max(a,b) ((a) > (b) ? (a) : (b)) ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-06Use the new M_E symbol from math.hStéphane Aulery1-2/+6
Use the new M_E symbol from math.h and fix and a value of the same accuracy if it's necessary to redefine M_E. Signed-off-by: Stéphane Aulery <lkppo@free.fr> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-06Use the new M_PI symbol from math.hStéphane Aulery1-13/+13
Use the new M_PI symbol from math.h and fix and a value of the same accuracy if it's necessary to redefine M_PI. Signed-off-by: Stéphane Aulery <lkppo@free.fr> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-06Drop CRAY supportStéphane Aulery1-27/+0
Signed-off-by: Stéphane Aulery <lkppo@free.fr> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-14xcalc 1.0.5xcalc-1.0.5Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-08-23Use table markup rather than tab stops. Aids DocBook translation.Eric S. Raymond1-54/+62
2011-09-28Strip trailing whitespaceAlan Coopersmith6-49/+49
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Add const to parse_double() args to fix gcc -Wwrite-strings warningsAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-01-19config: move man pages into their own directoryGaetan Nadon4-18/+18
Use services provided by XORG_MANPAGE_SECTIONS. Use standard Makefile for man pages. Signed-off-by: Gaetan Nadon <memsize@videotron.ca>