Fix some format string warnings from clang
authorAntonio Ospite <ao2@ao2.it>
Sat, 7 Nov 2015 21:33:03 +0000 (22:33 +0100)
committerAntonio Ospite <ao2@ao2.it>
Sat, 7 Nov 2015 21:46:08 +0000 (22:46 +0100)
commitb0731f05fb3ddcbea19c88d628e1b539966c21fd
tree6f0da2d91e81ed8817ce8dd9ed40a65a87d5438b
parentfdb8045c91881d75c68a08e65dc1e00f89bc0497
Fix some format string warnings from clang

Building with clang gives some format string warnings as below, fix them
by using the correct format string when printing out the values.

  .../libam7xxx/src/am7xxx.c:804:38: warning:
  format specifies type 'unsigned char' but the argument has type 'int'
  [-Wformat]
                        (*dev)->desc->configuration, current_configuration);
                                                     ^~~~~~~~~~~~~~~~~~~~~
  .../libam7xxx/src/am7xxx.c:65:85: note:
  expanded from macro 'debug'
  #define debug(ctx, ...)   log_message(ctx, AM7XXX_LOG_DEBUG, __func__, 0, __VA_ARGS__)
                                                                            ^
  1 warning generated.

  [...]

  .../libam7xxx/examples/am7xxx-modeswitch.c:75:5:
  warning: format specifies type 'unsigned char' but the argument has type
  'int' [-Wformat]
                                  AM7XXX_STORAGE_CONFIGURATION);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  .../libam7xxx/examples/am7xxx-modeswitch.c:26:38:
  note: expanded from macro 'AM7XXX_STORAGE_CONFIGURATION'
  #define AM7XXX_STORAGE_CONFIGURATION 1
                                       ^
  .../libam7xxx/examples/am7xxx-modeswitch.c:87:4:
  warning: format specifies type 'unsigned char' but the argument has type
  'int' [-Wformat]
                          AM7XXX_STORAGE_INTERFACE);
                          ^~~~~~~~~~~~~~~~~~~~~~~~
  .../libam7xxx/examples/am7xxx-modeswitch.c:27:38:
  note: expanded from macro 'AM7XXX_STORAGE_INTERFACE'
  #define AM7XXX_STORAGE_INTERFACE     0
                                       ^
  .../libam7xxx/examples/am7xxx-modeswitch.c:104:4:
  warning: format specifies type 'unsigned char' but the argument has type
  'int' [-Wformat]
                          AM7XXX_STORAGE_CONFIGURATION, current_configuration);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  .../libam7xxx/examples/am7xxx-modeswitch.c:26:38:
  note: expanded from macro 'AM7XXX_STORAGE_CONFIGURATION'
  #define AM7XXX_STORAGE_CONFIGURATION 1
                                       ^
  .../libam7xxx/examples/am7xxx-modeswitch.c:104:34:
  warning: format specifies type 'unsigned char' but the argument has type
  'int' [-Wformat]
                          AM7XXX_STORAGE_CONFIGURATION, current_configuration);
                                                        ^~~~~~~~~~~~~~~~~~~~~
  4 warnings generated.
examples/am7xxx-modeswitch.c
src/am7xxx.c