]> git.0d.be Git - jack_mixer.git/commitdiff
various warning fixes
authorAthanasios Silis <athanasios.silis@gmail.com>
Thu, 18 Jun 2020 12:37:16 +0000 (15:37 +0300)
committerAthanasios Silis <athanasios.silis@gmail.com>
Thu, 18 Jun 2020 12:37:16 +0000 (15:37 +0300)
jack_mix_box.c
jack_mixer.c
log.c
log.h

index 5dffa203022350e1666e18bf3bbfac7f2641b919..196b05b92a654f1d4bff10c3593b17a0e17b1371 100644 (file)
@@ -33,6 +33,7 @@
 #include <stdbool.h>
 #include <getopt.h>
 #include <signal.h>
+#include <unistd.h>
 #include "jack_mixer.h"
 
 jack_mixer_t mixer;
index 37080b65798bfc6b2be238f39834ee1b075afa1f..2f6652b5a00a1263865721aec68a854b01269b0f 100644 (file)
@@ -202,7 +202,7 @@ channel_rename(
     port_name[channel_name_size+1] = 'L';
     port_name[channel_name_size+2] = 0;
 
-    ret = jack_port_set_name(channel_ptr->port_left, port_name);
+    ret = jack_port_rename(channel_ptr->mixer_ptr->jack_client, channel_ptr->port_left, port_name);
     if (ret != 0)
     {
       /* what could we do here? */
@@ -210,7 +210,7 @@ channel_rename(
 
     port_name[channel_name_size+1] = 'R';
 
-    ret = jack_port_set_name(channel_ptr->port_right, port_name);
+    ret = jack_port_rename(channel_ptr->mixer_ptr->jack_client, channel_ptr->port_right, port_name);
     if (ret != 0)
     {
       /* what could we do here? */
@@ -220,7 +220,7 @@ channel_rename(
   }
   else
   {
-    ret = jack_port_set_name(channel_ptr->port_left, name);
+    ret = jack_port_rename(channel_ptr->mixer_ptr->jack_client, channel_ptr->port_left, name);
     if (ret != 0)
     {
       /* what could we do here? */
@@ -1048,13 +1048,13 @@ process(
       (unsigned int)in_event.buffer[1],
       (unsigned int)in_event.buffer[2]);
 
-    mixer_ptr->last_midi_channel = (unsigned int)in_event.buffer[1];
+    mixer_ptr->last_midi_channel = (int)in_event.buffer[1];
     channel_ptr = mixer_ptr->midi_cc_map[in_event.buffer[1]];
 
     /* if we have mapping for particular CC and MIDI scale is set for corresponding channel */
     if (channel_ptr != NULL && channel_ptr->midi_scale != NULL)
     {
-      if (channel_ptr->midi_cc_balance_index == (unsigned int)in_event.buffer[1])
+      if (channel_ptr->midi_cc_balance_index == (char)in_event.buffer[1])
       {
         byte = in_event.buffer[2];
         if (byte == 0)
@@ -1126,7 +1126,7 @@ process(
       {
         continue;
       }
-      if (channel_ptr->midi_cc_balance_index == (unsigned int)cc_channel_index)
+      if (channel_ptr->midi_cc_balance_index == (int)cc_channel_index)
       {
         continue;
       }
@@ -1163,6 +1163,7 @@ create(
   const char * jack_client_name_ptr,
   bool stereo)
 {
+  (void) stereo;
   int ret;
   struct jack_mixer * mixer_ptr;
   int i;
diff --git a/log.c b/log.c
index f85f6cf27a9a436b4fd856e316944f268156729b..730f37415b5e6872d3c05ca5638428d957f12ddd 100644 (file)
--- a/log.c
+++ b/log.c
@@ -27,6 +27,7 @@
 
 void jack_mixer_log(int level, const char * format, ...)
 {
+  (void)level;
   va_list arglist;
 
   va_start(arglist, format);
diff --git a/log.h b/log.h
index 7565c9e6654205460f305f2411310c3753a911d5..0cbfeed93ae28f6faa09b912a4ff5236c9878add 100644 (file)
--- a/log.h
+++ b/log.h
@@ -36,51 +36,51 @@ void jack_mixer_log(int level, const char * format, ...);
 #endif
 
 #if LOG_LEVEL <= LOG_LEVEL_DEBUG
-# define LOG_DEBUG(format, arg...)              \
+# define LOG_DEBUG(format, ...)              \
   jack_mixer_log(LOG_LEVEL_DEBUG,               \
-                 format "\n", ## arg)
+                 format "\n", ## __VA_ARGS__)
 #else
-# define LOG_DEBUG(format, arg...)
+# define LOG_DEBUG(format, ...)
 #endif
 
 #if LOG_LEVEL <= LOG_LEVEL_INFO
-# define LOG_INFO(format, arg...)               \
+# define LOG_INFO(format, ...)               \
   jack_mixer_log(LOG_LEVEL_INFO,                \
-                 format "\n", ## arg)
+                 format "\n", ## __VA_ARGS__)
 #else
-# define LOG_INFO(format, arg...)
+# define LOG_INFO(format, ...)
 #endif
 
 #if LOG_LEVEL <= LOG_LEVEL_WARNING
-# define LOG_WARNING(format, arg...)            \
+# define LOG_WARNING(format, ...)            \
   jack_mixer_log(LOG_LEVEL_WARNING,             \
-                 format "\n", ## arg)
+                 format "\n", ## __VA_ARGS__)
 #else
-# define LOG_WARNING(format, arg...)
+# define LOG_WARNING(format, ...)
 #endif
 
 #if LOG_LEVEL <= LOG_LEVEL_NOTICE
-# define LOG_NOTICE(format, arg...)             \
+# define LOG_NOTICE(format, ...)             \
   jack_mixer_log(LOG_LEVEL_NOTICE,              \
-                 format "\n", ## arg)
+                 format "\n", ## __VA_ARGS__)
 #else
-# define LOG_NOTICE(format, arg...)
+# define LOG_NOTICE(format, ...)
 #endif
 
 #if LOG_LEVEL <= LOG_LEVEL_ERROR
-# define LOG_ERROR(format, arg...)              \
+# define LOG_ERROR(format, ...)              \
   jack_mixer_log(LOG_LEVEL_ERROR,               \
-                 format "\n", ## arg)
+                 format "\n", ## __VA_ARGS__)
 #else
-# define LOG_ERROR(format, arg...)
+# define LOG_ERROR(format, ...)
 #endif
 
 #if LOG_LEVEL <= LOG_LEVEL_FATAL
-# define LOG_FATAL(format, arg...)              \
+# define LOG_FATAL(format, ...)              \
   jack_mixer_log(LOG_LEVEL_FATAL,               \
-                 format "\n", ## arg)
+                 format "\n", ## __VA_ARGS__)
 #else
-# define LOG_FATAL(format, arg...)
+# define LOG_FATAL(format, ...)
 #endif
 
 #endif /* #ifndef LOG_H__7097F6FE_4FEE_4962_9542_60375961F567__INCLUDED */