Remove warnings 64/44864/3
authorSeungbae Shin <seungbae.shin@samsung.com>
Tue, 28 Jul 2015 13:55:04 +0000 (22:55 +0900)
committeryoungseok lee <youngseok7.lee@samsung.com>
Thu, 30 Jul 2015 02:01:38 +0000 (19:01 -0700)
Signed-off-by: Seungbae Shin <seungbae.shin@samsung.com>
Change-Id: I5fe54b03c37bdb116555961b261ff535b96f6588

20 files changed:
include/mm_sound.h
include/mm_sound_client_dbus.h
include/mm_sound_device.h
mm_sound.c
mm_sound_client.c
mm_sound_client_dbus.c
mm_sound_device.c
mm_sound_keysound.c
mm_sound_pa_client.c
mm_sound_pcm.c
mm_sound_pcm_async.c
server/mm_sound_mgr_asm.c
server/mm_sound_mgr_codec.c
server/mm_sound_mgr_ipc.c
server/mm_sound_mgr_ipc_dbus.c
server/plugin/keytone/mm_sound_plugin_run_key_tone.c
server/plugin/ogg/mm_sound_plugin_codec_ogg.c
server/plugin/tone/mm_sound_plugin_codec_tone.c
server/plugin/wav/mm_sound_plugin_codec_wave.c
testsuite/mm_sound_testsuite_simple.c

index dcae36d..6c94f11 100644 (file)
@@ -2171,7 +2171,7 @@ typedef enum {
 } mm_sound_signal_name_t;
 
 typedef void (* mm_sound_signal_callback) (mm_sound_signal_name_t signal, int value, void *user_data);
-int mm_sound_subscribe_signal(mm_sound_signal_name_t signal, unsigned int *subscribe_id, mm_sound_signal_callback callback, void *user_data);
+int mm_sound_subscribe_signal(mm_sound_signal_name_t signal, unsigned intsubscribe_id, mm_sound_signal_callback callback, void *user_data);
 void mm_sound_unsubscribe_signal(unsigned int subscribe_id);
 int mm_sound_send_signal(mm_sound_signal_name_t signal, int value);
 int mm_sound_get_signal_value(mm_sound_signal_name_t signal, int *value);
index 68c87d0..b506abf 100644 (file)
 #endif
 
 int mm_sound_client_dbus_play_tone(int tone, int repeat, int volume, int volume_config,
-                          int session_type, int session_options, int client_pid,
-                          bool enable_session, int *codechandle, char *stream_type, int stream_index);
+                       int session_type, int session_options, int client_pid,
+                       bool enable_session, int *codechandle, char *stream_type, int stream_index);
 int mm_sound_client_dbus_play_tone_with_stream_info(int client_pid, int tone, char *stream_type, int stream_id, int volume, int repeat, int *codechandle);
-int mm_sound_client_dbus_play_sound(char* filename, int tone, int repeat, int volume, int volume_config,
-                          int priority, int session_type, int session_options, int client_pid, int handle_route,
-                          bool enable_session, int *codechandle, char *stream_type, int stream_index);
+int mm_sound_client_dbus_play_sound(const char* filename, int tone, int repeat, int volume, int volume_config,
+                       int priority, int session_type, int session_options, int client_pid, int handle_route,
+                       bool enable_session, int *codechandle, char *stream_type, int stream_index);
+int mm_sound_client_dbus_play_sound_with_stream_info(const char* filename, int repeat, int volume,
+                       int priority, int client_pid, int handle_route, int *codechandle, char *stream_type, int stream_index);
 int mm_sound_client_dbus_stop_sound(int handle);
 int mm_sound_client_dbus_clear_focus(int pid); // Not original focus feature, only for cleaning up tone/wav player internal focus usage.
 int mm_sound_client_dbus_is_route_available(mm_sound_route route, bool *is_available);
