summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-15 17:43:14 +0200
committerDavid Robillard <d@drobilla.net>2020-07-16 23:37:49 +0200
commit5682a7eeda2a050dec1f963a01b06b53e9df0a2f (patch)
tree4e2ecf62d3d469d871900864d55d75e773006726
parent8ad1fef18a1573bd8f8818a20b3c8d4708b42cc3 (diff)
downloadlilv-5682a7eeda2a050dec1f963a01b06b53e9df0a2f.tar.gz
lilv-5682a7eeda2a050dec1f963a01b06b53e9df0a2f.tar.bz2
lilv-5682a7eeda2a050dec1f963a01b06b53e9df0a2f.zip
Add missing variable initializations
-rw-r--r--src/state.c3
-rw-r--r--src/util.c4
-rw-r--r--src/world.c6
3 files changed, 7 insertions, 6 deletions
diff --git a/src/state.c b/src/state.c
index d741e4a..e4e381a 100644
--- a/src/state.c
+++ b/src/state.c
@@ -433,7 +433,8 @@ lilv_state_new_from_instance(const LilvPlugin* plugin,
const LilvPort* const port = plugin->ports[i];
if (lilv_port_is_a(plugin, port, lv2_ControlPort)
&& lilv_port_is_a(plugin, port, lv2_InputPort)) {
- uint32_t size, type;
+ uint32_t size = 0;
+ uint32_t type = 0;
const char* sym = lilv_node_as_string(port->symbol);
const void* value = get_value(sym, user_data, &size, &type);
append_port_value(state, sym, value, size, type);
diff --git a/src/util.c b/src/util.c
index 8758742..dd29488 100644
--- a/src/util.c
+++ b/src/util.c
@@ -417,7 +417,7 @@ update_latest(const char* path, const char* name, void* data)
{
Latest* latest = (Latest*)data;
char* entry_path = lilv_path_join(path, name);
- unsigned num;
+ unsigned num = 0;
if (sscanf(entry_path, latest->pattern, &num) == 1) {
struct stat st;
if (!stat(entry_path, &st)) {
@@ -574,7 +574,7 @@ lilv_dir_for_each(const char* path,
#else
DIR* dir = opendir(path);
if (dir) {
- for (struct dirent* entry; (entry = readdir(dir));) {
+ for (struct dirent* entry = NULL; (entry = readdir(dir));) {
f(path, entry->d_name, data);
}
closedir(dir);
diff --git a/src/world.c b/src/world.c
index fc4fc7e..2650490 100644
--- a/src/world.c
+++ b/src/world.c
@@ -892,7 +892,7 @@ lilv_world_drop_graph(LilvWorld* world, const SordNode* graph)
static int
lilv_world_unload_file(LilvWorld* world, const LilvNode* file)
{
- ZixTreeIter* iter;
+ ZixTreeIter* iter = NULL;
if (!zix_tree_find((ZixTree*)world->loaded_files, file, &iter)) {
zix_tree_remove((ZixTree*)world->loaded_files, iter);
return 0;
@@ -1108,12 +1108,12 @@ lilv_world_load_all(LilvWorld* world)
SerdStatus
lilv_world_load_file(LilvWorld* world, SerdReader* reader, const LilvNode* uri)
{
- ZixTreeIter* iter;
+ ZixTreeIter* iter = NULL;
if (!zix_tree_find((ZixTree*)world->loaded_files, uri, &iter)) {
return SERD_FAILURE; // File has already been loaded
}
- size_t uri_len;
+ size_t uri_len = 0;
const uint8_t* const uri_str = sord_node_get_string_counted(
uri->node, &uri_len);
if (strncmp((const char*)uri_str, "file:", 5)) {