Commit 930b7c5b authored by Hanspeter Portner's avatar Hanspeter Portner

fix warning reported by -Wextra.

parent 039d9e39
......@@ -18,7 +18,8 @@ if(NOT WIN32)
endif()
endif()
set(CMAKE_C_FLAGS "-std=gnu99 -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-std=gnu99 -Wextra -Wno-unused-parameter -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,nodelete ${CMAKE_MODULE_LINKER_FLAGS}")
add_definitions("-D_GNU_SOURCE=1") # asprintf
......
......@@ -47,15 +47,15 @@ struct _lobj_t {
struct _ltuple_t {
const LV2_Atom_Tuple *tuple;
uint32_t pos;
int pos;
const LV2_Atom *itr;
LV2_Atom body [0];
};
struct _lvec_t {
const LV2_Atom_Vector *vec;
uint32_t count;
uint32_t pos;
int count;
int pos;
LV2_Atom body [0];
};
......@@ -264,7 +264,7 @@ _lseq__len(lua_State *L)
{
lseq_t *lseq = luaL_checkudata(L, 1, "lseq");
uint32_t count = 0;
int count = 0;
LV2_ATOM_SEQUENCE_FOREACH(lseq->seq, ev)
count++;
lua_pushinteger(L, count);
......@@ -275,8 +275,6 @@ _lseq__len(lua_State *L)
static int
_lseq__tostring(lua_State *L)
{
lseq_t *lseq = luaL_checkudata(L, 1, "lseq");
lua_pushstring(L, "Atom_Sequence");
return 1;
......@@ -377,7 +375,7 @@ _ltuple__len(lua_State *L)
{
ltuple_t *ltuple = luaL_checkudata(L, 1, "ltuple");
uint32_t count = 0;
int count = 0;
LV2_ATOM_TUPLE_FOREACH(ltuple->tuple, atom)
count++;
lua_pushinteger(L, count);
......@@ -388,8 +386,6 @@ _ltuple__len(lua_State *L)
static int
_ltuple__tostring(lua_State *L)
{
ltuple_t *ltuple = luaL_checkudata(L, 1, "ltuple");
lua_pushstring(L, "Atom_Tuple");
return 1;
......@@ -415,7 +411,6 @@ _ltuple_foreach(lua_State *L)
static int
_ltuple_unpack(lua_State *L)
{
moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
ltuple_t *ltuple = luaL_checkudata(L, 1, "ltuple");
int n = lua_gettop(L);
......@@ -539,8 +534,6 @@ _lvec__len(lua_State *L)
static int
_lvec__tostring(lua_State *L)
{
lvec_t *lvec = luaL_checkudata(L, 1, "lvec");
lua_pushstring(L, "Atom_Vector");
return 1;
......@@ -565,7 +558,6 @@ _lvec_foreach(lua_State *L)
static int
_lvec_unpack(lua_State *L)
{
moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
lvec_t *lvec = luaL_checkudata(L, 1, "lvec");
int n = lua_gettop(L);
......@@ -619,7 +611,7 @@ _lchunk__index(lua_State *L)
if(lua_isnumber(L, 2))
{
int index = lua_tointeger(L, 2); // indexing start from 1
if( (index > 0) && (index <= lchunk->atom->size) )
if( (index > 0) && (index <= (int)lchunk->atom->size) )
lua_pushinteger(L, payload[index-1]);
else // index is out of bounds
lua_pushnil(L);
......@@ -635,7 +627,7 @@ _lchunk__index(lua_State *L)
else if(!strcmp(key, "value"))
{
lua_createtable(L, lchunk->atom->size, 0);
for(int i=0; i<lchunk->atom->size; i++)
for(unsigned i=0; i<lchunk->atom->size; i++)
{
lua_pushinteger(L, payload[i]);
lua_rawseti(L, -2, i+1);
......@@ -667,8 +659,6 @@ _lchunk__len(lua_State *L)
static int
_lchunk__tostring(lua_State *L)
{
latom_t *lchunk = luaL_checkudata(L, 1, "lchunk");
lua_pushstring(L, "Atom_Chunk");
return 1;
......@@ -677,7 +667,6 @@ _lchunk__tostring(lua_State *L)
static int
_lchunk_unpack(lua_State *L)
{
moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
latom_t *lchunk = luaL_checkudata(L, 1, "lchunk");
const uint8_t *payload = LV2_ATOM_BODY_CONST(lchunk->atom);
......@@ -690,8 +679,8 @@ _lchunk_unpack(lua_State *L)
min = luaL_checkinteger(L, 2);
min = min < 1
? 1
: (min > lchunk->atom->size
? lchunk->atom->size
: (min > (int)lchunk->atom->size
? (int)lchunk->atom->size
: min);
if(n > 2)
......@@ -699,8 +688,8 @@ _lchunk_unpack(lua_State *L)
max = luaL_checkinteger(L, 3);
max = max < 1
? 1
: (max > lchunk->atom->size
? lchunk->atom->size
: (max > (int)lchunk->atom->size
? (int)lchunk->atom->size
: max);
}
}
......@@ -798,7 +787,7 @@ _lobj__len(lua_State *L)
{
lobj_t *lobj = luaL_checkudata(L, 1, "lobj");
uint32_t count = 0;
int count = 0;
LV2_ATOM_OBJECT_FOREACH(lobj->obj, prop)
count++;
lua_pushinteger(L, count);
......@@ -808,8 +797,6 @@ _lobj__len(lua_State *L)
static int
_lobj__tostring(lua_State *L)
{
lobj_t *lobj = luaL_checkudata(L, 1, "lobj");
lua_pushstring(L, "Atom_Object");
return 1;
......@@ -1165,7 +1152,7 @@ _lforge_bytes(lua_State *L, moony_t *moony, LV2_URID type)
lforge_t *lforge = luaL_checkudata(L, 1, "lforge");
if(lua_istable(L, 2))
{
uint32_t size = lua_rawlen(L, 2);
int size = lua_rawlen(L, 2);
if(!lv2_atom_forge_atom(lforge->forge, size, type))
luaL_error(L, forge_buffer_overflow);
for(int i=1; i<=size; i++)
......@@ -1190,7 +1177,7 @@ _lforge_bytes(lua_State *L, moony_t *moony, LV2_URID type)
}
else // bytes as individual function arguments
{
uint32_t size = lua_gettop(L) - 1;
int size = lua_gettop(L) - 1;
if(!lv2_atom_forge_atom(lforge->forge, size, type))
luaL_error(L, forge_buffer_overflow);
......@@ -1480,16 +1467,15 @@ _lforge_property(lua_State *L)
static int
_lforge_vector(lua_State *L)
{
moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
lforge_t *lforge = luaL_checkudata(L, 1, "lforge");
LV2_URID child_type = luaL_checkinteger(L, 2);
uint32_t child_size;
uint32_t child_size = 0;
LV2_Atom_Forge_Frame frame;
int is_table = lua_istable(L, 3);
int n = is_table
? lua_rawlen(L, 3)
? (int)lua_rawlen(L, 3)
: lua_gettop(L) - 2;
if( (child_type == lforge->forge->Int)
......@@ -1761,7 +1747,6 @@ _log(lua_State *L)
for(int i=1; i<=n; i++)
{
size_t len;
const char *str = NULL;
switch(lua_type(L, i))
{
......@@ -1825,7 +1810,7 @@ moony_init(moony_t *moony, double sample_rate, const LV2_Feature *const *feature
LV2_Options_Option *opts = NULL;
for(int i=0; features[i]; i++)
for(unsigned i=0; features[i]; i++)
if(!strcmp(features[i]->URI, LV2_URID__map))
moony->map = (LV2_URID_Map *)features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__unmap))
......@@ -2287,8 +2272,8 @@ _work_response(LV2_Handle instance, uint32_t size, const void *body)
// schedule freeing of memory to _work
LV2_Worker_Status status = moony->sched->schedule_work(
moony->sched->handle, sizeof(moony_mem_t), &req);
//TODO check status
if(status != LV2_WORKER_SUCCESS)
fprintf(stderr, "moony: schedule_work failed\n");
return LV2_WORKER_ERR_UNKNOWN;
}
......@@ -2331,8 +2316,6 @@ extension_data(const char* uri)
void
moony_activate(moony_t *moony, const char *chunk)
{
lua_State *L = moony->vm.L;
strcpy(moony->chunk, chunk);
moony->dirty_in = 1; // trigger update
moony->dirty_out = 1; // trigger update of UI
......
......@@ -24,7 +24,7 @@ typedef struct _Handle Handle;
struct _Handle {
moony_t moony;
int max_val;
unsigned max_val;
uint32_t sample_count;
const LV2_Atom_Sequence *event_in [4];
......@@ -106,7 +106,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate, const char *bundle_pa
handle->max_val = 1;
moony_activate(&handle->moony, default_code[handle->max_val >> 1]);
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
lv2_atom_forge_init(&handle->forge[i], handle->moony.map);
return handle;
......@@ -127,14 +127,6 @@ connect_port(LV2_Handle instance, uint32_t port, void *data)
handle->notify = (LV2_Atom_Sequence *)data;
}
static void
activate(LV2_Handle instance)
{
Handle *handle = (Handle *)instance;
// nothing
}
static int
_run(lua_State *L)
{
......@@ -146,7 +138,7 @@ _run(lua_State *L)
lua_pushinteger(L, handle->sample_count);
// push sequence
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
{
lseq_t *lseq = moony_newuserdata(L, &handle->moony, MOONY_UDATA_SEQ);
lseq->seq = handle->event_in[i];
......@@ -154,7 +146,7 @@ _run(lua_State *L)
}
// push forge
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
{
lforge_t *lforge = moony_newuserdata(L, &handle->moony, MOONY_UDATA_FORGE);
lforge->depth = 0;
......@@ -184,7 +176,7 @@ run(LV2_Handle instance, uint32_t nsamples)
// prepare event_out sequence
LV2_Atom_Forge_Frame frame [4];
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
{
uint32_t capacity = handle->event_out[i]->atom.size;
lv2_atom_forge_set_buffer(&handle->forge[i], (uint8_t *)handle->event_out[i], capacity);
......@@ -203,19 +195,19 @@ run(LV2_Handle instance, uint32_t nsamples)
lua_gc(L, LUA_GCSTEP, 0);
}
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
if(&frame[i] != handle->forge[i].stack) // intercept assert
moony_err(&handle->moony, "forge frame mismatch");
// clear output sequence buffers upon error
if(moony_bypass(&handle->moony))
{
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
lv2_atom_sequence_clear(handle->event_out[i]);
}
else
{
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
lv2_atom_forge_pop(&handle->forge[i], &frame[i]);
}
......@@ -223,14 +215,6 @@ run(LV2_Handle instance, uint32_t nsamples)
moony_out(&handle->moony, handle->notify, nsamples - 1);
}
static void
deactivate(LV2_Handle instance)
{
Handle *handle = (Handle *)instance;
// nothing
}
static void
cleanup(LV2_Handle instance)
{
......@@ -244,9 +228,9 @@ const LV2_Descriptor a1xa1 = {
.URI = MOONY_A1XA1_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -255,9 +239,9 @@ const LV2_Descriptor a2xa2 = {
.URI = MOONY_A2XA2_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -266,9 +250,9 @@ const LV2_Descriptor a4xa4 = {
.URI = MOONY_A4XA4_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -24,7 +24,7 @@ typedef struct _Handle Handle;
struct _Handle {
moony_t moony;
int max_val;
unsigned max_val;
uint32_t sample_count;
const LV2_Atom_Sequence *event_in;
......@@ -118,14 +118,6 @@ connect_port(LV2_Handle instance, uint32_t port, void *data)
handle->notify = (LV2_Atom_Sequence *)data;
}
static void
activate(LV2_Handle instance)
{
Handle *handle = (Handle *)instance;
// nothing
}
static int
_run(lua_State *L)
{
......@@ -149,16 +141,16 @@ _run(lua_State *L)
lforge->forge = &handle->forge;
// push values
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
lua_pushnumber(L, *handle->val_in[i]);
lua_call(L, 3 + handle->max_val, LUA_MULTRET);
int ret = lua_gettop(L) - top;
int max = ret > handle->max_val ? handle->max_val : ret; // discard superfluous returns
for(int i=0; i<max; i++)
unsigned ret = lua_gettop(L) - top;
unsigned max = ret > handle->max_val ? handle->max_val : ret; // discard superfluous returns
for(unsigned i=0; i<max; i++)
*handle->val_out[i] = luaL_optnumber(L, i+1, 0.f);
for(int i=ret; i<handle->max_val; i++) // fill in missing returns with 0.f
for(unsigned i=ret; i<handle->max_val; i++) // fill in missing returns with 0.f
*handle->val_out[i] = 0.f;
lua_pop(L, ret);
......@@ -211,14 +203,6 @@ run(LV2_Handle instance, uint32_t nsamples)
moony_out(&handle->moony, handle->notify, nsamples - 1);
}
static void
deactivate(LV2_Handle instance)
{
Handle *handle = (Handle *)instance;
// nothing
}
static void
cleanup(LV2_Handle instance)
{
......@@ -232,9 +216,9 @@ const LV2_Descriptor c1a1xc1a1 = {
.URI = MOONY_C1A1XC1A1_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -243,9 +227,9 @@ const LV2_Descriptor c2a1xc2a1 = {
.URI = MOONY_C2A1XC2A1_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -254,9 +238,9 @@ const LV2_Descriptor c4a1xc4a1 = {
.URI = MOONY_C4A1XC4A1_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -174,9 +174,11 @@ _encoder_append(const char *str, void *data)
size += ui->chunk ? strlen(ui->chunk) : 0;
size += str ? strlen(str) + 1 : 0;
ui->chunk = realloc(ui->chunk, size);
if(size)
ui->chunk = realloc(ui->chunk, size);
strcat(ui->chunk, str);
if(ui->chunk && str)
strcat(ui->chunk, str);
}
static void
......@@ -479,10 +481,10 @@ _content_get(eo_ui_t *eoui)
elm_box_pack_end(hbox, icon);
}
Evas_Object *label = elm_label_add(hbox);
if(label)
Evas_Object *label2 = elm_label_add(hbox);
if(label2)
{
elm_object_text_set(label,
elm_object_text_set(label2,
"<color=#b00 shadow_color=#fff font_size=20>"
"Moony - Logic Glue for LV2"
"</color></br><align=left>"
......@@ -496,8 +498,8 @@ _content_get(eo_ui_t *eoui)
"dev@open-music-kontrollers.ch"
"</color></align>");
evas_object_show(label);
elm_box_pack_end(hbox, label);
evas_object_show(label2);
elm_box_pack_end(hbox, label2);
}
}
}
......
......@@ -24,7 +24,7 @@ typedef struct _Handle Handle;
struct _Handle {
moony_t moony;
int max_val;
unsigned max_val;
uint32_t sample_count;
const float *val_in [4];
......@@ -93,14 +93,6 @@ connect_port(LV2_Handle instance, uint32_t port, void *data)
handle->notify = (LV2_Atom_Sequence *)data;
}
static void
activate(LV2_Handle instance)
{
Handle *handle = (Handle *)instance;
// nothing
}
static int
_run(lua_State *L)
{
......@@ -112,16 +104,16 @@ _run(lua_State *L)
{
lua_pushinteger(L, handle->sample_count);
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
lua_pushnumber(L, *handle->val_in[i]);
lua_call(L, 1 + handle->max_val, LUA_MULTRET);
int ret = lua_gettop(L) - top;
int max = ret > handle->max_val ? handle->max_val : ret; // discard superfluous returns
for(int i=0; i<max; i++)
unsigned ret = lua_gettop(L) - top;
unsigned max = ret > handle->max_val ? handle->max_val : ret; // discard superfluous returns
for(unsigned i=0; i<max; i++)
*handle->val_out[i] = luaL_optnumber(L, i+1, 0.f);
for(int i=ret; i<handle->max_val; i++) // fill in missing returns with 0.f
for(unsigned i=ret; i<handle->max_val; i++) // fill in missing returns with 0.f
*handle->val_out[i] = 0.f;
lua_pop(L, ret);
......@@ -157,21 +149,13 @@ run(LV2_Handle instance, uint32_t nsamples)
// clear output ports upon error
if(moony_bypass(&handle->moony))
for(int i=0; i<handle->max_val; i++)
for(unsigned i=0; i<handle->max_val; i++)
*handle->val_out[i] = 0.f;
// handle UI comm
moony_out(&handle->moony, handle->notify, nsamples - 1);
}
static void
deactivate(LV2_Handle instance)
{
Handle *handle = (Handle *)instance;
// nothing
}
static void
cleanup(LV2_Handle instance)
{
......@@ -185,9 +169,9 @@ const LV2_Descriptor c1xc1 = {
.URI = MOONY_C1XC1_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -196,9 +180,9 @@ const LV2_Descriptor c2xc2 = {
.URI = MOONY_C2XC2_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -207,9 +191,9 @@ const LV2_Descriptor c4xc4 = {
.URI = MOONY_C4XC4_URI,
.instantiate = instantiate,
.connect_port = connect_port,
.activate = activate,
.activate = NULL,
.run = run,
.deactivate = deactivate,
.deactivate = NULL,
.cleanup = cleanup,
.extension_data = extension_data
};
......@@ -19,9 +19,13 @@
#include <Eina.h>
//TODO eina_lock_release may fail
struct _ext_urid_t {
LV2_URID cnt;
Eina_Lock mutex;
Eina_Hash *uris;
Eina_Hash *urids;
......@@ -48,33 +52,61 @@ _urid_map(LV2_URID_Map_Handle handle, const char *uri)
{
ext_urid_t *uri_hash = handle;
LV2_URID *urid = NULL;
Eina_Lock_Result res = eina_lock_take(&uri_hash->mutex);
if(res == EINA_LOCK_SUCCEED)
{
// uri already registered?
urid = eina_hash_find(uri_hash->uris, uri);
eina_lock_release(&uri_hash->mutex);
// uri already registered?
if((urid = eina_hash_find(uri_hash->uris, uri)))
return *urid;
if(urid)
return *urid;
}
else
{
fprintf(stderr, "_urid_map: lock failed\n");
return 0;
}
// duplicate uri
char *uri_dup = strdup(uri);
if(!uri_dup)
{
fprintf(stderr, "_urid_map: out-of-memory\n");
return 0;
}
// create new urid for uri
urid = malloc(sizeof(LV2_URID));
if(!urid)
{
free(uri_dup);
fprintf(stderr, "_urid_map: out-of-memory\n");
return 0;
}
if(eina_hash_add(uri_hash->uris, uri_dup, urid))
res = eina_lock_take(&uri_hash->mutex);
if(res == EINA_LOCK_SUCCEED)
{
*urid = uri_hash->cnt++;
if(eina_hash_add(uri_hash->urids, urid, uri_dup))
return *urid;
else
eina_hash_del(uri_hash->uris, uri_dup, urid);
if(eina_hash_add(uri_hash->uris, uri_dup, urid))
{
*urid = uri_hash->cnt++;
if(eina_hash_add(uri_hash->urids, urid, uri_dup))
{
eina_lock_release(&uri_hash->mutex);
return *urid;
}
else
{
eina_hash_del(uri_hash->uris, uri_dup, urid);
}
}
eina_lock_release(&uri_hash->mutex);
}
fprintf(stderr, "_urid_map: lock failed\n");
free(urid);
free(uri_dup);
......@@ -86,9 +118,17 @@ static const char *
_urid_unmap(LV2_URID_Map_Handle handle, LV2_URID urid)
{
ext_urid_t *uri_hash = handle;
const char *uri = NULL;
uri = eina_hash_find(uri_hash->urids, &urid);
Eina_Lock_Result res = eina_lock_take(&uri_hash->mutex);
if(res != EINA_LOCK_SUCCEED)
{
fprintf(stderr, "_urid_map: lock failed\n");
return NULL;
}
const char *uri = eina_hash_find(uri_hash->urids, &urid);
eina_lock_release(&uri_hash->mutex);
return uri;
}
......@@ -97,26 +137,49 @@ ext_urid_t *
ext_urid_new()
{
ext_urid_t *ext_urid = malloc(sizeof(ext_urid_t));
if(!ext_urid)
return NULL;
ext_urid->cnt = 1;
ext_urid->uris = eina_hash_string_superfast_new(_uri_hash_uri_del);
ext_urid->urids = eina_hash_int32_new(_uri_hash_urid_del);
ext_urid->map.handle = ext_urid;
ext_urid->map.map = _urid_map;
if(eina_lock_new(&ext_urid->mutex) == EINA_TRUE)
{
ext_urid->uris = eina_hash_string_superfast_new(_uri_hash_uri_del);
if(ext_urid->uris)
{
ext_urid->urids = eina_hash_int32_new(_uri_hash_urid_del);
if(ext_urid->urids)
{
ext_urid->map.handle = ext_urid;
ext_urid->map.map = _urid_map;
ext_urid->unmap.handle = ext_urid;
ext_urid->unmap.unmap = _urid_unmap;
ext_urid->unmap.handle = ext_urid;
ext_urid->unmap.unmap = _urid_unmap;
return ext_urid;
} // urids
return ext_urid;
eina_hash_free(ext_urid->uris);
} // uris
eina_lock_free(&ext_urid->mutex);
} // mutex
free(ext_urid);
return NULL;
}
void
ext_urid_free(ext_urid_t *ext_urid)
{
eina_hash_free(ext_urid->uris);
eina_hash_free(ext_urid->urids);
if(!ext_urid)
return;
if(ext_urid->uris)
eina_hash_free(ext_urid->uris);
if(ext_urid->urids)
eina_hash_free(ext_urid->urids);
eina_lock_free(&ext_urid->mutex);