From: Tiago Rezende Campos Falcao Date: Fri, 22 Oct 2010 21:41:22 +0000 (+0000) Subject: Coccinelle X-Git-Tag: v1.0.0~3955 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75adbd72119bc429d0c2d57642ad3c371604b408;p=platform%2Fupstream%2Felementary.git Coccinelle SVN revision: 53786 --- diff --git a/src/bin/test_focus2.c b/src/bin/test_focus2.c index 0dd311c..43c2a46 100644 --- a/src/bin/test_focus2.c +++ b/src/bin/test_focus2.c @@ -8,7 +8,7 @@ static void _focus_in(void *data __UNUSED__, Evas *e __UNUSED__, void *event_info) { const char *type = evas_object_type_get(event_info); - if (type && strcmp(type, "elm_widget") == 0) + if ((type) && (strcmp(type, "elm_widget") == 0)) type = elm_object_widget_type_get(event_info); printf("Evas_Object focus in: %p %s\n", event_info, type); } @@ -17,7 +17,7 @@ static void _focus_out(void *data __UNUSED__, Evas *e __UNUSED__, void *event_info) { const char *type = evas_object_type_get(event_info); - if (type && strcmp(type, "elm_widget") == 0) + if ((type) && (strcmp(type, "elm_widget") == 0)) type = elm_object_widget_type_get(event_info); printf("Evas_Object focus out: %p %s\n", event_info, type); } @@ -27,7 +27,7 @@ _focus_obj(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__) { Evas_Object *newfocus = data; const char *type = evas_object_type_get(newfocus); - if (type && strcmp(type, "elm_widget") == 0) + if ((type) && (strcmp(type, "elm_widget") == 0)) type = elm_object_widget_type_get(newfocus); printf("elm_object_focus(%p) %s\n", newfocus, type); elm_object_focus(newfocus); diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c index 695b01c..6e3af26 100644 --- a/src/bin/test_genlist.c +++ b/src/bin/test_genlist.c @@ -1183,7 +1183,7 @@ test_genlist7_swipe(void *data, Evas_Object *obj __UNUSED__, void *event_info) Evas_Object *box, *entry, *button; char item_data[] = "Just a simple test"; - if (!event_info || !data) return; + if ((!event_info) || (!data)) return; box = elm_box_add(info->win); elm_box_homogenous_set(box, 0); diff --git a/src/bin/test_list.c b/src/bin/test_list.c index ca06f69..07fcf7d 100644 --- a/src/bin/test_list.c +++ b/src/bin/test_list.c @@ -539,7 +539,7 @@ test_list4_swipe(void *data, Evas_Object *obj __UNUSED__, void *event_info) Evas_Object *box, *entry, *button; struct Pginfo *info = data; char *item_data; - if (!event_info || !data) return; + if ((!event_info) || (!data)) return; item_data = elm_list_item_data_get(event_info); diff --git a/src/bin/test_map.c b/src/bin/test_map.c index a6af25b..155f186 100644 --- a/src/bin/test_map.c +++ b/src/bin/test_map.c @@ -336,7 +336,7 @@ _map_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, zoom++; elm_map_zoom_mode_set(map, ELM_MAP_ZOOM_MODE_MANUAL); - if (zoom >= 0 && zoom <= 18) elm_map_zoom_set(map, zoom); + if ((zoom >= 0) && (zoom <= 18)) elm_map_zoom_set(map, zoom); } static void diff --git a/src/bin/test_photo.c b/src/bin/test_photo.c index 390c97f..1658f30 100644 --- a/src/bin/test_photo.c +++ b/src/bin/test_photo.c @@ -63,7 +63,7 @@ test_photo(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_smart_callback_add(ph, "drag,stop", drag_stop_cb, NULL); - if(n == 2 || n == 3) { + if((n == 2) || (n == 3)) { elm_photo_fill_inside_set(ph, EINA_TRUE); elm_object_style_set(ph, "shadow"); } diff --git a/src/bin/test_photocam.c b/src/bin/test_photocam.c index f1a47de..bf5a7f2 100644 --- a/src/bin/test_photocam.c +++ b/src/bin/test_photocam.c @@ -201,7 +201,7 @@ _photocam_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; zoom = elm_photocam_zoom_get(photocam); - if (ev->z>0 && zoom == 1) return; + if ((ev->z>0) && (zoom == 1)) return; if (ev->z > 0) zoom /= 2; diff --git a/src/edje_externals/elm_fileselector.c b/src/edje_externals/elm_fileselector.c index 76808e0..327001b 100644 --- a/src/edje_externals/elm_fileselector.c +++ b/src/edje_externals/elm_fileselector.c @@ -24,7 +24,7 @@ external_fileselector_state_set(void *data __UNUSED__, Evas_Object *obj, const v else if (from_params) p = from_params; else return; - if (p->is_save_set && p->is_save) + if ((p->is_save_set) && (p->is_save)) elm_fileselector_is_save_set(obj, p->is_save); if (p->folder_only_set) elm_fileselector_folder_only_set(obj, p->folder_only); diff --git a/src/edje_externals/elm_notify.c b/src/edje_externals/elm_notify.c index ad783c5..c55cd11 100644 --- a/src/edje_externals/elm_notify.c +++ b/src/edje_externals/elm_notify.c @@ -70,8 +70,8 @@ static void external_notify_state_set(void *data __UNUSED__, static Eina_Bool external_notify_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param) { - if (!strcmp(param->name, "content") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) + if ((!strcmp(param->name, "content")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) { Evas_Object *content = external_common_param_edje_object_get(obj, param); if ((strcmp(param->s, "")) && (!content)) @@ -79,20 +79,20 @@ static Eina_Bool external_notify_param_set(void *data __UNUSED__, elm_notify_content_set(obj, content); return EINA_TRUE; } - else if (!strcmp(param->name, "repeat_events") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) + else if ((!strcmp(param->name, "repeat_events")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) { elm_notify_repeat_events_set(obj, param->i); return EINA_TRUE; } - else if (!strcmp(param->name, "timeout") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) + else if ((!strcmp(param->name, "timeout")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) { elm_notify_timeout_set(obj, param->d); return EINA_TRUE; } - else if (!strcmp(param->name, "orient") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE) + else if ((!strcmp(param->name, "orient")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)) { Elm_Notify_Orient set = _orient_get(param->s); if (set == ELM_NOTIFY_ORIENT_LAST) return EINA_FALSE; @@ -114,20 +114,20 @@ static Eina_Bool external_notify_param_get(void *data __UNUSED__, /* not easy to get content name back from live object */ return EINA_FALSE; } - else if (!strcmp(param->name, "repeat_events") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) + else if ((!strcmp(param->name, "repeat_events")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) { param->i = elm_notify_repeat_events_get(obj); return EINA_TRUE; } - else if (!strcmp(param->name, "timeout") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) + else if ((!strcmp(param->name, "timeout")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) { param->d = elm_notify_timeout_get(obj); return EINA_TRUE; } - else if (!strcmp(param->name, "orient") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE) + else if ((!strcmp(param->name, "orient")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)) { Elm_Notify_Orient set = elm_notify_orient_get(obj); if (set == ELM_NOTIFY_ORIENT_LAST) return EINA_FALSE; diff --git a/src/edje_externals/elm_panes.c b/src/edje_externals/elm_panes.c index 841c3d8..a965d31 100644 --- a/src/edje_externals/elm_panes.c +++ b/src/edje_externals/elm_panes.c @@ -40,8 +40,8 @@ static void external_panes_state_set(void *data __UNUSED__, static Eina_Bool external_panes_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param) { - if (!strcmp(param->name, "content left") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) + if ((!strcmp(param->name, "content left")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) { Evas_Object *content = external_common_param_edje_object_get(obj, param); if ((strcmp(param->s, "")) && (!content)) @@ -49,8 +49,8 @@ static Eina_Bool external_panes_param_set(void *data __UNUSED__, elm_panes_content_left_set(obj, content); return EINA_TRUE; } - else if (!strcmp(param->name, "content right") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) + else if ((!strcmp(param->name, "content right")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) { Evas_Object *content = external_common_param_edje_object_get(obj, param); if ((strcmp(param->s, "")) && (!content)) @@ -58,14 +58,14 @@ static Eina_Bool external_panes_param_set(void *data __UNUSED__, elm_panes_content_right_set(obj, content); return EINA_TRUE; } - else if (!strcmp(param->name, "horizontal") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) + else if ((!strcmp(param->name, "horizontal")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) { elm_panes_horizontal_set(obj, param->i); return EINA_TRUE; } - else if (!strcmp(param->name, "left size") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) + else if ((!strcmp(param->name, "left size")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) { elm_panes_content_left_size_set(obj, param->d); return EINA_TRUE; @@ -90,14 +90,14 @@ static Eina_Bool external_panes_param_get(void *data __UNUSED__, /* not easy to get content name back from live object */ return EINA_FALSE; } - else if (!strcmp(param->name, "horizontal") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) + else if ((!strcmp(param->name, "horizontal")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) { param->i = elm_panes_horizontal_get(obj); return EINA_TRUE; } - else if (!strcmp(param->name, "left size") - && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) + else if ((!strcmp(param->name, "left size")) + && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) { param->d = elm_panes_content_left_size_get(obj); return EINA_TRUE; diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c index f7227cb..088e228 100644 --- a/src/lib/elc_fileselector_button.c +++ b/src/lib/elc_fileselector_button.c @@ -130,7 +130,7 @@ _button_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUS static Evas_Object * _parent_win_get(Evas_Object *obj) { - while (obj && strcmp(elm_widget_type_get(obj), "win")) + while ((obj) && (strcmp(elm_widget_type_get(obj), "win"))) obj = elm_object_parent_widget_get(obj); return obj; diff --git a/src/lib/elc_hoverlist.c b/src/lib/elc_hoverlist.c index 4dc56e5..3983879 100644 --- a/src/lib/elc_hoverlist.c +++ b/src/lib/elc_hoverlist.c @@ -473,7 +473,7 @@ elm_hoverlist_hover_parent_set(Evas_Object *obj, Evas_Object *parent) Widget_Data *wd; wd = elm_widget_data_get(obj); - if (!wd || !parent) + if ((!wd) || (!parent)) return; elm_hover_parent_set(wd->hover, parent); @@ -536,7 +536,7 @@ elm_hoverlist_clear(Evas_Object* obj) Widget_Data *wd; wd = elm_widget_data_get(obj); - if (!wd || !wd->items) + if ((!wd) || (!wd->items)) return; EINA_LIST_FREE(wd->items, item) diff --git a/src/lib/elc_scrolled_entry.c b/src/lib/elc_scrolled_entry.c index 69e2042..da64081 100644 --- a/src/lib/elc_scrolled_entry.c +++ b/src/lib/elc_scrolled_entry.c @@ -431,7 +431,7 @@ elm_scrolled_entry_icon_set(Evas_Object *obj, Evas_Object *icon) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *edje; - if (!wd || !icon) return; + if ((!wd) || (!icon)) return; if (wd->icon == icon) return; if (wd->icon) evas_object_del(wd->icon); wd->icon = icon; @@ -507,7 +507,7 @@ elm_scrolled_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->icon) return; + if ((!wd) || (!wd->icon)) return; if (setting) evas_object_hide(wd->icon); else @@ -535,7 +535,7 @@ elm_scrolled_entry_end_set(Evas_Object *obj, Evas_Object *end) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Evas_Object *edje; - if (!wd || !end) return; + if ((!wd) || (!end)) return; if (wd->end == end) return; if (wd->end) evas_object_del(wd->end); wd->end = end; @@ -611,7 +611,7 @@ elm_scrolled_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->end) return; + if ((!wd) || (!wd->end)) return; if (setting) evas_object_hide(wd->end); else diff --git a/src/lib/elm_box.c b/src/lib/elm_box.c index 008d8e4..7af3f03 100644 --- a/src/lib/elm_box.c +++ b/src/lib/elm_box.c @@ -745,9 +745,9 @@ elm_box_transition_free(void *data) { Transition_Animation_Data *tad; Elm_Box_Transition *box_data = data; - if (box_data->start.free_data && box_data->start.data) + if ((box_data->start.free_data) && (box_data->start.data)) box_data->start.free_data(box_data->start.data); - if (box_data->end.free_data && box_data->end.data) + if ((box_data->end.free_data) && (box_data->end.data)) box_data->end.free_data(box_data->end.data); EINA_LIST_FREE(box_data->objs, tad) free(tad); diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c index 7a7e858..04a84ee 100644 --- a/src/lib/elm_button.c +++ b/src/lib/elm_button.c @@ -56,7 +56,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty if (!wd) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (strcmp(ev->keyname, "Return") && strcmp(ev->keyname, "space")) + if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space"))) return EINA_FALSE; _activate(obj); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; @@ -113,7 +113,7 @@ _theme_hook(Evas_Object *obj) edje_object_message_signal_process(wd->btn); edje_object_scale_set(wd->btn, elm_widget_scale_get(obj) * _elm_config->scale); str = edje_object_data_get(wd->btn, "focus_highlight"); - if (str && !strcmp(str, "on")) + if ((str) && (!strcmp(str, "on"))) elm_widget_highlight_in_theme_set(obj, EINA_TRUE); else elm_widget_highlight_in_theme_set(obj, EINA_FALSE); @@ -259,7 +259,7 @@ _signal_pressed(void *data, Evas_Object *obj __UNUSED__, const char *emission __ Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - if (wd->autorepeat && !wd->repeating) + if ((wd->autorepeat) && (!wd->repeating)) { if (wd->ar_threshold <= 0.0) _autorepeat_initial_send(data); /* call immediately */ @@ -507,5 +507,5 @@ elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t) if (wd->ar_interval == t) return; wd->ar_interval = t; - if (wd->repeating && wd->timer) ecore_timer_interval_set(wd->timer, t); + if ((wd->repeating) && (wd->timer)) ecore_timer_interval_set(wd->timer, t); } diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c index f90fc81..85be984 100644 --- a/src/lib/elm_calendar.c +++ b/src/lib/elm_calendar.c @@ -107,7 +107,7 @@ _maxdays_get(struct tm *time) month = time->tm_mon; year = time->tm_year + 1900; - return _days_in_month[(!(year % 4) && (!(year % 400) || (year % 100)))] + return _days_in_month[((!(year % 4)) && ((!(year % 400)) || (year % 100)))] [month]; } @@ -224,7 +224,7 @@ _populate(Evas_Object *obj) wd->selected_it = i; } - if (day && (day <= maxdays)) + if ((day) && (day <= maxdays)) snprintf(day_s, sizeof(day_s), "%d", day++); else day_s[0] = 0; diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index 0a3a81a..36b93cf 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -58,7 +58,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty Evas_Event_Key_Down *ev = event_info; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (strcmp(ev->keyname, "Return") && strcmp(ev->keyname, "space")) + if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space"))) return EINA_FALSE; _activate(obj); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c index 8db6864..d679584 100644 --- a/src/lib/elm_clock.c +++ b/src/lib/elm_clock.c @@ -363,7 +363,7 @@ _time_update(Evas_Object *obj) _elm_theme_object_set(obj, wd->digit[i], "clock", "flipdigit", style); edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) * _elm_config->scale); - if (wd->edit && (wd->digedit & (1 << i))) + if ((wd->edit) && (wd->digedit & (1 << i))) edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm"); edje_object_signal_callback_add(wd->digit[i], "elm,action,up,start", "", _signal_clock_val_up_start, obj); @@ -636,7 +636,7 @@ elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit) wd->edit = edit; if (!edit) _timediff_set(wd); - if (edit && (wd->digedit == ELM_CLOCK_NONE)) + if ((edit) && (wd->digedit == ELM_CLOCK_NONE)) elm_clock_digit_edit_set(obj, ELM_CLOCK_ALL); else _time_update(obj); diff --git a/src/lib/elm_cnp_helper.c b/src/lib/elm_cnp_helper.c index 7ba7397..7592788 100644 --- a/src/lib/elm_cnp_helper.c +++ b/src/lib/elm_cnp_helper.c @@ -358,7 +358,7 @@ elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, if ((unsigned int)selection >= (unsigned int)ELM_SEL_MAX) return EINA_FALSE; if (!_elm_cnp_init_count) _elm_cnp_init(); - if (!selbuf && format != ELM_SEL_FORMAT_IMAGE) + if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE)) return elm_selection_clear(selection, widget); sel = selections + selection; @@ -388,7 +388,7 @@ elm_selection_clear(Elm_Sel_Type selection, Evas_Object *widget) sel = selections + selection; /* No longer this selection: Consider it gone! */ - if (!sel->active || sel->widget != widget) return EINA_TRUE; + if ((!sel->active) || (sel->widget != widget)) return EINA_TRUE; sel->active = 0; sel->widget = NULL; @@ -597,7 +597,7 @@ notify_handler_targets(struct _elm_cnp_selection *sel, if (!(atoms[j].formats & sel->requestformat)) continue; for (i = 0 ; i < targets->data.length ; i ++) { - if (atoms[j].atom == atomlist[i] && atoms[j].notify) + if ((atoms[j].atom == atomlist[i]) && (atoms[j].notify)) { cnp_debug("Atom %s matches\n",atoms[j].name); goto done; @@ -633,7 +633,7 @@ response_handler_targets(struct _elm_cnp_selection *sel, if (!(atoms[j].formats & sel->requestformat)) continue; for (i = 0 ; i < targets->data.length ; i ++) { - if (atoms[j].atom == atomlist[i] && atoms[j].response){ + if ((atoms[j].atom == atomlist[i]) && (atoms[j].response)){ /* Found a match: Use it */ goto found; } @@ -714,7 +714,7 @@ notify_handler_uri(struct _elm_cnp_selection *sel, else p += strlen("file://"); - if (!strstr(p,".png") && !strstr(p,".jpg")) + if ((!strstr(p,".png")) && (!strstr(p,".jpg"))) { cnp_debug("No png, ignoring\n"); if (savedtypes.textreq) savedtypes.textreq = 0; @@ -885,8 +885,8 @@ text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, { *data_ret = remove_tags(sel->selbuf, size_ret); } - else if (sel->format == ELM_SEL_FORMAT_TEXT || - sel->format == ELM_SEL_FORMAT_HTML) + else if ((sel->format == ELM_SEL_FORMAT_TEXT) || + (sel->format == ELM_SEL_FORMAT_HTML)) { *data_ret = strdup(sel->selbuf); *size_ret = strlen(sel->selbuf); @@ -1024,7 +1024,7 @@ pasteimage_provider_set(Evas_Object *entry) if (!entry) return false; type = elm_widget_type_get(entry); printf("type is %s\n",type); - if (!type || strcmp(type,"entry") != 0) return false; + if ((!type) || (strcmp(type,"entry") != 0)) return false; v = evas_object_data_get(entry, PROVIDER_SET); if (!v) @@ -1082,13 +1082,13 @@ remove_tags(const char *p, int *len){ while (*p) { - if (*p != '<' && *p != '&'){ + if ((*p != '<') && (*p != '&')){ *q ++ = *p ++; } else if (*p == '<') { - if (p[1] == 'b' && p[2] == 'r' && - (p[3] == ' ' || p[3] == '/' || p[3] == '>')) + if ((p[1] == 'b') && (p[2] == 'r') && + ((p[3] == ' ') || (p[3] == '/') || (p[3] == '>'))) *q++ = '\n'; - while (*p && *p != '>') p ++; + while ((*p) && (*p != '>')) p ++; p ++; } else if (*p == '&') { p ++; @@ -1121,7 +1121,7 @@ mark_up(const char *start, int inlen, int *lenp){ if (inlen >= 0) endp = start + inlen; /* First pass: Count characters */ - for (l = 0, p = start ; (!endp || (p < endp)) && *p ; p ++) + for (l = 0, p = start ; ((!endp) || (p < endp)) && (*p) ; p ++) { for (i = 0 ; i < N_ESCAPES ; i ++) { @@ -1167,7 +1167,7 @@ _dnd_enter(void *data __UNUSED__, int etype __UNUSED__, void *ev) int i; /* Skip it */ - if (!enter || !enter->num_types || !enter->types) return EINA_TRUE; + if ((!enter) || (!enter->num_types) || (!enter->types)) return EINA_TRUE; cnp_debug("Types\n"); savedtypes.ntypes = enter->num_types; @@ -1225,7 +1225,7 @@ _dnd_drop(void *data __UNUSED__, int etype __UNUSED__, void *ev) break; } /* didn't find a window */ - if (l == NULL) + if (!l) return true; @@ -1243,8 +1243,8 @@ _dnd_drop(void *data __UNUSED__, int etype __UNUSED__, void *ev) { dropable = l->data; evas_object_geometry_get(dropable->obj, &x, &y, &w, &h); - if (savedtypes.x >= x && savedtypes.y >= y && - savedtypes.x < x + w && savedtypes.y < y + h) + if ((savedtypes.x >= x) && (savedtypes.y >= y) && + (savedtypes.x < x + w) && (savedtypes.y < y + h)) break; /* found! */ } @@ -1390,7 +1390,7 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Type format, if (!_elm_cnp_init_count) _elm_cnp_init(); /* Is this the first? */ - first = (drops == NULL) ? 1 : 0; + first = (!drops) ? 1 : 0; drop = calloc(1,sizeof(struct dropable)); if (!drop) return false; @@ -1459,7 +1459,7 @@ elm_drop_target_del(Evas_Object *obj) (Evas_Object_Event_Cb)elm_drop_target_del); free(drop); /* If still drops there: All fine.. continue */ - if (drops != NULL) return true; + if (drops) return true; cnp_debug("Disabling DND\n"); xwin = (Ecore_X_Window)ecore_evas_window_get(ecore_evas_ecore_evas_get( diff --git a/src/lib/elm_diskpicker.c b/src/lib/elm_diskpicker.c index 6cae45d..6e86ee7 100644 --- a/src/lib/elm_diskpicker.c +++ b/src/lib/elm_diskpicker.c @@ -315,18 +315,18 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty return EINA_TRUE; } - if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left") || - !strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) + if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")) || + (!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) { l = wd->selected_item->node->prev; - if (!l && wd->round) + if ((!l) && (wd->round)) l = eina_list_last(wd->items); } - else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right") || - !strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) + else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")) || + (!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) { l = wd->selected_item->node->next; - if (!l && wd->round) + if ((!l) && (wd->round)) l = wd->items; } else if (!strcmp(ev->keyname, "Home")) @@ -356,12 +356,12 @@ _check_letter(const char *str, int length) if (code == '\0') return length; // null string - else if ((code >= 65 && code <= 90) || (code >= 97 && code <= 122)) + else if (((code >= 65) && (code <= 90)) || ((code >= 97) && (code <= 122))) return length; // alphabet - else if (48 <= code && code < 58) + else if ((48 <= code) && (code < 58)) return length; // number - else if ((33 <= code && code < 47) || (58 <= code && code < 64) - || (91 <= code && code < 96) || (123 <= code && code < 126)) + else if (((33 <= code) && (code < 47)) || ((58 <= code) && (code < 64)) + || ((91 <= code) && (code < 96)) || ((123 <= code) && (code < 126))) return length; // special letter return length - 1; } @@ -392,7 +392,7 @@ _check_string(void *data) int len; evas_object_geometry_get(it->base.view, &x, NULL, &w, NULL); /* item not visible */ - if (x + w <= ox || x >= ox + ow) + if ((x + w <= ox) || (x >= ox + ow)) continue; len = eina_stringshare_strlen(it->label); @@ -748,7 +748,7 @@ elm_diskpicker_round_set(Evas_Object * obj, Eina_Bool round) evas_object_hide(wd->left_blank); elm_box_unpack(wd->main_box, wd->right_blank); evas_object_hide(wd->right_blank); - if (wd->items == NULL) + if (!wd->items) return; _round_items_add(wd); @@ -854,7 +854,7 @@ elm_diskpicker_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy * ELM_CHECK_WIDTYPE(obj, widtype); Elm_Smart_Scroller_Policy s_policy_h, s_policy_v; Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->scroller) return; + if ((!wd) || (!wd->scroller)) return; elm_smart_scroller_policy_get(wd->scroller, &s_policy_h, &s_policy_v); *policy_h = (Elm_Scroller_Policy) s_policy_h; *policy_v = (Elm_Scroller_Policy) s_policy_v; diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 94f0779..642cdfc 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -334,7 +334,7 @@ _sizing_eval(Evas_Object *obj) Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Evas_Coord resw, resh; if (!wd) return; - if (wd->linewrap || wd->char_linewrap) + if ((wd->linewrap) || (wd->char_linewrap)) { evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh); if ((resw == wd->lastw) && (!wd->changed)) return; @@ -445,7 +445,7 @@ _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; - if (wd->linewrap || wd->char_linewrap) + if ((wd->linewrap) || (wd->char_linewrap)) { _sizing_eval(data); } @@ -851,7 +851,7 @@ _mkup_to_text(const char *mkup) } esc_start = esc_end = NULL; } - else if (*p == 0 && s) + else if ((*p == 0) && (s)) { ts = malloc(p - s + 1); if (ts) @@ -866,7 +866,7 @@ _mkup_to_text(const char *mkup) } if (*p == '<') { - if (s && !esc_start) + if ((s) && (!esc_start)) { tag_start = p; tag_end = NULL; @@ -891,7 +891,7 @@ _mkup_to_text(const char *mkup) } else if (*p == '&') { - if (s && !tag_start) + if ((s) && (!tag_start)) { esc_start = p; esc_end = NULL; @@ -1229,7 +1229,7 @@ _event_selection_notify(void *data, int type __UNUSED__, void *event) Widget_Data *wd = elm_widget_data_get(data); Ecore_X_Event_Selection_Notify *ev = event; if (!wd) return ECORE_CALLBACK_PASS_ON; - if (!wd->selection_asked && !wd->drag_selection_asked) + if ((!wd->selection_asked) && (!wd->drag_selection_asked)) return ECORE_CALLBACK_PASS_ON; if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) || @@ -2503,7 +2503,7 @@ elm_entry_filter_accept_set(void *data, Evas_Object *entry __UNUSED__, char **te Eina_Bool goes_in; int read_idx, last_read_idx = 0, read_char; - if (!as || (!as->accepted && !as->rejected)) + if ((!as) || ((!as->accepted) && (!as->rejected))) return; if (as->accepted) diff --git a/src/lib/elm_flippicker.c b/src/lib/elm_flippicker.c index 93733f5..a886282 100644 --- a/src/lib/elm_flippicker.c +++ b/src/lib/elm_flippicker.c @@ -277,9 +277,9 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) + if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) is_up = EINA_FALSE; - else if (strcmp(ev->keyname, "Up") && strcmp(ev->keyname, "KP_Up")) + else if ((strcmp(ev->keyname, "Up")) && (strcmp(ev->keyname, "KP_Up"))) return EINA_FALSE; if (wd->spin) ecore_timer_del(wd->spin); @@ -941,7 +941,7 @@ elm_flippicker_item_label_get(Elm_Flippicker_Item *item) Eina_List *l; wd = elm_widget_data_get(item->base.widget); - if (!wd || !wd->items) + if ((!wd) || (!wd->items)) return NULL; EINA_LIST_FOREACH(wd->items, l, _item) @@ -967,11 +967,11 @@ elm_flippicker_item_label_set(Elm_Flippicker_Item *item, const char *label) Widget_Data *wd; Eina_List *l; - if (!item || !label) + if ((!item) || (!label)) return; wd = elm_widget_data_get(item->base.widget); - if (!wd || !wd->items) + if ((!wd) || (!wd->items)) return; l = eina_list_data_find_list(wd->items, item); @@ -1012,7 +1012,7 @@ elm_flippicker_item_prev(Elm_Flippicker_Item *item) Eina_List *l; wd = elm_widget_data_get(item->base.widget); - if (!wd || !wd->items) + if ((!wd) || (!wd->items)) return NULL; EINA_LIST_FOREACH(wd->items, l, _item) @@ -1045,7 +1045,7 @@ elm_flippicker_item_next(Elm_Flippicker_Item *item) Eina_List *l; wd = elm_widget_data_get(item->base.widget); - if (!wd || !wd->items) + if ((!wd) || (!wd->items)) return NULL; EINA_LIST_FOREACH(wd->items, l, _item) diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index f48eef9..e62c5fb 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -262,11 +262,11 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y); elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); - if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")) + if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_left(wd)) - || _item_single_select_left(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_left(wd))) + || (_item_single_select_left(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -274,11 +274,11 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty else x -= step_x; } - else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")) + else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_right(wd)) - || _item_single_select_right(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_right(wd))) + || (_item_single_select_right(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -286,11 +286,11 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty else x += step_x; } - else if (!strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) + else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_up(wd)) - || _item_single_select_up(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_up(wd))) + || (_item_single_select_up(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -298,11 +298,11 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty else y -= step_y; } - else if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) + else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_down(wd)) - || _item_single_select_down(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_down(wd))) + || (_item_single_select_down(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -397,7 +397,7 @@ _item_multi_select_up(Widget_Data *wd) if (!wd->selected) return EINA_FALSE; - for (i = 0; r && i < wd->nmax; i++) + for (i = 0; (r) && (i < wd->nmax); i++) r &= _item_multi_select_left(wd); return r; @@ -411,7 +411,7 @@ _item_multi_select_down(Widget_Data *wd) if (!wd->selected) return EINA_FALSE; - for (i = 0; r && i < wd->nmax; i++) + for (i = 0; (r) && (i < wd->nmax); i++) r &= _item_multi_select_right(wd); return r; @@ -504,7 +504,7 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) { edje_object_signal_emit(wd->self, "elm,action,focus", "elm"); evas_object_focus_set(wd->self, EINA_TRUE); - if (wd->selected && !wd->last_selected_item) + if ((wd->selected) && (!wd->last_selected_item)) wd->last_selected_item = eina_list_data_get(wd->selected); } else @@ -715,7 +715,7 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * { if (item->want_unrealize) _item_unrealize(item); } - if ((item->disabled) || dragged) return; + if ((item->disabled) || (dragged)) return; if (item->wd->multi) { if (!item->selected) @@ -2115,7 +2115,7 @@ elm_gengrid_item_tooltip_content_cb_set(Elm_Gengrid_Item *item, Elm_Tooltip_Item EAPI void elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *item) { - if (item->base.view && item->tooltip.content_cb) + if ((item->base.view) && (item->tooltip.content_cb)) elm_widget_item_tooltip_unset(item); if (item->tooltip.del_cb) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 98cdbdc..ebc1ddc 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -406,19 +406,19 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty elm_smart_scroller_page_size_get(wd->scr, &page_x, &page_y); elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); - if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")) + if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) { x -= step_x; } - else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")) + else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) { x += step_x; } - else if (!strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) + else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_up(wd)) - || _item_single_select_up(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_up(wd))) + || (_item_single_select_up(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -426,11 +426,11 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty else y -= step_y; } - else if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) + else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_down(wd)) - || _item_single_select_down(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_down(wd))) + || (_item_single_select_down(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -466,8 +466,8 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty else y += page_y; } - else if((!strcmp(ev->keyname, "Return") || !strcmp(ev->keyname, "space")) - && !wd->multi && wd->selected) + else if(((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "space"))) + && (!wd->multi) && (wd->selected)) { Elm_Genlist_Item *it = elm_genlist_selected_item_get(obj); elm_genlist_item_expanded_set(it, @@ -565,7 +565,7 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) { edje_object_signal_emit(wd->obj, "elm,action,focus", "elm"); evas_object_focus_set(wd->obj, EINA_TRUE); - if (wd->selected && !wd->last_selected_item) + if ((wd->selected) && (!wd->last_selected_item)) wd->last_selected_item = eina_list_data_get(wd->selected); } else @@ -1174,7 +1174,7 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) edje_object_signal_emit(it->base.view, "elm,state,expanded", "elm"); } - if (calc && it->wd->homogeneous && it->wd->item_width) + if ((calc) && (it->wd->homogeneous) && (it->wd->item_width)) { /* homogenous genlist shortcut */ if (!it->mincalcd) @@ -1257,7 +1257,7 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) it->h = it->minh = mh; it->mincalcd = EINA_TRUE; - if (in == 0 && it->wd->homogeneous) + if ((in == 0) && (it->wd->homogeneous)) { it->wd->item_width = mw; it->wd->item_height = mh; @@ -1524,7 +1524,7 @@ _calc_job(void *data) itb->h = itb->minh; y += itb->h; in += itb->count; - if (showme && wd->show_item) + if ((showme) && (wd->show_item)) { wd->show_item->showme = 0; if (wd->bring_in) @@ -3363,7 +3363,7 @@ elm_genlist_item_tooltip_content_cb_set(Elm_Genlist_Item *item, Elm_Tooltip_Item EAPI void elm_genlist_item_tooltip_unset(Elm_Genlist_Item *item) { - if (item->base.view && item->tooltip.content_cb) + if ((item->base.view) && (item->tooltip.content_cb)) elm_widget_item_tooltip_unset(item); if (item->tooltip.del_cb) diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c index d7252f2..d661d27 100644 --- a/src/lib/elm_icon.c +++ b/src/lib/elm_icon.c @@ -73,7 +73,7 @@ _sizing_eval(Evas_Object *obj) _els_smart_icon_size_get(wd->img, &w, &h); #ifdef ELM_EFREET - if (wd->freedesktop.use && !((w - wd->freedesktop.requested_size) % 16)) + if ((wd->freedesktop.use) && (!((w - wd->freedesktop.requested_size) % 16))) { /* This icon has been set to a freedesktop icon, and the requested appears to have a different size than the requested size, so try to @@ -215,7 +215,7 @@ _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int s static const char *themes[] = { "default", "highcolor", "hicolor", "gnome", "Human", "oxygen", NULL }; - for (itr = themes; !path && *itr; itr++) + for (itr = themes; (!path) && (*itr); itr++) path = efreet_icon_path_find(*itr, name, size); } wd->freedesktop.use = !!path; diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c index eeda5b4..2c2455d 100644 --- a/src/lib/elm_label.c +++ b/src/lib/elm_label.c @@ -114,7 +114,7 @@ _sizing_eval(Evas_Object *obj) maxh = minh; evas_object_size_hint_max_set(obj, maxw, maxh); - if (wd->ellipsis && _is_width_over(obj) == 1) + if ((wd->ellipsis) && (_is_width_over(obj) == 1)) _ellipsis_label_to_width(obj); } } @@ -220,7 +220,7 @@ _strbuf_key_value_replace(Eina_Strbuf *srcbuf, const char *key, const char *valu break; } while (strlen(srcstring) > 1); - if (starttag && endtag && tagtxtlen > key_len) + if ((starttag) && (endtag) && (tagtxtlen > key_len)) { repbuf = eina_strbuf_new(); diffbuf = eina_strbuf_new(); @@ -316,9 +316,9 @@ _is_width_over(Evas_Object *obj) evas_object_geometry_get (obj, &vx,&vy,&vw,&vh); - if (x >= 0 && y >= 0) return 0; + if ((x >= 0) && (y >= 0)) return 0; - if (ellen < wd->wrap_w && w > wd->wrap_w) return 1; + if ((ellen < wd->wrap_w) && (w > wd->wrap_w)) return 1; return 0; } @@ -344,7 +344,7 @@ _ellipsis_label_to_width(Evas_Object *obj) deffont = edje_object_data_get(wd->lbl, "default_font_size"); if (deffont) cur_fontsize = atoi(deffont); else cur_fontsize = 1; - if (minfontsize == maxfontsize || cur_fontsize == 1) return; // theme is not ready for ellipsis + if ((minfontsize == maxfontsize) || (cur_fontsize == 1)) return; // theme is not ready for ellipsis if (eina_stringshare_strlen(wd->label) <= 0) return; if (_get_value_in_key_string(wd->label, "font_size", &kvalue) == 0) diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index 6cfcc03..99c28ed 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -145,19 +145,19 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); /* TODO: fix logic for horizontal mode */ - if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")) + if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) { x -= step_x; } - else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")) + else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) { x += step_x; } - else if (!strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) + else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_up(wd)) - || _item_single_select_up(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_up(wd))) + || (_item_single_select_up(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -165,11 +165,11 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty else y -= step_y; } - else if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) + else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) { - if ((evas_key_modifier_is_set(ev->modifiers, "Shift") && - _item_multi_select_down(wd)) - || _item_single_select_down(wd)) + if (((evas_key_modifier_is_set(ev->modifiers, "Shift")) && + (_item_multi_select_down(wd))) + || (_item_single_select_down(wd))) { ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; @@ -409,9 +409,9 @@ _sizing_eval(Evas_Object *obj) if (wd->scr_minh) h = vmh + minh; evas_object_size_hint_max_get(obj, &maxw, &maxh); - if (maxw > 0 && w > maxw) + if ((maxw > 0) && (w > maxw)) w = maxw; - if (maxh > 0 && h > maxh) + if ((maxh > 0) && (h > maxh)) h = maxh; evas_object_size_hint_min_set(obj, w, h); @@ -459,7 +459,7 @@ _theme_hook(Evas_Object *obj) // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); edj = elm_smart_scroller_edje_object_get(wd->scr); str = edje_object_data_get(edj, "focus_highlight"); - if (str && !strcmp(str, "on")) + if ((str) && (!strcmp(str, "on"))) elm_widget_highlight_in_theme_set(obj, EINA_TRUE); else elm_widget_highlight_in_theme_set(obj, EINA_FALSE); @@ -483,7 +483,7 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj) edje_object_signal_emit(wd->self, "elm,action,focus", "elm"); evas_object_focus_set(wd->self, EINA_TRUE); - if (wd->selected && !wd->last_selected_item) + if ((wd->selected) && (!wd->last_selected_item)) wd->last_selected_item = eina_list_data_get(wd->selected); } else @@ -1858,7 +1858,7 @@ elm_list_item_icon_set(Elm_List_Item *it, Evas_Object *icon) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (it->icon == icon) return; - if (it->dummy_icon && !icon) return; + if ((it->dummy_icon) && (!icon)) return; if (it->dummy_icon) { evas_object_del(it->icon); @@ -1913,7 +1913,7 @@ elm_list_item_end_set(Elm_List_Item *it, Evas_Object *end) { ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); if (it->end == end) return; - if (it->dummy_end && !end) return; + if ((it->dummy_end) && (!end)) return; if (it->dummy_end) { evas_object_del(it->end); @@ -2271,7 +2271,7 @@ elm_list_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Smart_Scroller_Policy s_policy_h, s_policy_v; - if (!wd || !wd->scr) return; + if ((!wd) || (!wd->scr)) return; elm_smart_scroller_policy_get(wd->scr, &s_policy_h, &s_policy_v); *policy_h = (Elm_Scroller_Policy) s_policy_h; *policy_v = (Elm_Scroller_Policy) s_policy_v; diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c index af93f7b..cf9addd 100644 --- a/src/lib/elm_main.c +++ b/src/lib/elm_main.c @@ -1417,7 +1417,7 @@ elm_object_focus_allow_set(Evas_Object *obj, Eina_Bool enable) EAPI Eina_Bool elm_object_focus_allow_get(const Evas_Object *obj) { - return elm_widget_can_focus_get(obj) || elm_widget_child_can_focus_get(obj); + return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj)); } /** diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index 19e7f91..57f8dce 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -323,7 +323,7 @@ rect_place(Evas_Object *obj, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_C gw = wd->size.w; gh = wd->size.h; - if (ww == gw && hh == gh) return; + if ((ww == gw) && (hh == gh)) return; if (ow > gw) ax = (ow - gw) / 2; if (oh > gh) ay = (oh - gh) / 2; @@ -374,8 +374,8 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord } wd->marker_zoom = wd->zoom; - if (wd->paused_markers - && (wd->size.nw != wd->size.w || wd->size.nh != wd->size.h) ) + if ((wd->paused_markers) + && ((wd->size.nw != wd->size.w) || (wd->size.nh != wd->size.h)) ) return; g_xx = wd->pan_x / wd->tsize; @@ -391,7 +391,7 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord EINA_LIST_FREE(wd->cells_displayed, cell) { eina_matrixsparse_cell_position_get(cell, (unsigned long *)&y, (unsigned long *)&x); - if (y < g_yy || y > g_yy + g_hh || x < g_xx || x > g_xx + g_ww) + if ((y < g_yy) || (y > g_yy + g_hh) || (x < g_xx) || (x > g_xx + g_ww)) { EINA_LIST_FOREACH(eina_matrixsparse_cell_data_get(cell), l, group) { @@ -442,9 +442,9 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord hh = (((long long)gh * (ty + hh)) / g->h) - yy; } - if (!group->clas->hide - && xx-px+ax+ox >= ox && xx-px+ax+ox<= ox+ow - && yy-py+ay+oy >= oy && yy-py+ay+oy<= oy+oh) + if ((!group->clas->hide) + && (xx-px+ax+ox >= ox) && (xx-px+ax+ox<= ox+ow) + && (yy-py+ay+oy >= oy) && (yy-py+ay+oy<= oy+oh)) { if (!group->obj) _group_object_create(group); @@ -462,7 +462,7 @@ marker_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord evas_object_move(group->obj, xx - px + ax + ox - ww/2, yy - py + ay + oy - hh/2); - if (!wd->paused_markers || group->update_resize) + if ((!wd->paused_markers) || (group->update_resize)) { group->update_resize = EINA_FALSE; evas_object_resize(group->obj, ww, hh); @@ -625,7 +625,7 @@ _tile_downloaded(void *data, const char *file __UNUSED__, int status) gi->job = NULL; DBG("DOWNLOAD done %s", gi->file); - if (gi->want && !status) _tile_update(gi); + if ((gi->want) && (!status)) _tile_update(gi); if (status) { @@ -810,7 +810,7 @@ grid_load(Evas_Object *obj, Grid *g) eina_matrixsparse_data_idx_set(g->grid, y, x, gi); } - if (!gi->have && !gi->download) + if ((!gi->have) && (!gi->download)) { char buf[PATH_MAX], buf2[PATH_MAX]; char *source; @@ -827,7 +827,7 @@ grid_load(Evas_Object *obj, Grid *g) eina_stringshare_replace(&gi->file, buf2); - if (ecore_file_exists(buf2) || g == eina_list_data_get(wd->grids)) + if ((ecore_file_exists(buf2)) || (g == eina_list_data_get(wd->grids))) { gi->download = EINA_TRUE; wd->preload_num++; @@ -1382,7 +1382,7 @@ _group_object_create(Marker_Group *group) Evas_Object *icon = NULL; if (group->obj) return; - if (!group->clas->priv.objs_notused || eina_list_count(group->markers) == 1) + if ((!group->clas->priv.objs_notused) || (eina_list_count(group->markers) == 1)) { //set icon and style if (eina_list_count(group->markers) == 1) @@ -1545,7 +1545,7 @@ _group_bubble_content_update(Marker_Group *group) EINA_LIST_FOREACH(group->markers, l, marker) { if (i >= group->wd->markers_max_num) break; - if (!marker->content && marker->clas->func.get) + if ((!marker->content) && (marker->clas->func.get)) marker->content = marker->clas->func.get(group->wd->obj, marker, marker->data); else if (marker->content) elm_box_unpack(group->bx, marker->content); @@ -1567,7 +1567,7 @@ _group_bubble_content_free(Marker_Group *group) if (!group->sc) return; EINA_LIST_FOREACH(group->markers, l, marker) { - if (marker->content && marker->clas->func.del) + if ((marker->content) && (marker->clas->func.del)) marker->clas->func.del(group->wd->obj, marker, marker->data, marker->content); else if (marker->content) evas_object_del(marker->content); @@ -1597,7 +1597,7 @@ _group_bubble_place(Marker_Group *group) Evas_Coord xx, yy, ww, hh; const char *s; - if (!group->bubble || !group->obj) return; + if ((!group->bubble) || (!group->obj)) return; evas_object_geometry_get(group->obj, &x, &y, &w, NULL); edje_object_size_min_calc(group->bubble, NULL, &hh); @@ -2519,14 +2519,14 @@ elm_map_marker_remove(Elm_Map_Marker *marker) if (marker->groups[i]->h > marker->groups[i]->clas->priv.edje_max_h) marker->groups[i]->h = marker->groups[i]->clas->priv.edje_max_h; } - if (marker->groups[i]->obj && eina_list_count(marker->groups[i]->markers) == 1) + if ((marker->groups[i]->obj) && (eina_list_count(marker->groups[i]->markers) == 1)) { _group_object_free(marker->groups[i]); _group_object_create(marker->groups[i]); } } - if (marker->content && marker->clas->func.del) + if ((marker->content) && (marker->clas->func.del)) marker->clas->func.del(marker->wd->obj, marker, marker->data, marker->content); else if (marker->content) evas_object_del(marker->content); @@ -2597,16 +2597,16 @@ elm_map_markers_list_show(Eina_List *markers) { wd = marker->wd; - if (!m_min_lon || marker->longitude < m_min_lon->longitude) + if ((!m_min_lon) || (marker->longitude < m_min_lon->longitude)) m_min_lon = marker; - if (!m_max_lon || marker->longitude > m_max_lon->longitude) + if ((!m_max_lon) || (marker->longitude > m_max_lon->longitude)) m_max_lon = marker; - if (!m_min_lat || marker->latitude > m_min_lat->latitude) + if ((!m_min_lat) || (marker->latitude > m_min_lat->latitude)) m_min_lat = marker; - if (!m_max_lat || marker->latitude < m_max_lat->latitude) + if ((!m_max_lat) || (marker->latitude < m_max_lat->latitude)) m_max_lat = marker; } @@ -2619,10 +2619,10 @@ elm_map_markers_list_show(Eina_List *markers) Evas_Coord size = pow(2.0, zoom)*wd->tsize; elm_map_utils_convert_geo_into_coord(lon, lat, size, &xc, &yc); - if (m_min_lon->x[zoom] - wd->marker_max_w >= xc-rw/2 - && m_min_lat->y[zoom] - wd->marker_max_h >= yc-rh/2 - && m_max_lon->x[zoom] + wd->marker_max_w <= xc+rw/2 - && m_max_lat->y[zoom] + wd->marker_max_h <= yc+rh/2) + if ((m_min_lon->x[zoom] - wd->marker_max_w >= xc-rw/2) + && (m_min_lat->y[zoom] - wd->marker_max_h >= yc-rh/2) + && (m_max_lon->x[zoom] + wd->marker_max_w <= xc+rw/2) + && (m_max_lat->y[zoom] + wd->marker_max_h <= yc+rh/2)) break; } @@ -2998,7 +2998,7 @@ elm_map_source_get(const Evas_Object *obj) EAPI void elm_map_source_custom_api_set(Elm_Map_Sources source, const char *name, int zoom_min, int zoom_max, ElmMapSourceURLFunc url_cb) { - if (!name || !url_cb) return; + if ((!name) || (!url_cb)) return; map_sources_tab[source].name = name; map_sources_tab[source].zoom_min = zoom_min; map_sources_tab[source].zoom_max = zoom_max; diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c index cf3ad62..0cb72d1 100644 --- a/src/lib/elm_menu.c +++ b/src/lib/elm_menu.c @@ -662,10 +662,10 @@ elm_menu_item_icon_set(Elm_Menu_Item *item, const char *icon) { char icon_tmp[512]; if (!item) return; - if (!icon || !*icon) return; - if (item->icon_str && !strcmp(item->icon_str, icon)) return; - if (snprintf(icon_tmp, sizeof(icon_tmp), "menu/%s", icon) > 0 && - elm_icon_standard_set(item->icon, icon_tmp)) + if ((!icon) || (!*icon)) return; + if ((item->icon_str) && (!strcmp(item->icon_str, icon))) return; + if ((snprintf(icon_tmp, sizeof(icon_tmp), "menu/%s", icon) > 0) && + (elm_icon_standard_set(item->icon, icon_tmp))) { eina_stringshare_replace(&item->icon_str, icon); edje_object_signal_emit(item->base.view, "elm,state,icon,visible", "elm"); diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index 70d778d..f793339 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -261,7 +261,7 @@ _timer_init(Evas_Object *obj, Widget_Data *wd) ecore_timer_del(wd->timer); wd->timer = NULL; } - if (evas_object_visible_get(obj) && (wd->timeout > 0.0)) + if ((evas_object_visible_get(obj)) && (wd->timeout > 0.0)) wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj); } diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index 8c8b95b..37ff0be 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -58,7 +58,7 @@ _theme_hook(Evas_Object *obj) // edje_object_scale_set(wd->scr, scale); edj = elm_smart_scroller_edje_object_get(wd->scr); str = edje_object_data_get(edj, "focus_highlight"); - if (str && !strcmp(str, "on")) + if ((str) && (!strcmp(str, "on"))) elm_widget_highlight_in_theme_set(obj, EINA_TRUE); else elm_widget_highlight_in_theme_set(obj, EINA_FALSE); @@ -213,7 +213,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; - if (strcmp(ev->keyname, "Return") && strcmp(ev->keyname, "space")) + if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space"))) return EINA_FALSE; _toggle_panel(obj, NULL, "elm,action,panel,toggle", "*"); diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c index 9e253c4..071d481 100644 --- a/src/lib/elm_panes.c +++ b/src/lib/elm_panes.c @@ -79,7 +79,7 @@ _elm_panes_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas double w, h; edje_object_part_drag_value_get(wd->panes, "elm.bar", &w, &h); - if ((wd->horizontal && ( h == 0.0 )) || ((!wd->horizontal) && ( w == 0.0 ))) + if (((wd->horizontal) && ( h == 0.0 )) || ((!wd->horizontal) && ( w == 0.0 ))) return elm_widget_focus_next_get(wd->contents.right, dir, next); Evas_Object *chain[2]; diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c index a339a83..c36ec0e 100644 --- a/src/lib/elm_photo.c +++ b/src/lib/elm_photo.c @@ -180,7 +180,7 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *eve { Widget_Data *wd = elm_widget_data_get(data); - if (wd && wd->longtimer) + if ((wd) && (wd->longtimer)) { ecore_timer_del(wd->longtimer); wd->longtimer = NULL; diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c index ac0ef12..a04101f 100644 --- a/src/lib/elm_progressbar.c +++ b/src/lib/elm_progressbar.c @@ -89,7 +89,7 @@ _theme_hook(Evas_Object *obj) if (wd->pulse_state) edje_object_signal_emit(wd->progressbar, "elm,state,pulse,start", "elm"); - if (wd->units && !wd->pulse) + if ((wd->units) && (!wd->pulse)) edje_object_signal_emit(wd->progressbar, "elm,state,units,visible", "elm"); if (wd->horizontal) @@ -279,7 +279,7 @@ elm_progressbar_pulse(Evas_Object *obj, Eina_Bool state) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; state = !!state; - if (!wd->pulse && wd->pulse_state == state) return; + if ((!wd->pulse) && (wd->pulse_state == state)) return; wd->pulse_state = state; if (wd->pulse_state) edje_object_signal_emit(wd->progressbar, "elm,state,pulse,start", "elm"); diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c index 49b05a5..e1781ed 100644 --- a/src/lib/elm_radio.c +++ b/src/lib/elm_radio.c @@ -78,7 +78,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty Evas_Event_Key_Down *ev = event_info; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (strcmp(ev->keyname, "Return") && strcmp(ev->keyname, "space")) + if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space"))) return EINA_FALSE; _activate(obj); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; @@ -227,7 +227,7 @@ _state_set_all(Widget_Data *wd) } else _state_set(child, 0); } - if (disabled && selected) _state_set(selected, 1); + if ((disabled) && (selected)) _state_set(selected, 1); } static void diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c index 1aa8863..491672e 100644 --- a/src/lib/elm_scroller.c +++ b/src/lib/elm_scroller.c @@ -103,19 +103,19 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty elm_smart_scroller_child_viewport_size_get(wd->scr, &v_w, &v_h); elm_scroller_child_size_get(obj, &max_x, &max_y); - if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")) + if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) { x -= step_x; } - else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")) + else if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) { x += step_x; } - else if (!strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) + else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) { y -= step_y; } - else if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) + else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) { y += step_y; } @@ -189,7 +189,7 @@ _theme_hook(Evas_Object *obj) // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); edj = elm_smart_scroller_edje_object_get(wd->scr); str = edje_object_data_get(edj, "focus_highlight"); - if (str && !strcmp(str, "on")) + if ((str) && (!strcmp(str, "on"))) elm_widget_highlight_in_theme_set(obj, EINA_TRUE); else elm_widget_highlight_in_theme_set(obj, EINA_FALSE); @@ -209,7 +209,7 @@ _elm_scroller_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, E cur = wd->content; /* Try Focus cycle in subitem */ - if (elm_widget_can_focus_get(cur) || elm_widget_child_can_focus_get(cur)) + if ((elm_widget_can_focus_get(cur)) || (elm_widget_child_can_focus_get(cur))) return elm_widget_focus_next_get(cur, dir, next); /* Return */ @@ -648,7 +648,7 @@ elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coor { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->scr) return; + if ((!wd) || (!wd->scr)) return; elm_smart_scroller_child_region_show(wd->scr, x, y, w, h); } @@ -678,7 +678,7 @@ elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scro ELM_SMART_SCROLLER_POLICY_ON, ELM_SMART_SCROLLER_POLICY_OFF }; - if (!wd || !wd->scr) return; + if ((!wd) || (!wd->scr)) return; if ((policy_h >= 3) || (policy_v >= 3)) return; elm_smart_scroller_policy_set(wd->scr, map[policy_h], map[policy_v]); } @@ -689,7 +689,7 @@ elm_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, E ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); Elm_Smart_Scroller_Policy s_policy_h, s_policy_v; - if (!wd || !wd->scr) return; + if ((!wd) || (!wd->scr)) return; elm_smart_scroller_policy_get(wd->scr, &s_policy_h, &s_policy_v); *policy_h = (Elm_Scroller_Policy) s_policy_h; *policy_v = (Elm_Scroller_Policy) s_policy_v; @@ -715,7 +715,7 @@ elm_scroller_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Ev { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->scr) return; + if ((!wd) || (!wd->scr)) return; if ((x) && (y)) elm_smart_scroller_child_pos_get(wd->scr, x, y); if ((w) && (h)) elm_smart_scroller_child_viewport_size_get(wd->scr, w, h); } @@ -761,7 +761,7 @@ elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->scr) return; + if ((!wd) || (!wd->scr)) return; elm_smart_scroller_bounce_allow_set(wd->scr, h_bounce, v_bounce); } @@ -848,6 +848,6 @@ elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_ { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - if (!wd || !wd->scr) return; + if ((!wd) || (!wd->scr)) return; elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h); } diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index 7a969f9..a178a30 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -97,30 +97,30 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty if (!wd) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (!strcmp(ev->keyname, "Left") - || !strcmp(ev->keyname, "KP_Left")) + if ((!strcmp(ev->keyname, "Left")) + || (!strcmp(ev->keyname, "KP_Left"))) { if (!wd->horizontal) return EINA_FALSE; _drag_up(obj, NULL, NULL, NULL); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; } - else if (!strcmp(ev->keyname, "Right") - || !strcmp(ev->keyname, "KP_Right")) + else if ((!strcmp(ev->keyname, "Right")) + || (!strcmp(ev->keyname, "KP_Right"))) { if (!wd->horizontal) return EINA_FALSE; _drag_down(obj, NULL, NULL, NULL); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; } - else if (!strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) + else if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up"))) { if (wd->horizontal) return EINA_FALSE; _drag_up(obj, NULL, NULL, NULL); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; } - else if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) + else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down"))) { if (wd->horizontal) return EINA_FALSE; _drag_down(obj, NULL, NULL, NULL); diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c index 29bfd8e..fdf2d82 100644 --- a/src/lib/elm_slideshow.c +++ b/src/lib/elm_slideshow.c @@ -69,19 +69,19 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty if (!wd) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")) + if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))) { elm_slideshow_previous(obj); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; } - if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")) + if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))) { elm_slideshow_next(obj); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; return EINA_TRUE; } - if (!strcmp(ev->keyname, "Return") || !strcmp(ev->keyname, "space")) + if ((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "space"))) { if (wd->timeout) elm_slideshow_timeout_set(obj, 0); @@ -152,7 +152,7 @@ static Elm_Slideshow_Item* _item_prev_get(Elm_Slideshow_Item* item) { Widget_Data *wd = elm_widget_data_get(item->base.widget); Elm_Slideshow_Item* prev = eina_list_data_get(eina_list_prev(item->l)); - if(!prev && wd->loop) + if((!prev) && (wd->loop)) prev = eina_list_data_get(eina_list_last(item->l)); return prev; } @@ -160,7 +160,7 @@ static Elm_Slideshow_Item* _item_next_get(Elm_Slideshow_Item* item) { Widget_Data *wd = elm_widget_data_get(item->base.widget); Elm_Slideshow_Item* next = eina_list_data_get(eina_list_next(item->l)); - if(!next && wd->loop) + if((!next) && (wd->loop)) next = eina_list_data_get(wd->items); return next; } @@ -251,7 +251,7 @@ _end(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, c item = wd->current; - if (!item || !item->base.view) return; + if ((!item) || (!item->base.view)) return; _item_realize(item); edje_object_part_unswallow(NULL, item->base.view); @@ -418,7 +418,7 @@ elm_slideshow_next(Evas_Object *obj) if (wd->current) next = _item_next_get(wd->current); - if (!next || next == wd->current) return; + if ((!next) || (next == wd->current)) return; _end(obj, obj, NULL, NULL); @@ -459,7 +459,7 @@ elm_slideshow_previous(Evas_Object *obj) if (wd->current) prev = _item_prev_get(wd->current); - if (!prev || prev == wd->current) return; + if ((!prev) || (prev == wd->current)) return; _end(obj, obj, NULL, NULL); @@ -717,7 +717,7 @@ elm_slideshow_item_del(Elm_Slideshow_Item *item) wd->items = eina_list_remove_list(wd->items, item->l); wd->items_built = eina_list_remove_list(wd->items_built, item->l_built); - if (item->base.view && item->itc->func.del) + if ((item->base.view) && (item->itc->func.del)) item->itc->func.del((void*)item->base.data, item->base.view); if (item->base.view) evas_object_del(item->base.view); diff --git a/src/lib/elm_theme.c b/src/lib/elm_theme.c index 62e85aa..a24a702 100644 --- a/src/lib/elm_theme.c +++ b/src/lib/elm_theme.c @@ -62,7 +62,7 @@ _elm_theme_theme_element_try(Elm_Theme *th, const char *home, const char *f, con if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) || ((f[0] == '.') && (f[1] == '.') && (f[2] == '/')) || - (isalpha(f[0]) && f[1] == ':')) + ((isalpha(f[0])) && (f[1] == ':'))) return _elm_theme_find_try(th, f, group); else if (((f[0] == '~') && (f[1] == '/'))) { @@ -521,7 +521,7 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path) if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) || ((f[0] == '.') && (f[1] == '.') && (f[2] == '/')) || - (isalpha(f[0]) && f[1] == ':')) + ((isalpha(f[0])) && (f[1] == ':'))) { if (in_search_path) *in_search_path = EINA_FALSE; return strdup(f); diff --git a/src/lib/elm_thumb.c b/src/lib/elm_thumb.c index 047c95e..223c63e 100644 --- a/src/lib/elm_thumb.c +++ b/src/lib/elm_thumb.c @@ -549,7 +549,7 @@ elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key) eina_stringshare_replace(&(wd->thumb.key), NULL); #ifdef HAVE_ELEMENTARY_ETHUMB - if ((file_replaced || key_replaced) && evas_object_visible_get(obj)) + if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj))) _thumb_show(wd); #endif } diff --git a/src/lib/elm_toggle.c b/src/lib/elm_toggle.c index eb0bf3c..55fe1f2 100644 --- a/src/lib/elm_toggle.c +++ b/src/lib/elm_toggle.c @@ -54,7 +54,7 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty if (!wd) return EINA_FALSE; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE; if (elm_widget_disabled_get(obj)) return EINA_FALSE; - if (strcmp(ev->keyname, "Return") && strcmp(ev->keyname, "space")) + if ((strcmp(ev->keyname, "Return")) && (strcmp(ev->keyname, "space"))) return EINA_FALSE; elm_toggle_state_set(obj, !wd->state); evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 02f410b..dc575c7 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -58,10 +58,10 @@ _item_icon_set(Evas_Object *icon_obj, const char *type, const char *icon) { char icon_str[512]; - if (!type || !*type) goto end; - if (!icon || !*icon) return EINA_FALSE; - if (snprintf(icon_str, sizeof(icon_str), "%s%s", type, icon) > 0 - && elm_icon_standard_set(icon_obj, icon_str)) + if ((!type) || (!*type)) goto end; + if ((!icon) || (!*icon)) return EINA_FALSE; + if ((snprintf(icon_str, sizeof(icon_str), "%s%s", type, icon) > 0) + && (elm_icon_standard_set(icon_obj, icon_str))) return EINA_TRUE; end: if (elm_icon_standard_set(icon_obj, icon)) @@ -849,7 +849,7 @@ elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mod if (!wd) return; wd->shrink_mode = shrink_mode; - bounce = _elm_config->thumbscroll_bounce_enable && + bounce = (_elm_config->thumbscroll_bounce_enable) && (shrink_mode == ELM_TOOLBAR_SHRINK_SCROLL); elm_smart_scroller_bounce_allow_set(wd->scr, bounce, EINA_FALSE); diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 29bf7d5..603e8a4 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -110,7 +110,7 @@ static inline Eina_Bool _is_focusable(Evas_Object *obj) { API_ENTRY return EINA_FALSE; - return sd->can_focus || sd->child_can_focus; + return sd->can_focus || (sd->child_can_focus); } static void @@ -225,10 +225,10 @@ _propagate_event(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_i break; } - if (event_flags && ((*event_flags) & EVAS_EVENT_FLAG_ON_HOLD)) + if ((event_flags) && ((*event_flags) & EVAS_EVENT_FLAG_ON_HOLD)) return; - if (sd->event_func && sd->event_func(obj, obj, type, event_info)) + if ((sd->event_func) && (sd->event_func(obj, obj, type, event_info))) return; elm_widget_parent_event_propagate(obj, type, event_info, event_flags); @@ -252,7 +252,7 @@ _parent_focus(Evas_Object *obj) /* we don't want to bump a common widget ancestor's focus_order *twice* while parent focusing */ - if (!ret || !i || i != focus_order) + if (!ret || (!i) || (i != focus_order)) _parent_focus(o); } @@ -560,7 +560,7 @@ elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj) return; elm_widget_sub_object_del(sd2->parent_obj, sobj); sd2->parent_obj = obj; - if (!sd->child_can_focus && _is_focusable(sobj)) + if (!sd->child_can_focus && (_is_focusable(sobj))) sd->child_can_focus = EINA_TRUE; } } @@ -861,7 +861,7 @@ elm_widget_parent_event_propagate(Evas_Object *obj, Evas_Callback_Type type, voi sd = evas_object_smart_data_get(parent); if ((!sd) || (!_elm_widget_is(obj))) return EINA_FALSE; //Not Elm Widget - if (sd->event_func && sd->event_func(parent, obj, type, event_info)) + if (sd->event_func && (sd->event_func(parent, obj, type, event_info))) return EINA_TRUE; parent = sd->parent_obj; } @@ -1067,7 +1067,7 @@ elm_widget_focus_next_get(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_ API_ENTRY return EINA_FALSE; /* Ignore if disabled */ - if ((!evas_object_visible_get(obj)) || elm_widget_disabled_get(obj)) + if ((!evas_object_visible_get(obj)) || (elm_widget_disabled_get(obj))) return EINA_FALSE; /* Try use hook */ @@ -1155,7 +1155,7 @@ elm_widget_focus_list_next_get(const Evas_Object *obj, const Eina_List *items, v *next = tmp; return EINA_TRUE; } - else if (tmp && (!to_focus)) + else if ((tmp) && (!to_focus)) to_focus = tmp; } @@ -2633,7 +2633,7 @@ _sub_obj_tree_dot_dump(const Evas_Object *obj, FILE *output) if (!visible) fprintf(output, ", fontcolor=gray28"); - if (disabled || (!visible)) + if ((disabled) || (!visible)) fprintf(output, ", color=gray"); diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h index 874bbe8..e8a5a4d 100644 --- a/src/lib/elm_widget.h +++ b/src/lib/elm_widget.h @@ -433,7 +433,7 @@ EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out * Cast and ensure the given pointer is an Elm_Widget_Item or return NULL. */ #define ELM_WIDGET_ITEM(item) \ - ((item && EINA_MAGIC_CHECK(item, ELM_WIDGET_ITEM_MAGIC)) ? \ + (((item) && (EINA_MAGIC_CHECK(item, ELM_WIDGET_ITEM_MAGIC))) ? \ ((Elm_Widget_Item *)(item)) : NULL) #define ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, ...) \ diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 0d05e26..9aa58e7 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -802,11 +802,11 @@ _elm_win_focus_highlight_reconfigure(Elm_Win *win) visible_changed = (win->focus_highlight.cur.visible != win->focus_highlight.prev.visible); - if ((target == previous) && !visible_changed && - !win->focus_highlight.geometry_changed) + if ((target == previous) && (!visible_changed) && + (!win->focus_highlight.geometry_changed)) return; - if (previous && win->focus_highlight.prev.handled) + if ((previous) && (win->focus_highlight.prev.handled)) elm_widget_signal_emit(previous, "elm,action,focus_highlight,hide", "elm"); if (!target) @@ -826,7 +826,7 @@ _elm_win_focus_highlight_reconfigure(Elm_Win *win) if (sig) elm_widget_signal_emit(target, sig, "elm"); - if (!target || !common_visible || win->focus_highlight.cur.handled) + if ((!target) || (!common_visible) || (win->focus_highlight.cur.handled)) goto the_end; if (win->focus_highlight.changed_theme) @@ -843,12 +843,12 @@ _elm_win_focus_highlight_reconfigure(Elm_Win *win) if (_elm_config->focus_highlight_animate) { str = edje_object_data_get(win->focus_highlight.top, "animate"); - win->focus_highlight.top_animate = (str && !strcmp(str, "on")); + win->focus_highlight.top_animate = ((str) && (!strcmp(str, "on"))); } } - if (win->focus_highlight.top_animate && previous && - !win->focus_highlight.prev.handled) + if ((win->focus_highlight.top_animate) && (previous) && + (!win->focus_highlight.prev.handled)) _elm_win_focus_highlight_anim_setup(win, top); else _elm_win_focus_highlight_simple_setup(win, top); @@ -869,7 +869,7 @@ _debug_key_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, voi return; - if (strcmp(ev->keyname, "F12") || + if ((strcmp(ev->keyname, "F12")) || (!evas_key_modifier_is_set(ev->modifiers, "Control"))) return; diff --git a/src/lib/els_cursor.c b/src/lib/els_cursor.c index 36f54c2..8f5a5a1 100644 --- a/src/lib/els_cursor.c +++ b/src/lib/els_cursor.c @@ -237,7 +237,7 @@ _elm_cursor_mouse_out(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUS cur->visible = EINA_FALSE; sobj_parent = evas_object_data_get(cur->eventarea, "elm-parent"); - while (sobj_parent != NULL) + while (sobj_parent) { pcur = evas_object_data_get((sobj_parent), _cursor_key); if ((pcur) && (pcur->visible)) break; diff --git a/src/lib/els_scroller.c b/src/lib/els_scroller.c index 95a6dc9..9fc4d97 100644 --- a/src/lib/els_scroller.c +++ b/src/lib/els_scroller.c @@ -1276,12 +1276,12 @@ _smart_event_wheel(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, sd = data; ev = event_info; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ; - if (evas_key_modifier_is_set(ev->modifiers, "Control") || - evas_key_modifier_is_set(ev->modifiers, "Alt") || - evas_key_modifier_is_set(ev->modifiers, "Shift") || - evas_key_modifier_is_set(ev->modifiers, "Meta") || - evas_key_modifier_is_set(ev->modifiers, "Hyper") || - evas_key_modifier_is_set(ev->modifiers, "Super")) + if ((evas_key_modifier_is_set(ev->modifiers, "Control")) || + (evas_key_modifier_is_set(ev->modifiers, "Alt")) || + (evas_key_modifier_is_set(ev->modifiers, "Shift")) || + (evas_key_modifier_is_set(ev->modifiers, "Meta")) || + (evas_key_modifier_is_set(ev->modifiers, "Hyper")) || + (evas_key_modifier_is_set(ev->modifiers, "Super"))) return; elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); if ((sd->down.bounce_x_animator) || (sd->down.bounce_y_animator) || diff --git a/src/lib/els_tooltip.c b/src/lib/els_tooltip.c index 93cf852..060f06f 100644 --- a/src/lib/els_tooltip.c +++ b/src/lib/els_tooltip.c @@ -362,7 +362,7 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt) } #define FDIF(a, b) (fabs((a) - (b)) > 0.0001) - if (FDIF(rel_x, tt->rel_pos.x) || FDIF(rel_y, tt->rel_pos.y)) + if ((FDIF(rel_x, tt->rel_pos.x)) || (FDIF(rel_y, tt->rel_pos.y))) { Edje_Message_Float_Set *msg;