index ccb568a..393ca9c 100644 (file)
@@ -34,8 +34,8 @@
 
 #ifdef __cplusplus
        extern "C" {
-#endif
 
+#endif
 #define MAX_DEVICE_NAME_NUM 256
 #define MAX_DEVICE_TYPE_STR_LEN 30
 typedef struct {
index c043212..ecf82f0 100644 (file)
@@ -87,7 +87,7 @@ typedef struct _subscribe_cb {
        unsigned int id;
 } subscribe_cb_t;
 
-static char* _get_volume_str (volume_type_t type)
+static const char* _get_volume_str (volume_type_t type)
 {
        static const char *volume_type_str[VOLUME_TYPE_MAX] =
                { "SYSTEM", "NOTIFICATION", "ALARM", "RINGTONE", "MEDIA", "CALL", "VOIP", "VOICE", "FIXED"};
@@ -273,7 +273,6 @@ int mm_sound_volume_get_value(volume_type_t type, unsigned int *value)
 EXPORT_API
 int mm_sound_volume_primary_type_set(volume_type_t type)
 {
-       pid_t mypid;
        int ret = MM_ERROR_NONE;
 
        /* Check input param */
@@ -320,7 +319,6 @@ int mm_sound_volume_primary_type_get(volume_type_t *type)
 EXPORT_API
 int mm_sound_volume_primary_type_clear(void)
 {
-       pid_t mypid;
        int ret = MM_ERROR_NONE;
 
        if (vconf_set_int(VCONFKEY_SOUND_PRIMARY_VOLUME_TYPE, -1)) {
@@ -850,30 +848,7 @@ int mm_sound_remove_test_callback(void)
        return ret;
 }
 
-static void signal_callback(GDBusConnection *conn,
-                                                          const gchar *sender_name,
-                                                          const gchar *object_path,
-                                                          const gchar *interface_name,
-                                                          const gchar *signal_name,
-                                                          GVariant *parameters,
-                                                          gpointer user_data)
-{
-       int value=0;
-       const GVariantType* value_type;
-
-       debug_msg ("sender : %s, object : %s, interface : %s, signal : %s",
-                       sender_name, object_path, interface_name, signal_name);
-       if(g_variant_is_of_type(parameters, G_VARIANT_TYPE("(i)"))) {
-               g_variant_get(parameters, "(i)",&value);
-               debug_msg(" - value : %d\n", value);
-               _dbus_signal_callback (signal_name, value, user_data);
-       } else  {
-               value_type = g_variant_get_type(parameters);
-               debug_warning("signal type is %s", value_type);
-       }
-}
-
-int _convert_signal_name_str_to_enum (const char *name_str, mm_sound_signal_name_t *name_enum) {
+static int _convert_signal_name_str_to_enum (const char *name_str, mm_sound_signal_name_t *name_enum) {
        int ret = MM_ERROR_NONE;
 
        if (!name_str || !name_enum)
@@ -888,7 +863,7 @@ int _convert_signal_name_str_to_enum (const char *name_str, mm_sound_signal_name
        return ret;
 }
 
-void _dbus_signal_callback (const char *signal_name, int value, void *user_data)
+static void _dbus_signal_callback (const char *signal_name, int value, void *user_data)
 {
        int ret = MM_ERROR_NONE;
        mm_sound_signal_name_t signal;
@@ -919,6 +894,29 @@ void _dbus_signal_callback (const char *signal_name, int value, void *user_data)
        return;
 }
 
+static void signal_callback(GDBusConnection *conn,
+                                                          const gchar *sender_name,
+                                                          const gchar *object_path,
+                                                          const gchar *interface_name,
+                                                          const gchar *signal_name,
+                                                          GVariant *parameters,
+                                                          gpointer user_data)
+{
+       int value=0;
+       const GVariantType* value_type;
+
+       debug_msg ("sender : %s, object : %s, interface : %s, signal : %s",
+                       sender_name, object_path, interface_name, signal_name);
+       if (g_variant_is_of_type(parameters, G_VARIANT_TYPE("(i)"))) {
+               g_variant_get(parameters, "(i)",&value);
+               debug_msg(" - value : %d\n", value);
+               _dbus_signal_callback(signal_name, value, user_data);
+       } else  {
+               value_type = g_variant_get_type(parameters);
+               debug_warning("signal type is %s", value_type);
+       }
+}
+
 EXPORT_API
 int mm_sound_subscribe_signal(mm_sound_signal_name_t signal, unsigned int *subscribe_id, mm_sound_signal_callback callback, void *user_data)
 {
@@ -1005,7 +1003,7 @@ void mm_sound_unsubscribe_signal(unsigned int subscribe_id)
 
        debug_fenter();
 
-       MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_subscribe_cb_list_mutex, MM_ERROR_SOUND_INTERNAL);
+       MMSOUND_ENTER_CRITICAL_SECTION(&g_subscribe_cb_list_mutex);
 
        if (g_dbus_conn_mmsound && subscribe_id) {
                g_dbus_connection_signal_unsubscribe(g_dbus_conn_mmsound, subscribe_id);
index 5db0a89..7b565fc 100644 (file)
@@ -65,7 +65,7 @@ static mm_sound_device_list_t g_device_list_t;
 static pthread_mutex_t g_device_list_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t g_id_mutex = PTHREAD_MUTEX_INITIALIZER;
 
-int g_focus_signal_handle = 0;
+guint g_focus_signal_handle = 0;
 
 int mm_sound_client_initialize(void)
 {
@@ -85,10 +85,10 @@ int mm_sound_client_finalize(void)
 
        debug_fenter();
 
-       mm_sound_client_dbus_finalize();
+       ret = mm_sound_client_dbus_finalize();
 
        debug_fleave();
-       return MM_ERROR_NONE;
+       return ret;
 }
 
 int mm_sound_client_is_route_available(mm_sound_route route, bool *is_available)
@@ -419,7 +419,7 @@ int mm_sound_client_play_sound_with_stream_info(MMSoundPlayParam *param, int *ha
                goto failed;
        }
        if (param->callback) {
-               ret = mm_sound_client_dbus_add_play_sound_end_callback(param->callback, param->data, *handle);
+               ret = mm_sound_client_dbus_add_play_sound_end_callback(*handle, param->callback, param->data);
                if (ret != MM_ERROR_NONE) {
                        debug_error("Add callback for play sound(%d) Failed", *handle);
                }
@@ -499,7 +499,7 @@ int mm_sound_client_get_current_connected_device_list(int device_flags, mm_sound
                return ret;
        }
 
-       if((ret = mm_sound_client_dbus_get_current_connected_device_list(device_flags, &g_device_list_t))!=MM_ERROR_NONE){
+       if ((ret = mm_sound_client_dbus_get_current_connected_device_list(device_flags, &g_device_list_t.list)) != MM_ERROR_NONE) {
                debug_error("[Client] failed to get current connected device list with dbus, ret[0x%x]", ret);
                goto failed;
        }
index 943f8ee..3ce0906 100644 (file)
@@ -231,7 +231,7 @@ static const GDBusErrorEntry mm_sound_error_entries[] =
 ******************************************************************************************/
 
 
-static int _parse_error_msg(const char *full_err_msg, char **err_name, char **err_msg)
+static int _parse_error_msg(char *full_err_msg, char **err_name, char **err_msg)
 {
        char *save_p, *domain, *_err_name, *_err_msg;
 
@@ -310,7 +310,7 @@ int __convert_volume_type_to_str(int volume_type, char **volume_type_str)
        return ret;
 }
 
-int __convert_volume_type_to_int(char *volume_type_str, unsigned int *volume_type)
+static int __convert_volume_type_to_int(char *volume_type_str, volume_type_t *volume_type)
 {
        int ret = MM_ERROR_NONE;
 
@@ -602,10 +602,7 @@ static void _sound_server_dbus_signal_callback (GDBusConnection  *connection,
                                      GVariant         *params,
                                      gpointer          user_data)
 {
-       struct user_callback* user_cb = NULL;
-       GVariantIter *iter = NULL;
-
-       user_cb = (struct user_callback*) user_data;
+       struct user_callback* user_cb = (struct user_callback*) user_data;
 
        if (!user_cb || !user_cb->cb) {
                debug_error("User callback data Null");
@@ -680,7 +677,6 @@ static int _sound_server_dbus_signal_subscribe(sound_server_signal_t signaltype,
 {
        GDBusConnection *conn = NULL;
        guint subs_id = 0;
-       int instance = 0;
        struct user_callback *user_cb  = NULL;
 
        if (!cb) {
@@ -722,7 +718,6 @@ static int _dbus_signal_subscribe_to(int dbus_to, sound_server_signal_t signalty
 {
        GDBusConnection *conn = NULL;
        guint subs_id = 0;
-       int instance = 0;
        struct user_callback *user_cb  = NULL;
        const char *object, *interface;
 
@@ -789,12 +784,14 @@ static int _sound_server_dbus_signal_unsubscribe(sound_server_signal_t signaltyp
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
-       if ((conn = _dbus_get_connection(G_BUS_TYPE_SYSTEM))) {
-               _dbus_unsubscribe_signal(conn, g_dbus_subs_ids[signaltype]);
-       } else {
+       if (!(conn = _dbus_get_connection(G_BUS_TYPE_SYSTEM))) {
                debug_error("Get Dbus Connection Error");
                return MM_ERROR_SOUND_INTERNAL;
        }
+
+       _dbus_unsubscribe_signal(conn, g_dbus_subs_ids[signaltype]);
+
+       return MM_ERROR_NONE;
 }
 
 static int _pulseaudio_dbus_set_property(pulseaudio_property_t property, GVariant* args, GVariant **result)
@@ -923,7 +920,6 @@ int mm_sound_client_dbus_get_current_connected_device_list(int device_flags, GLi
        GVariant *params;
        GVariantIter iter;
        mm_sound_device_t* device_item;
-       GList* g_device_list = NULL;
        const gchar *device_name_tmp = NULL, *device_type_tmp = NULL;
 
        debug_fenter();
@@ -1056,7 +1052,7 @@ int mm_sound_client_dbus_set_volume_by_type(const int volume_type, const unsigne
 
        debug_fenter();
 
-       if (ret = __convert_volume_type_to_str(volume_type, &type_str) != MM_ERROR_NONE) {
+       if ((ret = __convert_volume_type_to_str(volume_type, &type_str)) != MM_ERROR_NONE) {
                debug_error("volume type convert failed");
                return ret;
        }
@@ -1225,7 +1221,7 @@ cleanup:
 
 }
 
-int mm_sound_client_dbus_play_sound(char* filename, int tone, int repeat, int volume, int volume_config,
+int mm_sound_client_dbus_play_sound(const char* filename, int tone, int repeat, int volume, int volume_config,
                           int priority, int session_type, int session_options, int client_pid, int handle_route,
                           bool enable_session, int *codechandle, char *stream_type, int stream_index)
 {
@@ -1268,8 +1264,8 @@ cleanup:
        return ret;
 }
 
-int mm_sound_client_dbus_play_sound_with_stream_info(char* filename, int repeat, int volume,
-                          int priority, int client_pid, int handle_route, int *codechandle, char *stream_type, int stream_index)
+int mm_sound_client_dbus_play_sound_with_stream_info(const char* filename, int repeat, int volume,
+                               int priority, int client_pid, int handle_route, int *codechandle, char *stream_type, int stream_index)
 {
        int ret = MM_ERROR_NONE;
        int handle = 0;
@@ -1283,7 +1279,7 @@ int mm_sound_client_dbus_play_sound_with_stream_info(char* filename, int repeat,
        debug_fenter();
 
        params = g_variant_new("(siiiiisi)", filename, repeat, volume,
-                     priority, client_pid, handle_route, stream_type, stream_index);
+                       priority, client_pid, handle_route, stream_type, stream_index);
        if (params) {
                if ((ret = _dbus_method_call_to(DBUS_TO_SOUND_SERVER, METHOD_CALL_PLAY_FILE_START_WITH_STREAM_INFO, params, &result)) != MM_ERROR_NONE) {
                        debug_error("dbus play file failed");
@@ -1588,7 +1584,7 @@ static int _focus_find_index_by_handle(int handle)
        return -1;
 }
 
-static bool _focus_callback_handler(gpointer d)
+static gboolean _focus_callback_handler(gpointer d)
 {
        GPollFD *data = (GPollFD*)d;
        int count;
@@ -1828,6 +1824,7 @@ void _focus_close_callback(int index, bool is_for_watching)
 
 #ifdef CONFIG_ENABLE_RETCB
        char *filename2;
+       int written;
 
        if (is_for_watching) {
                filename2 = g_strdup_printf("/tmp/FOCUS.%d.wchr", g_focus_sound_handle[index].focus_tid);
@@ -1847,7 +1844,7 @@ void _focus_close_callback(int index, bool is_for_watching)
                        filename2, g_focus_sound_handle[index].focus_tid, tmpfd, filename2, errno, str_error);
        } else {
                debug_msg("write MM_ERROR_NONE(tid:%d) for waiting server", g_focus_sound_handle[index].focus_tid);
-               write(tmpfd, &buf, sizeof(buf));
+               written = write(tmpfd, &buf, sizeof(buf));
                close(tmpfd);
        }
 
@@ -1928,7 +1925,6 @@ static bool _focus_add_sound_callback(int index, int fd, gushort events, focus_g
 static bool _focus_remove_sound_callback(int index, gushort events)
 {
        bool ret = true;
-       gboolean gret = TRUE;
 
        debug_fenter();
 
@@ -1937,7 +1933,7 @@ static bool _focus_remove_sound_callback(int index, gushort events)
                g_focus_sound_handle[index].focus_lock = NULL;
        }
 
-       GSourceFunc *g_src_funcs = g_focus_sound_handle[index].g_src_funcs;
+       GSourceFuncs *g_src_funcs = g_focus_sound_handle[index].g_src_funcs;
        GPollFD *g_poll_fd = g_focus_sound_handle[index].g_poll_fd;     /* store file descriptor */
        if (!g_poll_fd) {
                debug_error("g_poll_fd is null..");
index 83c987a..08426ce 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "include/mm_sound.h"
 #include "include/mm_sound_device.h"
+#include "include/mm_sound_client.h"
 
 #define VOLUME_TYPE_LEN 64
 
@@ -189,7 +190,6 @@ int mm_sound_get_next_device (MMSoundDeviceList_t device_list, MMSoundDevice_t *
 {
        int ret = MM_ERROR_NONE;
        mm_sound_device_list_t *device_list_t = NULL;
-       mm_sound_device_t *device_h = NULL;
        GList *node = NULL;
        if (!device_list || !device) {
                return MM_ERROR_INVALID_ARGUMENT;
@@ -219,7 +219,6 @@ int mm_sound_get_prev_device (MMSoundDeviceList_t device_list, MMSoundDevice_t *
 {
        int ret = MM_ERROR_NONE;
        mm_sound_device_list_t *device_list_t = NULL;
-       mm_sound_device_t *device_h = NULL;
        GList *node = NULL;
        if (!device_list || !device) {
                return MM_ERROR_INVALID_ARGUMENT;
index 15ee574..956ea38 100644 (file)
@@ -115,8 +115,7 @@ int mm_sound_play_keysound(const char *filename, int volume_config)
        int fd = -1;
        int size = 0;
        ipc_t data = {{0,},{0,},{0,}};
-       int capture_status = 0;
-       char *role = NULL;
+       const char *role = NULL;
        const char *vol_gain_type = NULL;
 
        if (!filename)
index 104ee66..1925742 100644 (file)
@@ -28,6 +28,7 @@
 #include <sys/msg.h>
 #include <assert.h>
 #include <errno.h>
+#include <stdio.h>
 
 #include <mm_error.h>
 #include <mm_debug.h>
@@ -68,7 +69,7 @@ typedef struct _mm_sound_handle_t {
 
     int period; /* open api retrun value.*/
 
-    int stream_idx;
+    unsigned int stream_idx;
     int source_type;
 } mm_sound_handle_t;
 
@@ -211,7 +212,7 @@ int mm_sound_pa_open(MMSoundHandleMode mode, mm_sound_handle_route_info *route_i
     pa_channel_map maps;
     pa_buffer_attr attr;
 
-    int vol_conf_type, vol_conf_gain;
+    int vol_conf_type;
     int prop_vol_type, prop_gain_type;
 
     int err = MM_ERROR_SOUND_INTERNAL;
@@ -219,8 +220,6 @@ int mm_sound_pa_open(MMSoundHandleMode mode, mm_sound_handle_route_info *route_i
     int samples_per_period = PA_SIMPLE_SAMPLES_PER_PERIOD_DEFAULT;
     int periods_per_buffer = PA_SIMPLE_PERIODS_PER_BUFFER_DEFAULT;
 
-    const char *prop_policy = NULL;
-
     unsigned long latency = 0;
     int handle_mode = mode;
     int handle_inout = HANDLE_DIRECTION_NONE;
@@ -896,6 +895,7 @@ int mm_sound_pa_get_volume_level(int handle, const int type, int* level)
 
     pa_threaded_mainloop_unlock(mm_sound_handle_mgr.mainloop);
 
+    return MM_ERROR_NONE;
 }
 
 EXPORT_API
@@ -923,6 +923,8 @@ int mm_sound_pa_set_volume_level(int handle, const int type, int level)
         pa_operation_unref(o);
 
     pa_threaded_mainloop_unlock(mm_sound_handle_mgr.mainloop);
+
+    return MM_ERROR_NONE;
 }
 
 EXPORT_API
@@ -959,6 +961,8 @@ int mm_sound_pa_get_mute(int handle, const int type, int direction, int* mute)
         pa_operation_unref(o);
 
     pa_threaded_mainloop_unlock(mm_sound_handle_mgr.mainloop);
+
+    return MM_ERROR_NONE;
 }
 
 EXPORT_API
@@ -987,6 +991,7 @@ int mm_sound_pa_set_mute(int handle, const int type, int direction, int mute)
 
     pa_threaded_mainloop_unlock(mm_sound_handle_mgr.mainloop);
 
+    return MM_ERROR_NONE;
 }
 
 EXPORT_API
index 011d273..50e0280 100644 (file)
@@ -1266,15 +1266,15 @@ EXPORT_API
 int mm_sound_pcm_get_latency(MMSoundPcmHandle_t handle, int *latency)
 {
        mm_sound_pcm_t *pcmHandle = (mm_sound_pcm_t*)handle;
-       int result = MM_ERROR_NONE;
        int mlatency = 0;
 
        /* Check input param */
        if (latency == NULL)
                return MM_ERROR_INVALID_ARGUMENT;
 
-       if(MM_ERROR_NONE != mm_sound_pa_get_latency(pcmHandle->handle, &mlatency)) {
+       if (MM_ERROR_NONE != mm_sound_pa_get_latency(pcmHandle->handle, &mlatency)) {
                debug_error("Get Latency Error");
+               /* FIXME : is this correct return value? */
                return MM_ERROR_SOUND_DEVICE_NOT_OPENED;
        }
 
index f2c102d..d1624dc 100644 (file)
@@ -931,7 +931,6 @@ int mm_sound_pcm_play_write_async(MMSoundPcmHandle_t handle, void* ptr, unsigned
        int ret = 0;
        static int written_byte = 0;
        mm_sound_pcm_async_t *pcmHandle = (mm_sound_pcm_async_t*)handle;
-       int vr_state = 0;
 
        /* Check input param */
        if(pcmHandle == NULL) {
index ccb7d62..df4cc68 100644 (file)
@@ -803,6 +803,8 @@ static container_info_t* __get_container_info(int instance_id)
                }
                temp_list = temp_list->next;
        }
+
+       return NULL;
 }
 #endif /* SUPPORT_CONTAINER */
 
@@ -813,6 +815,10 @@ static char* __get_asm_pipe_path(int instance_id, int handle, const char* postfi
 
 #ifdef SUPPORT_CONTAINER
        container_info_t* container_info = __get_container_info(instance_id);
+       if (container_info == NULL) {
+               debug_error("error getting container info!!!");
+               return NULL;
+       }
 
        if (instance_id == container_info->pid) {
                debug_error ("This might be in the HOST(%s)[%d], let's form normal path",
@@ -1730,8 +1736,6 @@ gboolean __need_to_compare_again(ASM_sound_events_t current_playing_event, int c
        case ASM_CASE_1PAUSE_2PLAY:
        {
                int ret = MM_ERROR_NONE;
-               mm_sound_device_out device_out_wired_accessory = MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY;
-               mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE;
                bool available = false;
 
                if (incoming_playing_event == ASM_EVENT_NOTIFY && (mm_sound_util_is_recording() || mm_sound_util_is_mute_policy()) ) {
@@ -1754,7 +1758,6 @@ gboolean __need_to_compare_again(ASM_sound_events_t current_playing_event, int c
        {
                int ret = MM_ERROR_NONE;
                mm_sound_device_out device_out = MM_SOUND_DEVICE_OUT_NONE;
-               mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE;
 
                if (__is_media_session(current_playing_event) && __is_media_session(incoming_playing_event)) {
                        if ((!(g_handle_info[current_playing_handle].option_flags & ASM_SESSION_OPTION_UNINTERRUPTIBLE)) &&
@@ -2554,6 +2557,7 @@ int __asm_change_session (ASM_requests_t rcv_request, ASM_sound_events_t rcv_sou
        int ret = MM_ERROR_NONE;
        session_t cur_session;
 
+       /* FIXME */
 //     MMSoundMgrSessionGetSession(&cur_session);
        debug_warning (" cur_session[%d] (0:MEDIA 1:VC 2:VT 3:VOIP 4:FM 5:NOTI 6:ALARM 7:EMER 8:VR)\n",cur_session);
        if (is_for_recovery) {
index 35582e5..1a49ea4 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "include/mm_sound_mgr_common.h"
 #include "include/mm_sound_mgr_codec.h"
+#include "include/mm_sound_mgr_ipc.h"
 #include "include/mm_sound_plugin_codec.h"
 #include "include/mm_sound_thread_pool.h"
 #include "include/mm_sound_pa_client.h"
@@ -66,9 +67,7 @@ static mmsound_codec_interface_t g_plugins[MM_SOUND_SUPPORTED_CODEC_NUM];
 static pthread_mutex_t g_slot_mutex;
 static pthread_mutex_t codec_wave_mutex;
 static int _MMSoundMgrCodecStopCallback(int param);
-static int _MMSoundMgrCodecFindKeytoneSlot(int *slotid);
 static int _MMSoundMgrCodecGetEmptySlot(int *slotid);
-static int _MMSoundMgrCodecFindLocaleSlot(int *slotid);
 static int _MMSoundMgrCodecRegisterInterface(MMSoundPluginType *plugin);
 
 #define STATUS_IDLE 0
@@ -180,7 +179,6 @@ int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param)
        mmsound_codec_info_t info;
        mmsound_codec_param_t codec_param;
        int err = MM_ERROR_NONE;
-       int errorcode = 0;
        int need_focus_unregister = 0;
 
 #ifdef DEBUG_DETAIL
@@ -348,7 +346,6 @@ int MMSoundMgrCodecPlayWithStreamInfo(int *slotid, const mmsound_mgr_codec_param
        mmsound_codec_info_t info;
        mmsound_codec_param_t codec_param;
        int err = MM_ERROR_NONE;
-       int errorcode = 0;
 
 #ifdef DEBUG_DETAIL
        debug_enter("\n");
@@ -437,7 +434,6 @@ int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param)
        mmsound_codec_info_t info;
        mmsound_codec_param_t codec_param;
        int err = MM_ERROR_NONE;
-       int errorcode = 0;
        int need_focus_unregister = 0;
 
 #ifdef DEBUG_DETAIL
@@ -598,14 +594,13 @@ cleanup:
        return err;
 }
 
-MMSoundMgrCodecPlayDtmfWithStreamInfo(int *slotid, const mmsound_mgr_codec_param_t *param)
+int MMSoundMgrCodecPlayDtmfWithStreamInfo(int *slotid, const mmsound_mgr_codec_param_t *param)
 {
        int count = 0;
        int *codec_type;
        mmsound_codec_info_t info;
        mmsound_codec_param_t codec_param;
        int err = MM_ERROR_NONE;
-       int errorcode = 0;
 
 #ifdef DEBUG_DETAIL
        debug_enter("\n");
@@ -756,15 +751,15 @@ int MMSoundMgrCodecClearFocus(int pid)
                                                }
                                                if(mm_sound_unregister_focus(g_slots[slotid].focus_handle) || err) {
                                                        debug_error("Focus clean up failed [0x%x]", err);
-                                                       pthread_mutex_unlock(&g_slot_mutex);
-                                                       return MM_ERROR_POLICY_INTERNAL;
+                                                       err = MM_ERROR_POLICY_INTERNAL;
+                                                       goto cleanup;
                                                }
                                        } else if (~(g_slots[slotid].session_options & MM_SESSION_OPTION_PAUSE_OTHERS)) {
                                                err = mm_sound_unset_focus_watch_callback(g_slots[slotid].focus_wcb_id);
                                                if (err) {
                                                        debug_error("mm_sound_unset_focus_watch_callback failed [0x%x]", err);
-                                                       pthread_mutex_unlock(&g_slot_mutex);
-                                                       return MM_ERROR_POLICY_INTERNAL;
+                                                       err = MM_ERROR_POLICY_INTERNAL;
+                                                       goto cleanup;
                                                }
                                        }
                                }
@@ -795,8 +790,6 @@ static int _MMSoundMgrCodecStopCallback(int param)
        /*
         * Unregister FOCUS here
         */
-
-       int errorcode = 0;
        debug_msg("[CODEC MGR] enable_session %d ",g_slots[param].enable_session);
 
        if (g_slots[param].focus_handle || g_slots[param].focus_wcb_id) {
index 1cd75bf..9e3d84e 100644 (file)
@@ -89,7 +89,7 @@ int _MMSoundMgrIpcPlayFile(char* filename,int tone, int repeat, int volume, int
        param.volume_config = volume_config;
        param.priority = priority;
        mm_session_type = session_type;
-       param.param = client_pid;
+       param.param = (void*)client_pid;
        param.source = source;
        param.handle_route = handle_route;
        param.enable_session = enable_session;
@@ -178,7 +178,7 @@ int _MMSoundMgrIpcClearFocus(int pid)
        return MM_ERROR_NONE;
 }
 
-_MMSoundMgrIpcPlayFileWithStreamInfo(char* filename, int repeat, int volume,
+int _MMSoundMgrIpcPlayFileWithStreamInfo(char* filename, int repeat, int volume,
                           int priority, int client_pid, int handle_route, int *codechandle, char *stream_type, int stream_index)
 {
        mmsound_mgr_codec_param_t param = {0,};
@@ -205,7 +205,7 @@ _MMSoundMgrIpcPlayFileWithStreamInfo(char* filename, int repeat, int volume,
        param.repeat_count = repeat;
        param.volume = volume;
        param.priority = priority;
-       param.param = client_pid;
+       param.param = (void*)client_pid;
        param.source = source;
        param.handle_route = handle_route;
        param.stream_index = stream_index;
@@ -245,7 +245,7 @@ int _MMSoundMgrIpcPlayDTMF(int tone, int repeat, int volume, int volume_config,
        param.volume = volume;
        param.volume_config = volume_config;
        param.priority = 0;
-       param.param = client_pid;
+       param.param = (void*)client_pid;
        param.session_options = session_options;
        param.enable_session = enable_session;
        param.stream_index = stream_index;
@@ -309,7 +309,7 @@ int _MMSoundMgrIpcPlayDTMFWithStreamInfo(int tone, int repeat, int volume, int c
        param.repeat_count = repeat;
        param.volume = volume;
        param.priority = 0;
-       param.param = client_pid;
+       param.param = (void*)client_pid;
        param.stream_index = stream_index;
        strncpy(param.stream_type, stream_type, MM_SOUND_STREAM_TYPE_LEN);
 
@@ -334,12 +334,14 @@ int _MMSoundMgrIpcPlayDTMFWithStreamInfo(int tone, int repeat, int volume, int c
 int __mm_sound_mgr_ipc_set_sound_path_for_active_device(mm_sound_device_in _device_in, mm_sound_device_out _device_out)
 {
        int ret = MM_ERROR_NONE;
+#if 0 /* FIXME */
        mm_sound_device_in device_in = MM_SOUND_DEVICE_IN_NONE;
        mm_sound_device_out device_out = MM_SOUND_DEVICE_OUT_NONE;
 
        device_in = _device_in;
        device_out = _device_out;
-//     ret = _mm_sound_mgr_device_set_sound_path_for_active_device(device_out, device_in);
+       ret = _mm_sound_mgr_device_set_sound_path_for_active_device(device_out, device_in);
+#endif
 
        return ret;
 }
index 4e5d456..3c23de8 100644 (file)
@@ -907,6 +907,7 @@ static void handle_method_get_bt_a2dp_status(GDBusMethodInvocation* invocation)
 
        debug_fenter();
 
+       /* FIXME */
 //     ret = MMSoundMgrPulseHandleIsBtA2DPOnReq(&is_bt_on, &bt_name);
 
 send_reply:
@@ -952,12 +953,14 @@ send_reply:
 static void handle_method_get_audio_path(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE;
-       int device_in = 0, device_out = 0;
+       mm_sound_device_in device_in = 0;
+       mm_sound_device_out device_out = 0;
 
        debug_fenter();
 
        ret = __mm_sound_mgr_ipc_get_audio_path(&device_in, &device_out);
 
+       /* FIXME */
 send_reply:
        if (ret == MM_ERROR_NONE) {
                _method_call_return_value(invocation, g_variant_new("(ii)", device_in, device_out));
@@ -971,7 +974,7 @@ send_reply:
 static void handle_method_get_connected_device_list(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE;
-       GVariant *params = NULL, *reply_v = NULL;
+       GVariant *params = NULL;
        GVariantBuilder reply_builder;
        int mask_flags = 0;
        int devices_num = 0, device_idx = 0;
@@ -1038,7 +1041,7 @@ static char* _get_container_from_cookie(GVariant* cookie_data)
 static void handle_method_asm_register_sound(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE;
-       int pid = 0, handle = 0, sound_event = 0, request_id = 0, sound_state = 0, resource = 0;
+       int handle = 0, sound_event = 0, request_id = 0, sound_state = 0, resource = 0;
        int pid_r = 0, alloc_handle_r = 0, cmd_handle_r = 0, request_id_r = 0, sound_command_r = 0, sound_state_r = 0;
        GVariant *params = NULL;
 #ifdef SUPPORT_CONTAINER
@@ -1047,6 +1050,8 @@ static void handle_method_asm_register_sound(GDBusMethodInvocation* invocation)
 #ifdef USE_SECURITY
        GVariant* cookie_data;
 #endif /* USE_SECURITY */
+#else
+       int pid = 0;
 #endif /* SUPPORT_CONTAINER */
 
        debug_fenter();
@@ -1117,7 +1122,7 @@ send_reply:
 static void handle_method_asm_register_watcher(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE;
-       int pid = 0, handle = 0, sound_event = 0, request_id = 0, sound_state = 0, resource = 0;
+       int handle = 0, sound_event = 0, request_id = 0, sound_state = 0, resource = 0;
        int pid_r = 0, alloc_handle_r = 0, cmd_handle_r = 0, request_id_r = 0, sound_command_r = 0, sound_state_r = 0;
        GVariant *params = NULL;
 #ifdef SUPPORT_CONTAINER
@@ -1126,6 +1131,8 @@ static void handle_method_asm_register_watcher(GDBusMethodInvocation* invocation
 #ifdef USE_SECURITY
        GVariant* cookie_data;
 #endif /* USE_SECURITY */
+#else
+       int pid = 0;
 #endif /* SUPPORT_CONTAINER */
 
        debug_fenter();
@@ -1197,7 +1204,7 @@ static void handle_method_asm_get_mystate(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE;
        int pid = 0, handle = 0, sound_event = 0, request_id = 0, sound_state = 0, resource = 0;
-       int pid_r = 0, alloc_handle_r = 0, cmd_handle_r = 0, request_id_r = 0, sound_command_r = 0, sound_state_r = 0;
+       int pid_r = 0, alloc_handle_r = 0, cmd_handle_r = 0, request_id_r = 0, sound_state_r = 0;
        GVariant *params = NULL;
 
        debug_fenter();
@@ -1257,7 +1264,7 @@ static void handle_method_asm_get_state(GDBusMethodInvocation* invocation)
 {
        int ret = MM_ERROR_NONE;
        int pid = 0, handle = 0, sound_event = 0, request_id = 0, sound_state = 0, resource = 0;
-       int pid_r = 0, alloc_handle_r = 0, cmd_handle_r = 0, request_id_r = 0, sound_command_r = 0, sound_state_r = 0;
+       int pid_r = 0, alloc_handle_r = 0, cmd_handle_r = 0, request_id_r = 0, sound_state_r = 0;
        GVariant *params = NULL;
 
        debug_fenter();
index acf092a..a668fdd 100644 (file)
@@ -179,8 +179,8 @@ static int _play_keytone(const char *filename, int volume_config)
        int fd = -1;
        ipc_t data = {{0,},{0,},{0,}};
        int ret = MM_ERROR_NONE;
-       char *role = NULL;
-       char *vol_gain_type = NULL;
+       const char *role = NULL;
+       const char *vol_gain_type = NULL;
 
        debug_msg("filepath=[%s], volume_config=[0x%x]\n", filename, volume_config);
 
@@ -303,10 +303,6 @@ int MMSoundPlugRunKeytoneControlRun(void)
        int fd = -1;
        ipc_type data;
        int size = 0;
-       mmsound_codec_info_t info = {0,};
-       MMSourceType source = {0,};
-
-       buf_param_t buf_param = {NULL, NULL};
 
        debug_enter("\n");
 
@@ -341,7 +337,6 @@ int MMSoundPlugRunKeytoneControlRun(void)
        }
        /* While loop is always on */
        stop_flag = MMSOUND_TRUE;
-       source.ptr = NULL;
 
        debug_msg("Start IPC with pipe\n");
        size = sizeof(ipc_type);
index de590fe..75c4b89 100644 (file)
@@ -105,8 +105,6 @@ void _pcm_out_func(void *data)
        unsigned char* ogg_buf;
        unsigned int ogg_remain;
        int err;
-       mm_sound_device_in device_in_after = MM_SOUND_DEVICE_IN_NONE;
-       mm_sound_device_out device_out_after = MM_SOUND_DEVICE_OUT_NONE;
 
        debug_enter("\n");
 
index 85fbbf6..668fd60 100644 (file)
@@ -1010,7 +1010,6 @@ _mm_get_CurIndex(TONE _TONE, int *CurArrayPlayCnt, int *CurIndex)
 
 static void _running_tone(void *param)
 {
-       int result = MM_ERROR_NONE;
        char *ptoneBuf = NULL;
        char filename[100];
 
index d3c6ab6..b6ae7a3 100644 (file)
@@ -356,17 +356,13 @@ static void _runing(void *param)
        char *org_cur = NULL;
        int org_size = 0;
        char *dummy = NULL;
-       int ret;
-       unsigned int volume_value = 0;
        int size;
 
        pa_sample_spec ss;
-        mm_sound_handle_route_info route_info;
+       mm_sound_handle_route_info route_info;
 
        mm_sound_device_in device_in_before = MM_SOUND_DEVICE_IN_NONE;
-       mm_sound_device_in device_in_after = MM_SOUND_DEVICE_IN_NONE;
        mm_sound_device_out device_out_before = MM_SOUND_DEVICE_OUT_NONE;
-       mm_sound_device_out device_out_after = MM_SOUND_DEVICE_OUT_NONE;
 
        if (p == NULL) {
                debug_error("[CODEC WAV] param is null\n");
index 6af657c..5c2e691 100755 (executable)
@@ -102,17 +102,17 @@ void test_callback(void *data, int id)
 void mm_sound_test_cb1(int a, void *user_data)
 {
        debug_log("dbus test user callback called: param(%d), userdata(%d)\n", a, (int)user_data);
-       g_print("my callback pid : %u  tid : %u\n", getpid(), pthread_self());
+       g_print("my callback pid : %u  tid : %ld\n", getpid(), pthread_self());
 }
 void device_connected_cb (MMSoundDevice_t device_h, bool is_connected, void *user_data)
 {
        int ret = 0;
-       int device_type = 0;
-       int io_direction = 0;
-       int state = 0;
+       mm_sound_device_type_e device_type = 0;
+       mm_sound_device_io_direction_e io_direction = 0;
+       mm_sound_device_state_e state = 0;
        int id = 0;
        char *name = NULL;
-       debug_log("*** device_connected_cb is called, device_h[0x%x], is_connected[%d], user_date[0x%x]\n", device_h, is_connected, user_data);
+       debug_log("*** device_connected_cb is called, device_h[%p], is_connected[%d], user_date[%p]\n", device_h, is_connected, user_data);
        ret = mm_sound_get_device_type(device_h, &device_type);
        if (ret) {
                debug_error("failed to mm_sound_get_device_type()\n");
@@ -138,12 +138,12 @@ void device_connected_cb (MMSoundDevice_t device_h, bool is_connected, void *use
 void device_info_changed_cb (MMSoundDevice_t device_h, int changed_info_type, void *user_data)
 {
        int ret = 0;
-       int device_type = 0;
-       int io_direction = 0;
-       int state = 0;
+       mm_sound_device_type_e device_type = 0;
+       mm_sound_device_io_direction_e io_direction = 0;
+       mm_sound_device_state_e state = 0;
        int id = 0;
        char *name = NULL;
-       debug_log("*** device_info_changed_cb is called, device_h[0x%x], changed_info_type[%d], user_date[0x%x]\n", device_h, changed_info_type, user_data);
+       debug_log("*** device_info_changed_cb is called, device_h[%p], changed_info_type[%d], user_date[%p]\n", device_h, changed_info_type, user_data);
        ret = mm_sound_get_device_type(device_h, &device_type);
        if (ret) {
                debug_error("failed to mm_sound_get_device_type()\n");
@@ -175,7 +175,7 @@ void focus_cb0 (int index, mm_sound_focus_type_e type, mm_sound_focus_state_e st
        else
                _state = "ACQUIRED";
        debug_log("*** focus_cb0 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], additional_info[%s], user_data[%s]\n",
-                       index, type, _state, reason_for_change, additional_info, user_data);
+                       index, type, _state, reason_for_change, additional_info, (char*)user_data);
 }
 void focus_cb1 (int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data)
 {
@@ -185,7 +185,7 @@ void focus_cb1 (int index, mm_sound_focus_type_e type, mm_sound_focus_state_e st
        else
                _state = "ACQUIRED";
        debug_log("*** focus_cb1 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], additional_info[%s], user_data[%s]\n",
-                       index, type, _state, reason_for_change, additional_info, user_data);
+                       index, type, _state, reason_for_change, additional_info, (char*)user_data);
 }
 void focus_watch_cb (int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info, void *user_data)
 {
@@ -195,7 +195,7 @@ void focus_watch_cb (int index, mm_sound_focus_type_e type, mm_sound_focus_state
        else
                _state = "ACQUIRED";
        debug_log("*** focus_watch_cb is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], additional_info[%s], user_data[%s]\n",
-                       index, type, _state, reason_for_change, additional_info, user_data);
+                       index, type, _state, reason_for_change, additional_info, (char*)user_data);
 }
 #endif
 void quit_program()
@@ -319,14 +319,17 @@ gboolean timeout_quit_program(void* data)
 
 gboolean input (GIOChannel *channel)
 {
-    char buf[MAX_STRING_LEN + 3];
-    gsize read;
-
-    g_io_channel_read(channel, buf, MAX_STRING_LEN, &read);
-    buf[read] = '\0';
-    g_strstrip(buf);
-    interpret (buf);
-    return TRUE;
+       GError *err = NULL;
+       gsize read;
+       char buf[MAX_STRING_LEN + 3];
+
+       g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &err);
+       buf[read] = '\0';
+       g_strstrip(buf);
+
+       interpret (buf);
+
+       return TRUE;
 }
 
 
@@ -413,7 +416,7 @@ static void __mm_sound_active_device_changed_cb (mm_sound_device_in device_in, m
 static void __mm_sound_signal_cb1 (mm_sound_signal_name_t signal, int value, void *user_data)
 {
        int _value = 0;
-       g_print ("[%s] signal[%d], value[%d], user_data[0x%x]]\n", __func__, signal, value, user_data);
+       g_print ("[%s] signal[%d], value[%d], user_data[%p]]\n", __func__, signal, value, user_data);
        mm_sound_get_signal_value (signal, &_value);
        g_print (" -- get value : %d\n", _value);
 }
@@ -421,7 +424,7 @@ static void __mm_sound_signal_cb1 (mm_sound_signal_name_t signal, int value, voi
 static void __mm_sound_signal_cb2 (mm_sound_signal_name_t signal, int value, void *user_data)
 {
        int _value = 0;
-       g_print ("[%s] signal[%d], value[%d], user_data[0x%x]]\n", __func__, signal, value, user_data);
+       g_print ("[%s] signal[%d], value[%d], user_data[%p]]\n", __func__, signal, value, user_data);
        mm_sound_get_signal_value (signal, &_value);
        g_print (" -- get value : %d\n", _value);
 }
@@ -444,12 +447,12 @@ static void interpret (char *cmd)
                                if(ret < 0)
                                        debug_log("mm_sound_subscribe_signal() failed with 0x%x\n", ret);
                                else
-                                       debug_log("id: %u, callback:0x%x\n", g_subscribe_id1, __mm_sound_signal_cb1);
+                                       debug_log("id: %u, callback:%p\n", g_subscribe_id1, __mm_sound_signal_cb1);
                                ret = mm_sound_subscribe_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &g_subscribe_id2, __mm_sound_signal_cb2, NULL);
                                if(ret < 0)
                                        debug_log("mm_sound_subscribe_signal() failed with 0x%x\n", ret);
                                else
-                                       debug_log("id: %u, callback:0x%x\n", g_subscribe_id2, __mm_sound_signal_cb2);
+                                       debug_log("id: %u, callback:%p\n", g_subscribe_id2, __mm_sound_signal_cb2);
                        }
 
                        else if(strncmp(cmd, "DU", 2) ==0) {
@@ -464,14 +467,14 @@ static void interpret (char *cmd)
                                if(ret < 0)
                                        debug_log("mm_sound_send_signal() failed with 0x%x\n", ret);
                                else
-                                       debug_log("mm_sound_send_signal for signal[%s], value[%d] is success\n", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 1);
+                                       debug_log("mm_sound_send_signal for signal[%d], value[%d] is success\n", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 1);
                                mm_sound_get_signal_value (MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &value);
                                g_print (" -- get value of RELEASE_INTERNAL_FOCUS : %d\n", value);
                                ret = mm_sound_send_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 0);
                                if(ret < 0)
                                        debug_log("mm_sound_send_signal() failed with 0x%x\n", ret);
                                else
-                                       debug_log("mm_sound_send_signal for signal[%s], value[%d] is success\n", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 0);
+                                       debug_log("mm_sound_send_signal for signal[%d], value[%d] is success\n", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 0);
                                mm_sound_get_signal_value (MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &value);
                                g_print (" -- get value of RELEASE_INTERNAL_FOCUS : %d\n", value);
                        }
@@ -526,11 +529,11 @@ static void interpret (char *cmd)
                                else if(flag_2 == '0') { stream_type = "voice_recognition"; }
                                else { stream_type = "media"; }
 
-                               ret = mm_sound_register_focus(id, stream_type, (id == 0)? focus_cb0 : focus_cb1, user_data);
+                               ret = mm_sound_register_focus(id, stream_type, (id == 0)? focus_cb0 : focus_cb1, (void*)user_data);
                                if (ret) {
                                        g_print("failed to mm_sound_register_focus(), ret[0x%x]\n", ret);
                                } else {
-                                       g_print("id[%d], stream_type[%s], callback fun[0x%x]\n", id, stream_type, (id == 0)? focus_cb0 : focus_cb1);
+                                       g_print("id[%d], stream_type[%s], callback fun[%p]\n", id, stream_type, (id == 0)? focus_cb0 : focus_cb1);
                                }
                        }
 
@@ -622,7 +625,6 @@ static void interpret (char *cmd)
                                char input_string[128];
                                char flag_1;
                                int type = 0;
-                               char *stream_type = NULL;
                                const char *user_data = "this is user data for watch";
 
                                fflush(stdin);
@@ -640,11 +642,11 @@ static void interpret (char *cmd)
                                else if(flag_1 == '2') { type = 2; }
                                else if(flag_1 == '3') { type = 3; }
                                else { type = 1; }
-                               ret = mm_sound_set_focus_watch_callback(type, focus_watch_cb, user_data, &g_focus_watch_index);
+                               ret = mm_sound_set_focus_watch_callback(type, focus_watch_cb, (void*)user_data, &g_focus_watch_index);
                                if (ret) {
                                        g_print("failed to mm_sound_set_focus_watch_callback(), ret[0x%x]\n", ret);
                                } else {
-                                       g_print("index[%d], type[%d], callback fun[0x%x]\n", g_focus_watch_index, type, focus_watch_cb);
+                                       g_print("index[%d], type[%d], callback fun[%p]\n", g_focus_watch_index, type, focus_watch_cb);
                                }
                        }
 
@@ -680,7 +682,7 @@ static void interpret (char *cmd)
                            int ret = 0;
                            int user_data = 3;
                            g_print("dbus method test add callback\n");
-                           g_print("my testsuite pid : %u  tid : %u\n", getpid(), pthread_self());
+                           g_print("my testsuite pid : %u  tid : %ld\n", getpid(), pthread_self());
                            ret = mm_sound_add_test_callback(mm_sound_test_cb1, (void *)user_data);
                            if (ret) {
                                g_print("failed to mm_sound_add_test_callback(), ret[0x%x]\n", ret);
@@ -699,7 +701,8 @@ static void interpret (char *cmd)
                        }
                        else if (strncmp(cmd, "gap", 3) == 0) {
                                int ret = 0;
-                               int device_in=0, device_out=0;
+                               mm_sound_device_in device_in = 0;
+                               mm_sound_device_out device_out = 0;
                                ret = mm_sound_get_audio_path(&device_in, &device_out);
                                if (ret == MM_ERROR_NONE) {
                                    g_print ("### mm_sound_get_audio_path() Success (%X,%X)\n\n", device_in, device_out);
@@ -1500,9 +1503,9 @@ static void interpret (char *cmd)
                        int ret = 0;
                        mm_sound_device_flags_e flags = MM_SOUND_DEVICE_ALL_FLAG;
                        MMSoundDeviceList_t device_list;
-                       int device_type = 0;
-                       int io_direction = 0;
-                       int state = 0;
+                       mm_sound_device_type_e device_type = 0;
+                       mm_sound_device_io_direction_e io_direction = 0;
+                       mm_sound_device_state_e state = 0;
                        int id = 0;
                        char *name = NULL;
                        MMSoundDevice_t device_h = NULL;
@@ -1512,7 +1515,7 @@ static void interpret (char *cmd)
                        if (ret) {
                                g_print("failed to mm_sound_get_current_device_list(), ret[0x%x]\n", ret);
                        } else {
-                               g_print("device_list[0x%x], device_h[0x%x]\n", device_list, device_h);
+                               g_print("device_list[%p], device_h[%p]\n", device_list, device_h);
                                do {
                                        dret = mm_sound_get_next_device (device_list, &device_h);
                                        if (dret) {
@@ -1629,7 +1632,7 @@ static void interpret (char *cmd)
                        if (ret) {
                                g_print("failed to mm_sound_add_device_connected_callback(), ret[0x%x]\n", ret);
                        } else {
-                               g_print("device_flags[0x%x], callback fun[0x%x]\n", device_flag_1|device_flag_2|device_flag_3, device_connected_cb);
+                               g_print("device_flags[0x%x], callback fun[%p]\n", device_flag_1|device_flag_2|device_flag_3, device_connected_cb);
                        }
                }
 
@@ -1696,7 +1699,7 @@ static void interpret (char *cmd)
                        if (ret) {
                                g_print("failed to mm_sound_add_device_information_changed_callback(), ret[0x%x]\n", ret);
                        } else {
-                               g_print("device_flags[0x%x], callback fun[0x%x]\n", device_flag_1|device_flag_2|device_flag_3, device_info_changed_cb);
+                               g_print("device_flags[0x%x], callback fun[%p]\n", device_flag_1|device_flag_2|device_flag_3, device_info_changed_cb);
                        }
                }