InfiniTimeOrg / InfiniSim

Simulator for InfiniTime user interface without needing a PineTime
GNU General Public License v3.0
166 stars 66 forks source link

main: fix format strings specifiers #114

Closed faxe1008 closed 5 months ago

faxe1008 commented 1 year ago

Fixes warnings while compiling project :^)

NeroBurner commented 1 year ago

Can you provide the messages of the warnings you are fixing?

faxe1008 commented 1 year ago
/home/faxe/projects/InfiniSim/main.cpp: In constructor ‘Framework::Framework(bool, int, int)’:
/home/faxe/projects/InfiniSim/main.cpp:446:38: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  446 |         printf("initial free_size = %u\n", xPortGetFreeHeapSize());
      |                                     ~^     ~~~~~~~~~~~~~~~~~~~~~~
      |                                      |                         |
      |                                      unsigned int              size_t {aka long unsigned int}
      |                                     %lu
/home/faxe/projects/InfiniSim/main.cpp: In member function ‘void Framework::refresh_screen()’:
/home/faxe/projects/InfiniSim/main.cpp:931:45: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  931 |           printf("Mem: %5u used (change: %+5d, peak: %5u) %d budget left\n", mem_used, lastFreeHeapSize - currentFreeHeap, minimumEverFreeHeap, budget);
      |                                          ~~~^                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                             |                                                           |
      |                                             int                                                         size_t {aka long unsigned int}
      |                                          %+5ld
/home/faxe/projects/InfiniSim/main.cpp:931:56: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
  931 |           printf("Mem: %5u used (change: %+5d, peak: %5u) %d budget left\n", mem_used, lastFreeHeapSize - currentFreeHeap, minimumEverFreeHeap, budget);
      |                                                      ~~^                                                                   ~~~~~~~~~~~~~~~~~~~
      |                                                        |                                                                   |
      |                                                        unsigned int                                                        long unsigned int
      |                                                      %5lu