summaryrefslogtreecommitdiff
path: root/src/modules/ecore/immodules/xim/ecore_imf_xim.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-08 14:49:50 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-08 14:49:50 +0000
commitbffd10cb7bf652b9411dba7003d14cad64cd19e4 (patch)
treefab22b2e67213fa7dfff56ca49a29d010f1a0cc8 /src/modules/ecore/immodules/xim/ecore_imf_xim.c
parente25ae55151df86cdcf3d7b0ae7a259329a4994c5 (diff)
efl/ecore_imf: minor fixes.
* removed some useless variable attribution; * removed some useless casts; * () -> (void) for function without arguments. SVN revision: 82419
Diffstat (limited to '')
-rw-r--r--src/modules/ecore/immodules/xim/ecore_imf_xim.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/modules/ecore/immodules/xim/ecore_imf_xim.c b/src/modules/ecore/immodules/xim/ecore_imf_xim.c
index c35a70bf37..696798d213 100644
--- a/src/modules/ecore/immodules/xim/ecore_imf_xim.c
+++ b/src/modules/ecore/immodules/xim/ecore_imf_xim.c
@@ -198,7 +198,7 @@ _ecore_imf_context_xim_client_window_set(Ecore_IMF_Context *ctx,
198 void *window) 198 void *window)
199{ 199{
200 DBG("ctx=%p, window=%p", ctx, window); 200 DBG("ctx=%p, window=%p", ctx, window);
201 _ecore_imf_xim_ic_client_window_set(ctx, (Ecore_X_Window)((Ecore_Window)window)); 201 _ecore_imf_xim_ic_client_window_set(ctx, (Ecore_X_Window)((unsigned long)window));
202} 202}
203 203
204static void 204static void
@@ -422,18 +422,19 @@ _ecore_imf_xim_feedback_attr_add(Eina_List **attrs,
422 int start_pos, 422 int start_pos,
423 int end_pos) 423 int end_pos)
424{ 424{
425 Ecore_IMF_Preedit_Attr *attr = NULL; 425 Ecore_IMF_Preedit_Attr *attr;
426
427 unsigned int start_index = _ecore_imf_xim_utf8_offset_to_index(str, start_pos); 426 unsigned int start_index = _ecore_imf_xim_utf8_offset_to_index(str, start_pos);
428 unsigned int end_index = _ecore_imf_xim_utf8_offset_to_index(str, end_pos); 427 unsigned int end_index = _ecore_imf_xim_utf8_offset_to_index(str, end_pos);
429 428
430 if (feedback & FEEDBACK_MASK) 429 if (feedback & FEEDBACK_MASK)
431 { 430 {
432 attr = (Ecore_IMF_Preedit_Attr *)calloc(1, sizeof(Ecore_IMF_Preedit_Attr)); 431 attr = calloc(1, sizeof(Ecore_IMF_Preedit_Attr));
433 attr->start_index = start_index; 432 attr->start_index = start_index;
434 attr->end_index = end_index; 433 attr->end_index = end_index;
435 *attrs = eina_list_append(*attrs, (void *)attr); 434 *attrs = eina_list_append(*attrs, attr);
436 } 435 }
436 else
437 return;
437 438
438 if (feedback & XIMUnderline) 439 if (feedback & XIMUnderline)
439 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB1; 440 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB1;
@@ -967,7 +968,7 @@ _ecore_imf_xim_preedit_draw_call(XIC xic EINA_UNUSED,
967 if (tmp) 968 if (tmp)
968 { 969 {
969 int tmp_len; 970 int tmp_len;
970 new_text = eina_unicode_utf8_to_unicode((const char *)tmp, &tmp_len); 971 new_text = eina_unicode_utf8_to_unicode(tmp, &tmp_len);
971 free(tmp); 972 free(tmp);
972 } 973 }
973 974
@@ -1407,15 +1408,8 @@ _ecore_imf_xim_instantiate_cb(Display *display,
1407 XPointer call_data EINA_UNUSED) 1408 XPointer call_data EINA_UNUSED)
1408{ 1409{
1409 XIM_Im_Info *info = (XIM_Im_Info *)client_data; 1410 XIM_Im_Info *info = (XIM_Im_Info *)client_data;
1410 XIM im = NULL; 1411 XIM im = XOpenIM(display, NULL, NULL, NULL);
1411 1412 EINA_SAFETY_ON_NULL_RETURN(im);
1412 im = XOpenIM(display, NULL, NULL, NULL);
1413
1414 if (!im)
1415 {
1416 fprintf(stderr, "Failed to connect to IM\n");
1417 return;
1418 }
1419 1413
1420 info->im = im; 1414 info->im = im;
1421 _ecore_imf_xim_im_setup(info); 1415 _ecore_imf_xim_im_setup(info);