Changeset a7811f17 in mainline for uspace/lib/c/generic/adt/char_map.c


Ignore:
Timestamp:
2010-11-19T21:28:02Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9c6b966
Parents:
45f04f8 (diff), aaa3f33a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge xxx_ref typedefs removal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/char_map.c

    r45f04f8 ra7811f17  
    6565 */
    6666static int
    67 char_map_add_item(char_map_ref map, const char *identifier, size_t length,
     67char_map_add_item(char_map_t *map, const char *identifier, size_t length,
    6868    const int value)
    6969{
    7070        if (map->next == (map->size - 1)) {
    71                 char_map_ref *tmp;
    72 
    73                 tmp = (char_map_ref *) realloc(map->items,
    74                     sizeof(char_map_ref) * 2 * map->size);
     71                char_map_t **tmp;
     72
     73                tmp = (char_map_t **) realloc(map->items,
     74                    sizeof(char_map_t *) * 2 * map->size);
    7575                if (!tmp)
    7676                        return ENOMEM;
     
    8080        }
    8181
    82         map->items[map->next] = (char_map_ref) malloc(sizeof(char_map_t));
     82        map->items[map->next] = (char_map_t *) malloc(sizeof(char_map_t));
    8383        if (!map->items[map->next])
    8484                return ENOMEM;
     
    110110 * @returns             FALSE otherwise.
    111111 */
    112 static int char_map_is_valid(const char_map_ref map)
     112static int char_map_is_valid(const char_map_t *map)
    113113{
    114114        return map && (map->magic == CHAR_MAP_MAGIC_VALUE);
     
    139139 */
    140140int
    141 char_map_add(char_map_ref map, const char *identifier, size_t length,
     141char_map_add(char_map_t *map, const char *identifier, size_t length,
    142142    const int value)
    143143{
     
    172172 * @param[in,out] map   The character string to integer map.
    173173 */
    174 void char_map_destroy(char_map_ref map)
     174void char_map_destroy(char_map_t *map)
    175175{
    176176        if (char_map_is_valid(map)) {
     
    200200 * @returns             NULL if the key is not assigned a node.
    201201 */
    202 static char_map_ref
    203 char_map_find_node(const char_map_ref map, const char *identifier,
     202static char_map_t *
     203char_map_find_node(const char_map_t *map, const char *identifier,
    204204    size_t length)
    205205{
     
    224224        }
    225225
    226         return map;
     226        return (char_map_t *) map;
    227227}
    228228
     
    242242 * @returns             CHAR_MAP_NULL if the key is not assigned a value.
    243243 */
    244 int char_map_exclude(char_map_ref map, const char *identifier, size_t length)
    245 {
    246         char_map_ref node;
     244int char_map_exclude(char_map_t *map, const char *identifier, size_t length)
     245{
     246        char_map_t *node;
    247247
    248248        node = char_map_find_node(map, identifier, length);
     
    270270 *  @returns            CHAR_MAP_NULL if the key is not assigned a value.
    271271 */
    272 int char_map_find(const char_map_ref map, const char *identifier, size_t length)
    273 {
    274         char_map_ref node;
     272int char_map_find(const char_map_t *map, const char *identifier, size_t length)
     273{
     274        char_map_t *node;
    275275
    276276        node = char_map_find_node(map, identifier, length);
     
    285285 *  @returns            ENOMEM if there is not enough memory left.
    286286 */
    287 int char_map_initialize(char_map_ref map)
     287int char_map_initialize(char_map_t *map)
    288288{
    289289        if (!map)
     
    295295        map->next = 0;
    296296
    297         map->items = malloc(sizeof(char_map_ref) * map->size);
     297        map->items = malloc(sizeof(char_map_t *) * map->size);
    298298        if (!map->items) {
    299299                map->magic = 0;
     
    330330 */
    331331int
    332 char_map_update(char_map_ref map, const char *identifier, const size_t length,
     332char_map_update(char_map_t *map, const char *identifier, const size_t length,
    333333    const int value)
    334334{
    335         char_map_ref node;
     335        char_map_t *node;
    336336
    337337        node = char_map_find_node(map, identifier, length);
Note: See TracChangeset for help on using the changeset viewer.