Skip to content

qmi-firmware-update,sahara: fix warnings with -Wsign-compare

In file included from /usr/lib/glib-2.0/include/glibconfig.h:9,
                   from /usr/include/glib-2.0/glib/gtypes.h:32,
                   from /usr/include/glib-2.0/glib/galloca.h:32,
                   from /usr/include/glib-2.0/glib.h:30,
                   from /usr/include/glib-2.0/gobject/gbinding.h:28,
                   from /usr/include/glib-2.0/glib-object.h:23,
                   from qfu-sahara-device.c:30:
  qfu-sahara-device.c: In function 'receive_response':
  qfu-sahara-device.c:245:20: error: comparison of integer expressions of different signedness: 'gssize' {aka 'int'} and 'guint' {aka 'unsigned int'} [-Werror=sign-compare]
    245 |     g_assert (rlen <= self->priv->buffer->len - 1);
        |                    ^~
  /usr/include/glib-2.0/glib/gmacros.h:928:8: note: in definition of macro '_G_BOOLEAN_EXPR'
    928 |    if (expr)                                    \
        |        ^~~~
  /usr/include/glib-2.0/glib/gtestutils.h:164:49: note: in expansion of macro 'G_LIKELY'
    164 |                                              if G_LIKELY (expr) ; else \
        |                                                 ^~~~~~~~
  qfu-sahara-device.c:245:5: note: in expansion of macro 'g_assert'
    245 |     g_assert (rlen <= self->priv->buffer->len - 1);
        |     ^~~~~~~~
  qfu-sahara-device.c: In function 'qfu_sahara_device_firehose_write_block':
  qfu-sahara-device.c:656:22: error: comparison of integer expressions of different signedness: 'gssize' {aka 'int'} and 'guint' {aka 'unsigned int'} [-Werror=sign-compare]
    656 |     g_assert (reqlen <= self->priv->transfer_block_size);
        |                      ^~
  /usr/include/glib-2.0/glib/gmacros.h:928:8: note: in definition of macro '_G_BOOLEAN_EXPR'
    928 |    if (expr)                                    \
        |        ^~~~
  /usr/include/glib-2.0/glib/gtestutils.h:164:49: note: in expansion of macro 'G_LIKELY'
    164 |                                              if G_LIKELY (expr) ; else \
        |                                                 ^~~~~~~~
  qfu-sahara-device.c:656:5: note: in expansion of macro 'g_assert'
    656 |     g_assert (reqlen <= self->priv->transfer_block_size);
        |     ^~~~~~~~

Fixes #30 (closed)

Edited by Aleksander Morgado

Merge request reports