Changeset 45bb1d2 in mainline for uspace/lib/c/generic/net/inet.c


Ignore:
Timestamp:
2010-12-27T20:04:22Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b35fea3, e64e40b
Parents:
727f04f
Message:

Fix comment style in lib/c/generic/net.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/inet.c

    r727f04f r45bb1d2  
    6464        switch (family) {
    6565        case AF_INET:
    66                 // check the output buffer size
     66                /* Check output buffer size */
    6767                if (length < INET_ADDRSTRLEN)
    6868                        return ENOMEM;
    6969                       
    70                 // fill the buffer with the IPv4 address
     70                /* Fill buffer with IPv4 address */
    7171                snprintf(address, length, "%hhu.%hhu.%hhu.%hhu",
    7272                    data[0], data[1], data[2], data[3]);
     
    7575
    7676        case AF_INET6:
    77                 // check the output buffer size
     77                /* Check output buffer size */
    7878                if (length < INET6_ADDRSTRLEN)
    7979                        return ENOMEM;
    8080               
    81                 // fill the buffer with the IPv6 address
     81                /* Fill buffer with IPv6 address */
    8282                snprintf(address, length,
    8383                    "%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:%hhx%hhx:"
     
    124124                return EINVAL;
    125125
    126         // set the processing parameters
     126        /* Set processing parameters */
    127127        switch (family) {
    128128        case AF_INET:
     
    142142        }
    143143
    144         // erase if no address
     144        /* Erase if no address */
    145145        if (!address) {
    146146                bzero(data, count);
     
    148148        }
    149149
    150         // process the string from the beginning
     150        /* Process string from the beginning */
    151151        next = address;
    152152        index = 0;
    153153        do {
    154                 // if the actual character is set
     154                /* If the actual character is set */
    155155                if (next && *next) {
    156156
    157                         // if not on the first character
     157                        /* If not on the first character */
    158158                        if (index) {
    159                                 // move to the next character
     159                                /* Move to the next character */
    160160                                ++next;
    161161                        }
    162162
    163                         // parse the actual integral value
     163                        /* Parse the actual integral value */
    164164                        value = strtoul(next, &last, base);
    165                         // remember the last problematic character
    166                         // should be either '.' or ':' but is ignored to be more
    167                         // generic
     165                        /*
     166                         * Remember the last problematic character
     167                         * should be either '.' or ':' but is ignored to be
     168                         * more generic
     169                         */
    168170                        next = last;
    169171
    170                         // fill the address data byte by byte
     172                        /* Fill the address data byte by byte */
    171173                        shift = bytes - 1;
    172174                        do {
    173                                 // like little endian
     175                                /* like little endian */
    174176                                data[index + shift] = value;
    175177                                value >>= 8;
     
    178180                        index += bytes;
    179181                } else {
    180                         // erase the rest of the address
     182                        /* Erase the rest of the address */
    181183                        bzero(data + index, count - index);
    182184                        return EOK;
Note: See TracChangeset for help on using the changeset viewer.