mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-04 15:10:20 +00:00
warn about and fix some -Wpointer-sign warnings
This commit is contained in:
parent
92c541ea03
commit
94dbd4f9b8
|
@ -68,6 +68,7 @@ if cc.get_id() == 'gcc'
|
|||
add_global_arguments('-fvisibility=hidden',
|
||||
'-Wsign-compare',
|
||||
'-Wpointer-arith',
|
||||
'-Wpointer-sign',
|
||||
'-Wformat',
|
||||
'-Wformat-security',
|
||||
'-Werror=suggest-attribute=format',
|
||||
|
|
|
@ -471,7 +471,7 @@ static uint32_t collect_port_info(struct pw_manager_object *card, struct card_in
|
|||
|
||||
spa_pod_parser_pod(&prs, pi->info);
|
||||
if (spa_pod_parser_push_struct(&prs, &f[0]) < 0 ||
|
||||
spa_pod_parser_get_int(&prs, &pi->n_props) < 0)
|
||||
spa_pod_parser_get_int(&prs, (int32_t*)&pi->n_props) < 0)
|
||||
break;
|
||||
|
||||
for (n = 0; n < pi->n_props; n++) {
|
||||
|
|
|
@ -180,10 +180,10 @@ static int read_arbitrary(struct message *m, const void **val, size_t length)
|
|||
static int read_string(struct message *m, char **str)
|
||||
{
|
||||
uint32_t n, maxlen = m->length - m->offset;
|
||||
n = strnlen(m->data + m->offset, maxlen);
|
||||
n = strnlen(SPA_MEMBER(m->data, m->offset, char), maxlen);
|
||||
if (n == maxlen)
|
||||
return -EINVAL;
|
||||
*str = m->data + m->offset;
|
||||
*str = SPA_MEMBER(m->data, m->offset, char);
|
||||
m->offset += n + 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ static void write_string(struct message *m, const char *s)
|
|||
if (s != NULL) {
|
||||
int len = strlen(s) + 1;
|
||||
if (ensure_size(m, len) > 0)
|
||||
strcpy(&m->data[m->length], s);
|
||||
strcpy(SPA_MEMBER(m->data, m->length, char), s);
|
||||
m->length += len;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue