Changeset 38b3baf in mainline for uspace/srv/devman/util.h


Ignore:
Timestamp:
2010-10-23T07:16:14Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e66a5ec
Parents:
032e0bb
Message:

Cstyle fixes of devman.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/util.h

    r032e0bb r38b3baf  
    3030 * @{
    3131 */
    32  
     32
    3333#ifndef DEVMAN_UTIL_H_
    3434#define DEVMAN_UTIL_H_
     
    3838#include <malloc.h>
    3939
     40extern char *get_abs_path(const char *, const char *, const char *);
     41extern char *get_path_elem_end(char *);
    4042
    41 char * get_abs_path(const char *base_path, const char *name, const char *ext);
    42 char * get_path_elem_end(char *path);
    43 
    44 static inline bool skip_spaces(char **buf)
     43static inline bool skip_spaces(char **buf)
    4544{
    46         while (isspace(**buf)) {
    47                 (*buf)++;               
    48         }
    49         return *buf != 0;       
     45        while (isspace(**buf))
     46                (*buf)++;
     47        return *buf != 0;
    5048}
    5149
    52 static inline size_t get_nonspace_len(const char *str) 
     50static inline size_t get_nonspace_len(const char *str)
    5351{
    5452        size_t len = 0;
     53       
    5554        while(*str != 0 && !isspace(*str)) {
    5655                len++;
     
    6261static inline void free_not_null(const void *ptr)
    6362{
    64         if (NULL != ptr) {
     63        if (NULL != ptr)
    6564                free(ptr);
    66         }
    6765}
    6866
    69 static inline char * clone_string(const char *s)
     67static inline char *clone_string(const char *s)
    7068{
    7169        size_t size = str_size(s) + 1;
    72         char *str = (char *)malloc(size);
    73         if (NULL != str) {
     70        char *str;
     71       
     72        str = (char *) malloc(size);
     73        if (NULL != str)
    7474                str_cpy(str, size, s);
    75         }
    7675        return str;
    7776}
     
    8079{
    8180        while (*str) {
    82                 if (orig == *str) {
     81                if (orig == *str)
    8382                        *str = repl;
    84                 }
    8583                str++;
    8684        }
     
    8886
    8987#endif
     88
     89/** @}
     90 */
Note: See TracChangeset for help on using the changeset viewer.