* Create stt handle.
*
*/
- int ret = stt_create(&handle);
+ int ret = static_cast<int>(stt_create(&handle));
if (ret != STT_ERROR_NONE)
throw SttException(ret, ErrorString((stt_error_e)ret));
- ret = sound_manager_create_stream_information(SOUND_STREAM_TYPE_VOICE_RECOGNITION, player_focus_state_cb, NULL, &g_stream_info_h);
+ ret = static_cast<int>(sound_manager_create_stream_information(SOUND_STREAM_TYPE_VOICE_RECOGNITION, player_focus_state_cb, NULL, &g_stream_info_h));
if (SOUND_MANAGER_ERROR_NONE != ret) {
LOGW("Fail to create stream info. ret : %d", ret);
}
{
if (my_voicedata && my_voicedata->partial_result) {
SECURE_LOGD("***** result_text : %s *******", my_voicedata->partial_result);
- const int BUF_LEN = strlen(my_voicedata->partial_result) + 1;
+ const int BUF_LEN = 256;
char retStr[BUF_LEN] = {0};
snprintf(retStr, BUF_LEN, "%s", my_voicedata->partial_result);
ise_send_string(retStr);
void init_customizing_theme(void)
{
- std::string stt_edj_path = app_get_resource_path();
- stt_edj_path = stt_edj_path + STT_EDJ_FILE;
- elm_theme_extension_add(NULL, stt_edj_path.c_str());
+ char *resource_path = app_get_resource_path();
+ if (resource_path) {
+ std::string stt_edj_path = resource_path;
+ stt_edj_path = stt_edj_path + STT_EDJ_FILE;
+ elm_theme_extension_add(NULL, stt_edj_path.c_str());
+ free(resource_path);
+ }
}
bool _app_stt_initialize(VoiceData *voice_data)
voicedata->layout_main = layout_main;
- std::string edj_path = app_get_resource_path();
+ std::string edj_path;
+ char *resource_path = app_get_resource_path();
+ if (resource_path) {
+ edj_path = resource_path;
+ free(resource_path);
+ resource_path = NULL;
+ }
edj_path = edj_path + STT_EDJ_FILE;
LOGD("edj_path = %s", edj_path.c_str());
static void _input_smartreply_notify_cb(void *user_data)
{
g_smartreply_strings.clear();
- char *candidate;
+ char *candidate = NULL;
if (input_smartreply_is_enabled()) {
/* Append newly added smartreply list */
if (candidate) {
g_smartreply_strings.push_back(string(candidate));
g_smartreply_size++;
+ free(candidate);
+ candidate = NULL;
}
}
g_ic_smartreply = g_ic;
{
LOGD("layout=%d\n", layout);
/* Check if the layoutIdx is in the valid range */
- if ((ISE_LAYOUT)layout < ISE_LAYOUT_STYLE_MAX) {
+ if (static_cast<int>(layout) < static_cast<int>(ISE_LAYOUT_STYLE_MAX)) {
if (g_keyboard_state.layout != layout) {
g_keyboard_state.need_reset = TRUE;
}