mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -05:00
warn about and fix some -Wpointer-sign warnings
This commit is contained in:
parent
92c541ea03
commit
94dbd4f9b8
3 changed files with 5 additions and 4 deletions
|
|
@ -68,6 +68,7 @@ if cc.get_id() == 'gcc'
|
||||||
add_global_arguments('-fvisibility=hidden',
|
add_global_arguments('-fvisibility=hidden',
|
||||||
'-Wsign-compare',
|
'-Wsign-compare',
|
||||||
'-Wpointer-arith',
|
'-Wpointer-arith',
|
||||||
|
'-Wpointer-sign',
|
||||||
'-Wformat',
|
'-Wformat',
|
||||||
'-Wformat-security',
|
'-Wformat-security',
|
||||||
'-Werror=suggest-attribute=format',
|
'-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);
|
spa_pod_parser_pod(&prs, pi->info);
|
||||||
if (spa_pod_parser_push_struct(&prs, &f[0]) < 0 ||
|
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;
|
break;
|
||||||
|
|
||||||
for (n = 0; n < pi->n_props; n++) {
|
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)
|
static int read_string(struct message *m, char **str)
|
||||||
{
|
{
|
||||||
uint32_t n, maxlen = m->length - m->offset;
|
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)
|
if (n == maxlen)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
*str = m->data + m->offset;
|
*str = SPA_MEMBER(m->data, m->offset, char);
|
||||||
m->offset += n + 1;
|
m->offset += n + 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -419,7 +419,7 @@ static void write_string(struct message *m, const char *s)
|
||||||
if (s != NULL) {
|
if (s != NULL) {
|
||||||
int len = strlen(s) + 1;
|
int len = strlen(s) + 1;
|
||||||
if (ensure_size(m, len) > 0)
|
if (ensure_size(m, len) > 0)
|
||||||
strcpy(&m->data[m->length], s);
|
strcpy(SPA_MEMBER(m->data, m->length, char), s);
|
||||||
m->length += len;
|
m->length += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue