summaryrefslogtreecommitdiff
path: root/legacy/eet
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-05-15 07:06:12 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-05-15 07:06:12 +0000
commit9f800d8e21f9f22fe87d268ab777c910416b1ddd (patch)
tree30cdc935c6cb17c6adadbcd01b03eff7605f270f /legacy/eet
parent31bdf4d2c9a7d9611347cc6d8f5aabd6b7169f4e (diff)
fix eet_dict locks and formatting.
SVN revision: 71097
Diffstat (limited to 'legacy/eet')
-rw-r--r--legacy/eet/src/lib/eet_dictionary.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/legacy/eet/src/lib/eet_dictionary.c b/legacy/eet/src/lib/eet_dictionary.c
index f307d4ddbe..b06ca7736e 100644
--- a/legacy/eet/src/lib/eet_dictionary.c
+++ b/legacy/eet/src/lib/eet_dictionary.c
@@ -64,7 +64,8 @@ _eet_dictionary_lookup(Eet_Dictionary *ed,
64 if (ed->all[current].len == len) 64 if (ed->all[current].len == len)
65 { 65 {
66 if (ed->all[current].str && 66 if (ed->all[current].str &&
67 (ed->all[current].str == string || strcmp(ed->all[current].str, string) == 0)) 67 ((ed->all[current].str == string) ||
68 (!strcmp(ed->all[current].str, string))))
68 { 69 {
69 found = EINA_TRUE; 70 found = EINA_TRUE;
70 break; 71 break;
@@ -75,7 +76,7 @@ _eet_dictionary_lookup(Eet_Dictionary *ed,
75 current = ed->all[current].next; 76 current = ed->all[current].next;
76 } 77 }
77 78
78 if (current == -1 && found) 79 if ((current == -1) && found)
79 return prev; 80 return prev;
80 81
81 return current; 82 return current;
@@ -90,6 +91,7 @@ eet_dictionary_string_add(Eet_Dictionary *ed,
90 int hash; 91 int hash;
91 int idx; 92 int idx;
92 int len; 93 int len;
94 int cnt;
93 95
94 if (!ed) 96 if (!ed)
95 return -1; 97 return -1;
@@ -103,7 +105,9 @@ eet_dictionary_string_add(Eet_Dictionary *ed,
103 105
104 if (idx != -1) 106 if (idx != -1)
105 { 107 {
106 if (ed->all[idx].str && (ed->all[idx].str == string || strcmp(ed->all[idx].str, string) == 0)) 108 if (ed->all[idx].str &&
109 ((ed->all[idx].str == string) ||
110 (!strcmp(ed->all[idx].str, string))))
107 { 111 {
108 eina_lock_release(&ed->mutex); 112 eina_lock_release(&ed->mutex);
109 return idx; 113 return idx;
@@ -156,8 +160,10 @@ eet_dictionary_string_add(Eet_Dictionary *ed,
156 ed->hash[hash] = ed->count; 160 ed->hash[hash] = ed->count;
157 } 161 }
158 162
163 ed->count++;
164 cnt = ed->count;
159 eina_lock_release(&ed->mutex); 165 eina_lock_release(&ed->mutex);
160 return ed->count++; 166 return cnt;
161 167
162 on_error: 168 on_error:
163 eina_lock_release(&ed->mutex); 169 eina_lock_release(&ed->mutex);