Skip to content
Snippets Groups Projects
  1. Mar 02, 2025
  2. Dec 08, 2024
  3. Nov 11, 2024
  4. May 03, 2024
    • Alan Coopersmith's avatar
      negf: Fix -Wformat-truncation warning · 6f3abc4e
      Alan Coopersmith authored
      
      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: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Part-of: <!13>
      6f3abc4e
  5. May 04, 2023
  6. Feb 18, 2023
  7. Feb 05, 2023
  8. Jan 28, 2023
  9. Jan 26, 2023
  10. Jul 16, 2022
  11. Apr 03, 2022
  12. Apr 02, 2022
  13. Dec 04, 2021
  14. Nov 28, 2021
  15. Sep 18, 2021
  16. Jun 09, 2019
  17. Jun 02, 2019
  18. Feb 18, 2019
    • Tim Hentenaar's avatar
      Add bitwise ops and base conversion (DEC/OCT/HEX) in TI mode · c4f1bdb1
      Tim Hentenaar authored
      
      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: default avatarTim Hentenaar <tim@hentenaar.com>
      c4f1bdb1
  19. Feb 17, 2019
  20. Jan 06, 2019
  21. Nov 22, 2018
  22. Nov 17, 2018
  23. May 05, 2018
    • Alan Coopersmith's avatar
      Reword fall through comments to appease gcc -Wimplicit-fallthrough · 8df4b463
      Alan Coopersmith authored
      
      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: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      8df4b463
    • Alan Coopersmith's avatar
      Fix misleading indentation in math.c · 7a90211e
      Alan Coopersmith authored
      
      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: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      7a90211e
  24. Jan 26, 2017
  25. Jan 20, 2015
  26. Aug 08, 2014
  27. Jun 03, 2014
Loading