Cleared all warnings when compiling 51/136151/2 accepted/tizen/4.0/unified/20170816.012900 accepted/tizen/4.0/unified/20170828.224437 accepted/tizen/unified/20170718.173919 submit/tizen/20170717.070127 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170828.100001 submit/tizen_4.0/20170828.110001
authorLee Hackseung <lhs@dignsys.com>
Wed, 28 Jun 2017 08:30:57 +0000 (17:30 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 29 Jun 2017 12:17:03 +0000 (12:17 +0000)
tizen-audio-impl-pcm.c
Change AUDIO_LOG_ERROR usage.

Change-Id: I8cdafcf338ba8904d191d2fd32749747352b775d

tizen-audio-impl-pcm.c

index e6327ea..273004d 100644 (file)
@@ -186,8 +186,7 @@ audio_return_t _pcm_start(void *pcm_handle)
         return AUDIO_ERR_RESOURCE;
     }
 #endif
-
-    AUDIO_LOG_INFO("PCM handle 0x%x start", pcm_handle);
+       AUDIO_LOG_INFO("PCM handle %p start", pcm_handle);
     return AUDIO_RET_OK;
 }
 
@@ -207,15 +206,14 @@ audio_return_t _pcm_stop(void *pcm_handle)
     }
 #endif
 
-    AUDIO_LOG_INFO("PCM handle 0x%x stop", pcm_handle);
+       AUDIO_LOG_INFO("PCM handle %p stop", pcm_handle);
     return AUDIO_RET_OK;
 }
 
 audio_return_t _pcm_close(void *pcm_handle)
 {
     int err;
-
-    AUDIO_LOG_INFO("Try to close PCM handle 0x%x", pcm_handle);
+       AUDIO_LOG_INFO("Try to close PCM handle %p", pcm_handle);
 
 #ifdef __USE_TINYALSA__
     if ((err = pcm_close(pcm_handle)) < 0) {
@@ -254,7 +252,7 @@ audio_return_t _pcm_avail(void *pcm_handle, uint32_t *avail)
     snd_pcm_sframes_t frames_avail;
 
     if ((frames_avail = snd_pcm_avail(pcm_handle)) < 0) {
-        AUDIO_LOG_ERROR("Could not get avail at PCM handle 0x%x : %d", pcm_handle, frames_avail);
+               AUDIO_LOG_ERROR("Could not get avail at PCM handle %p: %d", pcm_handle, (int)frames_avail);
         return AUDIO_ERR_IOCTL;
     }
 
@@ -289,7 +287,7 @@ audio_return_t _pcm_write(void *pcm_handle, const void *buffer, uint32_t frames)
 
     frames_written = snd_pcm_writei(pcm_handle, buffer, (snd_pcm_uframes_t) frames);
     if (frames_written < 0) {
-        AUDIO_LOG_ERROR("Failed to write pcm : %d", frames_written);
+               AUDIO_LOG_ERROR("Failed to write pcm : %d", (int)frames_written);
         return AUDIO_ERR_IOCTL;
     }
 
@@ -320,7 +318,7 @@ audio_return_t _pcm_read(void *pcm_handle, void *buffer, uint32_t frames)
 
     frames_read = snd_pcm_readi(pcm_handle, buffer, (snd_pcm_uframes_t)frames);
     if (frames_read < 0) {
-        AUDIO_LOG_ERROR("Failed to read pcm : %d", frames_read);
+               AUDIO_LOG_ERROR("Failed to read pcm : %d", (int)frames_read);
         return AUDIO_ERR_IOCTL;
     }
 
@@ -475,7 +473,7 @@ audio_return_t _pcm_get_params(void *pcm_handle, uint32_t direction, void **samp
         (err = snd_pcm_hw_params_get_format(hwparams, &_format)) < 0 ||
         (err = snd_pcm_hw_params_get_rate(hwparams, &_rate, &dir)) < 0 ||
         (err = snd_pcm_hw_params_get_channels(hwparams, &_channels)) < 0) {
-        AUDIO_LOG_ERROR("snd_pcm_hw_params_get_{period_size|buffer_size|periods|format|rate|channels}() failed : %s", err);
+               AUDIO_LOG_ERROR("snd_pcm_hw_params_get_{period_size|buffer_size|periods|format|rate|channels}() failed : %d", err);
         return AUDIO_ERR_PARAMETER;
     }
 
@@ -494,10 +492,10 @@ audio_return_t _pcm_get_params(void *pcm_handle, uint32_t direction, void **samp
         (err = snd_pcm_sw_params_get_stop_threshold(swparams, &_stop_threshold)) < 0  ||
         (err = snd_pcm_sw_params_get_silence_threshold(swparams, &_silence_threshold)) < 0  ||
         (err = snd_pcm_sw_params_get_avail_min(swparams, &_avail_min)) < 0) {
-        AUDIO_LOG_ERROR("snd_pcm_sw_params_get_{start_threshold|stop_threshold|silence_threshold|avail_min}() failed : %s", err);
+       AUDIO_LOG_ERROR("snd_pcm_sw_params_get_{start_threshold|stop_threshold|silence_threshold|avail_min}() failed : %d", err);
     }
 
-    AUDIO_LOG_DEBUG("_pcm_get_params (handle 0x%x, format %d, rate %d, channels %d, period_size %d, periods %d, buffer_size %d)", pcm_handle, _format, _rate, _channels, _period_size, _periods, _buffer_size);
+       AUDIO_LOG_DEBUG("_pcm_get_params (handle %p, format %d, rate %d, channels %d, period_size %d, periods %d, buffer_size %d)", pcm_handle, _format, _rate, _channels, (int)_period_size, _periods, (int)_buffer_size);
 #endif
 
     return AUDIO_RET_OK;
@@ -548,12 +546,12 @@ audio_return_t _pcm_set_params(void *pcm_handle, uint32_t direction, void *sampl
     }
 
     if ((err = snd_pcm_hw_params_set_channels(pcm_handle, hwparams, ss.channels)) < 0) {
-        AUDIO_LOG_ERROR("snd_pcm_hw_params_set_channels(%u) failed : %d", err);
+               AUDIO_LOG_ERROR("snd_pcm_hw_params_set_channels(%u) failed : %d", ss.channels, err);
         return AUDIO_ERR_PARAMETER;
     }
 
     if ((err = snd_pcm_hw_params_set_period_size(pcm_handle, hwparams, period_size, 0)) < 0) {
-        AUDIO_LOG_ERROR("snd_pcm_hw_params_set_period_size(%u) failed : %d", err);
+               AUDIO_LOG_ERROR("snd_pcm_hw_params_set_period_size(%u) failed : %d", period_size,err);
         return AUDIO_ERR_PARAMETER;
     }
 
@@ -610,7 +608,7 @@ audio_return_t _pcm_set_params(void *pcm_handle, uint32_t direction, void *sampl
         return AUDIO_ERR_IOCTL;
     }
 
-    AUDIO_LOG_DEBUG("_pcm_set_params (handle 0x%x, format %d, rate %d, channels %d, period_size %d, periods %d, buffer_size %d)", pcm_handle, ss.format, ss.rate, ss.channels, period_size, periods, _buffer_size);
+       AUDIO_LOG_DEBUG("_pcm_set_params (handle %p, format %d, rate %d, channels %d, period_size %d, periods     %d, buffer_size %d)", pcm_handle, ss.format, ss.rate, ss.channels, period_size, periods,(int) _buffer_size);
 #endif
 
     return AUDIO_RET_OK;