Changeset 736a330 in mainline
- Timestamp:
- 2010-11-07T21:12:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ee9d5d
- Parents:
- 278b97b1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/generic_char_map.h
r278b97b1 r736a330 40 40 #include <unistd.h> 41 41 #include <errno.h> 42 #include <err.h>43 42 44 43 #include <adt/char_map.h> … … 85 84 type *value) \ 86 85 { \ 87 ERROR_DECLARE; \86 int rc; \ 88 87 int index; \ 89 88 if (!name##_is_valid(map)) \ … … 92 91 if (index < 0) \ 93 92 return index; \ 94 if (ERROR_OCCURRED(char_map_add(&map->names, name, length,\95 index))) { \93 rc = char_map_add(&map->names, name, length, index); \ 94 if (rc != EOK) { \ 96 95 name##_items_exclude_index(&map->values, index); \ 97 return ERROR_CODE; \96 return rc; \ 98 97 } \ 99 98 return EOK; \ … … 141 140 int name##_initialize(name##_ref map) \ 142 141 { \ 143 ERROR_DECLARE; \142 int rc; \ 144 143 if (!map) \ 145 144 return EINVAL; \ 146 ERROR_PROPAGATE(char_map_initialize(&map->names)); \ 147 if (ERROR_OCCURRED(name##_items_initialize(&map->values))) { \ 145 rc = char_map_initialize(&map->names); \ 146 if (rc != EOK) \ 147 return rc; \ 148 rc = name##_items_initialize(&map->values); \ 149 if (rc != EOK) { \ 148 150 char_map_destroy(&map->names); \ 149 return ERROR_CODE; \151 return rc; \ 150 152 } \ 151 153 map->magic = GENERIC_CHAR_MAP_MAGIC_VALUE; \
Note:
See TracChangeset
for help on using the changeset viewer.