fix some uninitialized variables warnings

This commit is contained in:
Wim Taymans 2026-04-08 11:29:36 +02:00
parent abd8c8f666
commit 0e0c325194
6 changed files with 8 additions and 9 deletions

View file

@ -1651,7 +1651,7 @@ static const struct pw_stream_events out_stream_events = {
static int setup_streams(struct impl *impl)
{
int res;
int res = 0;
uint32_t i, n_params, *offs, flags;
struct pw_array offsets;
const struct spa_pod **params = NULL;

View file

@ -4750,7 +4750,6 @@ static int do_set_profile(struct client *client, uint32_t command, uint32_t tag,
static int do_set_default(struct client *client, uint32_t command, uint32_t tag, struct message *m)
{
struct pw_manager *manager = client->manager;
struct pw_manager_object *o;
const char *name, *str;
int res;
bool sink = command == COMMAND_SET_DEFAULT_SINK;
@ -4767,10 +4766,10 @@ static int do_set_default(struct client *client, uint32_t command, uint32_t tag,
if (spa_streq(name, "@NONE@"))
name = NULL;
if (name != NULL && (o = find_device(client, SPA_ID_INVALID, name, sink, NULL)) == NULL)
return -ENOENT;
if (name != NULL) {
struct pw_manager_object *o;
if ((o = find_device(client, SPA_ID_INVALID, name, sink, NULL)) == NULL)
return -ENOENT;
if (o->props && (str = pw_properties_get(o->props, PW_KEY_NODE_NAME)) != NULL)
name = str;
else if (spa_strendswith(name, ".monitor"))

View file

@ -481,7 +481,7 @@ int pw_rtsp_client_connect(struct pw_rtsp_client *client,
{
struct addrinfo hints;
struct addrinfo *result, *rp;
int res, fd;
int res, fd = -1;
char port_str[12];
if (client->source != NULL)

View file

@ -963,7 +963,7 @@ int pw_websocket_connect(struct pw_websocket *ws, void *user,
{
struct addrinfo hints;
struct addrinfo *result, *rp;
int res, fd;
int res, fd = -1;
struct pw_websocket_connection *conn = NULL;
memset(&hints, 0, sizeof(hints));

View file

@ -416,7 +416,7 @@ static int snapcast_connect(struct tunnel *t)
{
struct addrinfo hints;
struct addrinfo *result, *rp;
int res, fd;
int res, fd = -1;
char port_str[12];
if (t->server_address == NULL)

View file

@ -141,7 +141,7 @@ pw_context_load_module(struct pw_context *context,
{
struct pw_impl_module *this;
struct impl *impl;
void *hnd;
void *hnd = NULL;
char *filename = NULL;
const char *module_dir;
int res;