Mercurial > pidgin
diff libpurple/status.c @ 25894:a6e3cb32cdd2
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
closes #7790
committer: Gary Kramlich <grim@reaperworld.com>
| author | Paul Aurich <paul@darkrain42.org> |
|---|---|
| date | Tue, 06 Jan 2009 03:39:51 +0000 |
| parents | 5ebfa814b9e8 |
| children | 3687049b4faf |
line wrap: on
line diff
--- a/libpurple/status.c Fri Jan 02 22:52:17 2009 +0000 +++ b/libpurple/status.c Tue Jan 06 03:39:51 2009 +0000 @@ -203,7 +203,7 @@ for (i = 0; i < PURPLE_STATUS_NUM_PRIMITIVES; i++) { - if (!strcmp(id, status_primitive_map[i].id)) + if (purple_strequal(id, status_primitive_map[i].id)) return status_primitive_map[i].type; } @@ -451,7 +451,7 @@ { PurpleStatusAttr *attr = (PurpleStatusAttr *)l->data; - if (!strcmp(purple_status_attr_get_id(attr), id)) + if (purple_strequal(purple_status_attr_get_id(attr), id)) return attr; } @@ -477,7 +477,7 @@ { status_type = status_types->data; - if (!strcmp(id, status_type->id)) + if (purple_strequal(id, status_type->id)) return status_type; status_types = status_types->next; @@ -782,12 +782,8 @@ { const gchar *string_data = l->data; l = l->next; - if (((string_data == NULL) && (value->data.string_data == NULL)) || - ((string_data != NULL) && (value->data.string_data != NULL) && - !strcmp(string_data, value->data.string_data))) - { + if (purple_strequal(string_data, value->data.string_data)) continue; - } purple_status_set_attr_string(status, id, string_data); changed = TRUE; } @@ -1451,7 +1447,7 @@ { PurpleStatus *temp_status = l->data; - if (!strcmp(status_id, purple_status_get_id(temp_status))) + if (purple_strequal(status_id, purple_status_get_id(temp_status))) status = temp_status; }
