Changeset ade06b4 in mainline


Ignore:
Timestamp:
2008-08-06T18:27:11Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93a9233
Parents:
57b4f46
Message:

Avoid magic numbers in tmpfs_dump.c.

Location:
uspace/srv/fs/tmpfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs.h

    r57b4f46 rade06b4  
    4545#endif
    4646
     47typedef enum {
     48        TMPFS_NONE,
     49        TMPFS_FILE,
     50        TMPFS_DIRECTORY
     51} tmpfs_dentry_type_t;
     52
    4753typedef struct tmpfs_dentry {
    4854        fs_index_t index;       /**< TMPFS node index. */
     
    5157        struct tmpfs_dentry *child;
    5258        hash_table_t names;     /**< All names linking to this TMPFS node. */
    53         enum {
    54                 TMPFS_NONE,
    55                 TMPFS_FILE,
    56                 TMPFS_DIRECTORY
    57         } type;
     59        tmpfs_dentry_type_t type;
    5860        unsigned lnkcnt;        /**< Link count. */
    5961        size_t size;            /**< File size if type is TMPFS_FILE. */
  • uspace/srv/fs/tmpfs/tmpfs_dump.c

    r57b4f46 rade06b4  
    118118               
    119119                switch (entry.type) {
    120                 case 0:
     120                case TMPFS_NONE:
    121121                        break;
    122                 case 1:
     122                case TMPFS_FILE:
    123123                        fname = malloc(entry.len + 1);
    124124                        if (fname == NULL)
     
    162162                       
    163163                        break;
    164                 case 2:
     164                case TMPFS_DIRECTORY:
    165165                        fname = malloc(entry.len + 1);
    166166                        if (fname == NULL)
     
    196196                        return false;
    197197                }
    198         } while (entry.type != 0);
     198        } while (entry.type != TMPFS_NONE);
    199199       
    200200        return true;
Note: See TracChangeset for help on using the changeset viewer.