aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-02-27 10:40:33 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-02-27 10:40:33 +0100
commit40f832295060998092bcd9048aad5c32f1a41049 (patch)
tree5c02346109ea1e46105bf7c243bdddeaa9a2d035
parent83320603f4314388eb60740eb43e0fda674cf651 (diff)
downloadmoony.lv2-40f832295060998092bcd9048aad5c32f1a41049.tar.xz
fix warning reported by scan-build.
-rw-r--r--api/api.c5
-rw-r--r--api/api_atom.c2
-rw-r--r--api/api_time.c2
-rw-r--r--api/api_vm.c1
-rw-r--r--ui/web_ui.c4
5 files changed, 7 insertions, 7 deletions
diff --git a/api/api.c b/api/api.c
index 9ed7830..fb7e760 100644
--- a/api/api.c
+++ b/api/api.c
@@ -186,7 +186,7 @@ static const char *note_keys [12] = {
static int
_lnote__index(lua_State *L)
{
- moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
+ //moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
lua_settop(L, 2); // ignore superfluous arguments
@@ -1425,7 +1425,8 @@ moony_in(moony_t *moony, const LV2_Atom_Sequence *control, LV2_Atom_Sequence *no
// initialize notify forge
const uint32_t capacity = notify->atom.size;
lv2_atom_forge_set_buffer(&moony->notify_forge, (uint8_t *)notify, capacity);
- ref = lv2_atom_forge_sequence_head(&moony->notify_forge, &moony->notify_frame, 0);
+ if(ref)
+ ref = lv2_atom_forge_sequence_head(&moony->notify_forge, &moony->notify_frame, 0);
// read control sequence
LV2_ATOM_SEQUENCE_FOREACH(control, ev)
diff --git a/api/api_atom.c b/api/api_atom.c
index 0ba7768..e451a05 100644
--- a/api/api_atom.c
+++ b/api/api_atom.c
@@ -982,7 +982,7 @@ _latom__tostring(lua_State *L)
static int
_latom__eq(lua_State *L)
{
- moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
+ //moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
latom_t *latom1 = luaL_checkudata(L, 1, "latom");
latom_t *latom2 = luaL_checkudata(L, 2, "latom");
diff --git a/api/api_time.c b/api/api_time.c
index e4c7403..66c0d27 100644
--- a/api/api_time.c
+++ b/api/api_time.c
@@ -171,7 +171,7 @@ _ltimeresponder_stash(lua_State *L)
static int
_ltimeresponder__index(lua_State *L)
{
- moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
+ //moony_t *moony = lua_touserdata(L, lua_upvalueindex(1));
lua_settop(L, 2); // discard superfluous arguments
// 1: self
diff --git a/api/api_vm.c b/api/api_vm.c
index dbbe20a..93a58f4 100644
--- a/api/api_vm.c
+++ b/api/api_vm.c
@@ -107,7 +107,6 @@ static void *
lua_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
{
moony_t *moony = ud;
- moony_vm_t *vm = &moony->vm;
if(nsize == 0)
{
diff --git a/ui/web_ui.c b/ui/web_ui.c
index 132f5d7..c450531 100644
--- a/ui/web_ui.c
+++ b/ui/web_ui.c
@@ -1190,7 +1190,7 @@ _on_message_complete(http_parser *parser)
stat = http_status[STATUS_OK];
cont = http_content[CONTENT_TEXT_JSON];
chunk = strdup("Content-Length: 2\r\n\r\n{}");
- size = strlen(chunk);
+ size = chunk ? strlen(chunk) : 0;
}
else if(strstr(client->url, "/lv2/dsp") == client->url)
{
@@ -1199,7 +1199,7 @@ _on_message_complete(http_parser *parser)
stat = http_status[STATUS_OK];
cont = http_content[CONTENT_TEXT_JSON];
chunk = strdup("Content-Length: 2\r\n\r\n{}");
- size = strlen(chunk);
+ size = chunk ? strlen(chunk) : 0;
}
else
{