#include "voice_control_common.h"
/* Max number of handle */
-static const int g_max_handle = 999;
+static const unsigned int MAX_NUMBER_OF_HANDLE = 999;
/* allocated handle */
-static int g_allocated_handle = 0;
+static unsigned int g_allocated_handle = 0;
/* widget list */
static GSList *g_widget_list = NULL;
return NULL;
}
-static int __client_generate_uid(int pid)
+static unsigned int __client_generate_uid(unsigned int pid)
{
g_allocated_handle++;
- if (g_allocated_handle > g_max_handle) {
+ if (g_allocated_handle > MAX_NUMBER_OF_HANDLE) {
g_allocated_handle = 1;
}
/* generate uid, handle number should be smaller than 1000 */
- return pid * 1000 + g_allocated_handle;
+ return pid * 1000u + g_allocated_handle;
}
int vc_widget_client_create(vc_h* vc)
return VC_ERROR_OUT_OF_MEMORY;
}
- temp->handle = __client_generate_uid(getpid());
+ temp->handle = __client_generate_uid((unsigned int)getpid());
/* initialize widget data */
widget->vc = temp;
{
if (VC_INVALID_TTS_UID == g_current_tts_uid && VCE_FEEDBACK_EVENT_START == event) {
g_current_utt_id = (g_current_utt_id + 1) % 1000;
- g_current_tts_uid = vcd_client_manager_get_pid() * 1000 + g_current_utt_id;
+ g_current_tts_uid = (unsigned int)vcd_client_manager_get_pid() * 1000u + g_current_utt_id;
SLOG(LOG_INFO, TAG_VCD, "[Server info] set current uid and utt_id as manager pid(%d)", vcd_client_manager_get_pid());
}
g_current_utt_id = (g_current_utt_id + 1) % 1000;
*utt_id = g_current_utt_id;
if (0 == to_vcm) {
- tts_uid = pid * 1000 + g_current_utt_id;
+ tts_uid = (unsigned int)pid * 1000u + (unsigned int)g_current_utt_id;
} else {
- tts_uid = vcd_client_manager_get_pid() * 1000 + g_current_utt_id;
+ tts_uid = (unsigned int)vcd_client_manager_get_pid() * 1000u + (unsigned int)g_current_utt_id;
}
SLOG(LOG_INFO, TAG_VCD, "[Server INFO] pid(%d), text(%s), language(%s), to_vcm(%d), ", pid, text, language, to_vcm);
SLOG(LOG_INFO, TAG_VCD, "[Server INFO] current_uid(%u), current_utt_id(%d)", tts_uid, g_current_utt_id);
vc_tts_text_data_s* tts_text_data = NULL;
- unsigned int tts_uid = pid * 1000 + utt_id;
+ unsigned int tts_uid = (unsigned int)pid * 1000u + (unsigned int)utt_id;
int ret = vcd_data_get_tts_text_data(tts_uid, &tts_text_data);
if (0 != ret) {
SLOG(LOG_WARN, TAG_VCD, "[Server WARN] No data in vcd tts text queue");