aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--backends/lua.c10
-rw-r--r--midimonster.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/backends/lua.c b/backends/lua.c
index 8e221d1..4d946cd 100644
--- a/backends/lua.c
+++ b/backends/lua.c
@@ -61,7 +61,7 @@ static uint32_t lua_interval(){
}
static int lua_update_timerfd(){
- uint64_t interval, gcd, residual;
+ uint64_t interval = 0, gcd, residual;
size_t n = 0;
#ifdef MMBACKEND_LUA_TIMERFD
struct itimerspec timer_config = {
@@ -396,11 +396,11 @@ static int lua_handle(size_t num, managed_fd* fds){
return 1;
}
#else
- if(!last_timestamp){
- last_timestamp = mm_timestamp();
- }
- delta = mm_timestamp() - last_timestamp;
+ if(!last_timestamp){
last_timestamp = mm_timestamp();
+ }
+ delta = mm_timestamp() - last_timestamp;
+ last_timestamp = mm_timestamp();
#endif
//no timers active
diff --git a/midimonster.h b/midimonster.h
index 1fc85b7..7f70f5b 100644
--- a/midimonster.h
+++ b/midimonster.h
@@ -26,7 +26,7 @@
/* Default configuration file name to read when no other is specified */
#define DEFAULT_CFG "monster.cfg"
-/* Forward declare some of the structs so we can use them in eachother */
+/* Forward declare some of the structs so we can use them in each other */
struct _channel_value;
struct _backend_channel;
struct _backend_instance;