Changeset 442ebbe in mainline
- Timestamp:
- 2010-12-04T14:15:20Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fc3dba14
- Parents:
- 3bb5735
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/char_map.c
r3bb5735 r442ebbe 90 90 } 91 91 92 map->items[map->next]->c = * 93 ++ identifier;94 ++ map->next;95 if ((length > 1) || ((length == 0) && (*identifier))) {92 map->items[map->next]->c = *identifier; 93 identifier++; 94 map->next++; 95 if ((length > 1) || ((length == 0) && *identifier)) { 96 96 map->items[map->next - 1]->value = CHAR_MAP_NULL; 97 97 return char_map_add_item(map->items[map->next - 1], identifier, … … 142 142 const int value) 143 143 { 144 if (char_map_is_valid(map) && (identifier) && 145 ((length) || (*identifier))) { 144 if (char_map_is_valid(map) && identifier && (length || *identifier)) { 146 145 int index; 147 146 148 for (index = 0; index < map->next; ++ index) {147 for (index = 0; index < map->next; index++) { 149 148 if (map->items[index]->c != *identifier) 150 149 continue; 151 150 152 ++ identifier;153 if((length > 1) || ((length == 0) && (*identifier))) {151 identifier++; 152 if((length > 1) || ((length == 0) && *identifier)) { 154 153 return char_map_add(map->items[index], 155 154 identifier, length ? length - 1 : 0, value); … … 178 177 179 178 map->magic = 0; 180 for (index = 0; index < map->next; ++index)179 for (index = 0; index < map->next; index++) 181 180 char_map_destroy(map->items[index]); 182 181 … … 207 206 return NULL; 208 207 209 if (length || (*identifier)) {208 if (length || *identifier) { 210 209 int index; 211 210 212 for (index = 0; index < map->next; ++index) {211 for (index = 0; index < map->next; index++) { 213 212 if (map->items[index]->c == *identifier) { 214 ++identifier;213 identifier++; 215 214 if (length == 1) 216 215 return map->items[index]; -
uspace/lib/c/include/adt/generic_field.h
r3bb5735 r442ebbe 91 91 } \ 92 92 field->items[field->next] = value; \ 93 ++field->next; \93 field->next++; \ 94 94 field->items[field->next] = NULL; \ 95 95 return field->next - 1; \ … … 108 108 int index; \ 109 109 field->magic = 0; \ 110 for (index = 0; index < field->next; ++ index) { \110 for (index = 0; index < field->next; index++) { \ 111 111 if (field->items[index]) \ 112 112 free(field->items[index]); \
Note:
See TracChangeset
for help on using the changeset viewer.