spa: bluez: fix -Walloc-size

GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
./pipewire-0.3.84/spa/plugins/bluez5/codec-loader.c:176:14: warning: allocation of insufficient size ‘1’ for type ‘struct impl’ with size ‘1032’ [-Walloc-size]
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(struct impl)`. GCC then sees we're not
doing anything wrong.

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2023-11-05 21:36:49 +00:00
parent 33db334765
commit 0e35750fde
No known key found for this signature in database
GPG key ID: 738409F520DF9190

View file

@ -173,7 +173,7 @@ const struct media_codec * const *load_media_codecs(struct spa_plugin_loader *lo
#undef MEDIA_CODEC_FACTORY_LIB
};
impl = calloc(sizeof(struct impl), 1);
impl = calloc(1, sizeof(struct impl));
if (impl == NULL)
return NULL;