port-serial-qcdm: fix warnings with -Wsign-compare
mm-port-serial-qcdm.c: In function ‘find_qcdm_start’:
mm-port-serial-qcdm.c:51:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
51 | for (i = 0; i < response->len; i++) {
| ^
This commit is contained in:
@@ -40,7 +40,8 @@ struct _MMPortSerialQcdmPrivate {
|
||||
static gboolean
|
||||
find_qcdm_start (GByteArray *response, gsize *start)
|
||||
{
|
||||
int i, last = -1;
|
||||
guint i;
|
||||
gint last = -1;
|
||||
|
||||
/* Look for 3 bytes and a QCDM frame marker, ie enough data for a valid
|
||||
* frame. There will usually be three cases here; (1) a QCDM frame
|
||||
@@ -50,7 +51,7 @@ find_qcdm_start (GByteArray *response, gsize *start)
|
||||
*/
|
||||
for (i = 0; i < response->len; i++) {
|
||||
if (response->data[i] == 0x7E) {
|
||||
if (i > last + 3) {
|
||||
if (i > (guint)(last + 3)) {
|
||||
/* Got a full QCDM frame; 3 non-0x7E bytes and a terminator */
|
||||
if (start)
|
||||
*start = last + 1;
|
||||
|
||||
Reference in New Issue
Block a user