static Eina_Bool __notify_error_timer_cb(void *data)
{
- int uid = (int)data;
+ int uid = (intptr_t)data;
tts_client_s* client = tts_client_get_by_uid(uid);
if (NULL == client) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] UID is not valid. (%d)", uid);
static Eina_Bool __notify_state_timer_cb(void *data)
{
- int uid = (int)data;
+ int uid = (intptr_t)data;
tts_client_s* client = tts_client_get_by_uid(uid);
if (NULL == client) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] UID is not valid. (%d)", uid);
static Eina_Bool __prepare_cb(void *data)
{
- int uid = (int)data;
+ int uid = (intptr_t)data;
tts_client_s* client = tts_client_get_by_uid(uid);
if (NULL == client) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Handle is not valid.");
static Eina_Bool __prepare_first_cb(void *data)
{
/* send first hello message */
- int uid = (int)data;
+ int uid = (intptr_t)data;
tts_client_s* client = tts_client_get_by_uid(uid);
if (NULL == client) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Handle is not valid.");
static bool __supported_voice_cb(const char* engine_id, const char* language, int type, void* user_data)
{
- int uid = (int)user_data;
+ int uid = (intptr_t)user_data;
tts_client_s* client = tts_client_get_by_uid(uid);
if (NULL == client) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Uid is not valid. (%d)", uid);
if (NULL != client->notify_state_timer) {
ecore_timer_del(client->notify_state_timer);
}
- client->notify_state_timer = ecore_timer_add(0, __notify_state_timer_cb, (void*)tts_client_get_uid(client));
+
+ intptr_t uid = tts_client_get_uid(client);
+ client->notify_state_timer = ecore_timer_add(0, __notify_state_timer_cb, (void*)uid);
return TTS_ERROR_NONE;
}
if (NULL != client->notify_error_timer) {
ecore_timer_del(client->notify_error_timer);
}
- client->notify_error_timer = ecore_timer_add(0, __notify_error_timer_cb, (void*)tts_client_get_uid(client));
+
+ intptr_t uid = tts_client_get_uid(client);
+ client->notify_error_timer = ecore_timer_add(0, __notify_error_timer_cb, (void*)uid);
return TTS_ERROR_NONE;
}
SLOG(LOG_ERROR, TAG_TTSC, "Register timer for __prepare_first_cb");
ecore_thread_main_loop_begin();
- client->hello_timer = ecore_timer_add(0.0, __prepare_first_cb, (void*)tts_client_get_uid(client));
+ intptr_t uid = tts_client_get_uid(client);
+ client->hello_timer = ecore_timer_add(0.0, __prepare_first_cb, (void*)uid);
ecore_thread_main_loop_end();
} else {
LOGD("Client is already trying to prepare");
}
tts_client_set_supported_voice_cb(client, callback, user_data);
- int ret = tts_config_mgr_get_voice_list(engine_id, __supported_voice_cb, (void*)tts_client_get_uid(client));
+ intptr_t uid = tts_client_get_uid(client);
+ int ret = tts_config_mgr_get_voice_list(engine_id, __supported_voice_cb, (void*)uid);
tts_client_set_supported_voice_cb(client, NULL, NULL);
if (0 != ret) {
static void __reconnect(void *data)
{
- int uid = (int)data;
+ int uid = (intptr_t)data;
tts_client_s *client = tts_client_get_by_uid(uid);
if (!client)
static void __on_connected(rpc_port_proxy_tts_h h, void *user_data)
{
- int uid = (int)user_data;
+ int uid = (intptr_t)user_data;
tts_client_s* client = tts_client_get_by_uid(uid);
if (NULL == client) {
static void __on_disconnected(rpc_port_proxy_tts_h h, void *user_data)
{
- int uid = (int)user_data;
+ int uid = (intptr_t)user_data;
tts_client_s* client = tts_client_get_by_uid(uid);
if (NULL == client) {
tts_core_handle_service_reset();
SLOG(LOG_DEBUG, TAG_TTSC, "Disconnected from server");
- ecore_main_loop_thread_safe_call_async(__reconnect, (void*)uid);
+ ecore_main_loop_thread_safe_call_async(__reconnect, user_data);
SLOG(LOG_DEBUG, TAG_TTSC, "Try to reconnect to server");
}
}
static void __on_rejected(rpc_port_proxy_tts_h h, void *user_data)
{
- int uid = (int)user_data;
+ int uid = (intptr_t)user_data;
tts_client_s *client = tts_client_get_by_uid(uid);
if (!client)
return;
client->reason = 0; // default value
}
-
- if (0 != rpc_port_proxy_tts_create(engine_mode, &rpc_callback, (void*)uid, &tts->rpc_h)) {
+ intptr_t ptr_uid = uid;
+ if (0 != rpc_port_proxy_tts_create(engine_mode, &rpc_callback, (void*)ptr_uid, &tts->rpc_h)) {
free(engine_name);
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to create proxy");
return TTS_ERROR_OPERATION_FAILED;