Changeset 1cf26ab in mainline for uspace/lib/c


Ignore:
Timestamp:
2016-05-14T06:44:37Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
362654a
Parents:
1023758
Message:

Use static assert instead of regular ones

Location:
uspace/lib/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/double_to_str.c

    r1023758 r1cf26ab  
    505505{
    506506        /* The whole computation assumes 64bit significand. */
    507         assert(sizeof(ieee_val.pos_val.significand) == sizeof(uint64_t));
     507        static_assert(sizeof(ieee_val.pos_val.significand) == sizeof(uint64_t));
    508508
    509509        if (ieee_val.is_special) {
     
    753753{
    754754        /* The whole computation assumes 64bit significand. */
    755         assert(sizeof(ieee_val.pos_val.significand) == sizeof(uint64_t));
     755        static_assert(sizeof(ieee_val.pos_val.significand) == sizeof(uint64_t));
    756756
    757757        if (ieee_val.is_special) {
  • uspace/lib/c/generic/ieee_double.c

    r1023758 r1cf26ab  
    4545        const int exponent_bias = 1075;
    4646
    47         assert(sizeof(val) == sizeof(uint64_t));
     47        static_assert(sizeof(val) == sizeof(uint64_t));
    4848
    4949        union {
  • uspace/lib/c/include/assert.h

    r1023758 r1cf26ab  
    3737#define LIBC_ASSERT_H_
    3838
     39#define static_assert(expr)     _Static_assert(expr, "")
     40
    3941/** Debugging assert macro
    4042 *
Note: See TracChangeset for help on using the changeset viewer.