Changeset 4541ae4 in mainline


Ignore:
Timestamp:
2008-07-27T11:15:45Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c296a9
Parents:
edebc15c
Message:

Improve definition of generic macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/macros.h

    redebc15c r4541ae4  
    4141#define islower(c)      (((c) >= 'a') && ((c) <= 'z'))
    4242#define isupper(c)      (((c) >= 'A') && ((c) <= 'Z'))
    43 #define isalpha(c)      (is_lower(c) || is_upper(c))
    44 #define isalphanum(c)   (is_alpha(c) || is_digit(c))
     43#define isalpha(c)      (is_lower((c)) || is_upper((c)))
     44#define isalphanum(c)   (is_alpha((c)) || is_digit((c)))
    4545#define isspace(c)      (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || \
    46                                 ((c) == '\r'))
     46                            ((c) == '\r'))
    4747
    4848#define min(a,b)        ((a) < (b) ? (a) : (b))
     
    5151/** Return true if the intervals overlap.
    5252 *
    53  * @param s1 Start address of the first interval.
    54  * @param sz1 Size of the first interval.
    55  * @param s2 Start address of the second interval.
    56  * @param sz2 Size of the second interval.
     53 * @param s1            Start address of the first interval.
     54 * @param sz1           Size of the first interval.
     55 * @param s2            Start address of the second interval.
     56 * @param sz2           Size of the second interval.
    5757 */
    5858static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2)
     
    6565
    6666/* Compute overlapping of physical addresses */
    67 #define PA_overlaps(x, szx, y, szy)     overlaps(KA2PA(x), szx, KA2PA(y), szy)
     67#define PA_overlaps(x, szx, y, szy)     \
     68        overlaps(KA2PA((x)), (szx), KA2PA((y)), (szy))
    6869
    69 #define SIZE2KB(size) (size >> 10)
    70 #define SIZE2MB(size) (size >> 20)
     70#define SIZE2KB(size) ((size) >> 10)
     71#define SIZE2MB(size) ((size) >> 20)
    7172
    72 #define KB2SIZE(size) (size << 10)
    73 #define MB2SIZE(size) (size << 20)
     73#define KB2SIZE(kb) ((kb) << 10)
     74#define MB2SIZE(mb) ((mb) << 20)
    7475
    7576#define STRING(arg) STRING_ARG(arg)
Note: See TracChangeset for help on using the changeset viewer.