conf: cast subtraction operands in source comparison
Cast the values to int to not break the sorting in case they are changed to unsigned types.
This commit is contained in:
parent
7ff74d9efe
commit
37deee7140
1 changed files with 3 additions and 3 deletions
6
conf.c
6
conf.c
|
@ -1660,11 +1660,11 @@ compare_sources(const void *a, const void *b)
|
|||
return 1;
|
||||
if ((d = strcmp(sa->params.name, sb->params.name)) != 0)
|
||||
return d;
|
||||
if ((d = (int)(sa->type) - (int)(sb->type)) != 0)
|
||||
if ((d = (int)sa->type - (int)sb->type) != 0)
|
||||
return d;
|
||||
if ((d = sa->pool - sb->pool) != 0)
|
||||
if ((d = (int)sa->pool - (int)sb->pool) != 0)
|
||||
return d;
|
||||
if ((d = sa->params.port - sb->params.port) != 0)
|
||||
if ((d = (int)sa->params.port - (int)sb->params.port) != 0)
|
||||
return d;
|
||||
return memcmp(&sa->params.params, &sb->params.params, sizeof (sa->params.params));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue