diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-11-20 12:15:37 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-11-20 12:15:37 +0000 |
commit | c7fcb102c9f84ec1c4e69bbe4e2fa5ceb0ea0564 (patch) | |
tree | de6f73c10d0a111b1795dc30ae8771efa23c04bd /src/include | |
parent | fb9297b73406ccd1663bc930cfd96320a742f497 (diff) | |
download | skalibs-c7fcb102c9f84ec1c4e69bbe4e2fa5ceb0ea0564.tar.xz |
Make stralloc.h and tai.h suitable for inclusion in C++-compatible headers
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/skalibs/stralloc.h | 2 | ||||
-rw-r--r-- | src/include/skalibs/tai.h | 19 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/include/skalibs/stralloc.h b/src/include/skalibs/stralloc.h index c94547f..b5f89ca 100644 --- a/src/include/skalibs/stralloc.h +++ b/src/include/skalibs/stralloc.h @@ -14,7 +14,7 @@ struct stralloc_s size_t a ; } ; -#define STRALLOC_ZERO { .s = 0, .len = 0, .a = 0 } +#define STRALLOC_ZERO { 0, 0, 0 } extern stralloc const stralloc_zero ; extern int stralloc_ready_tuned (stralloc *, size_t, size_t, size_t, size_t) ; diff --git a/src/include/skalibs/tai.h b/src/include/skalibs/tai.h index 53aad92..f3699ce 100644 --- a/src/include/skalibs/tai.h +++ b/src/include/skalibs/tai.h @@ -15,12 +15,11 @@ struct tai_s uint64_t x ; } ; - -#define TAI_ZERO { .x = 0 } +#define TAI_ZERO { 0 } #define TAI_MAGIC ((uint64_t)4611686018427387904ULL) -#define TAI_EPOCH { .x = TAI_MAGIC + 10UL } -#define TAI_INFINITE_RELATIVE { .x = (uint64_t)1 << 60 } -#define TAI_INFINITE { .x = TAI_MAGIC + ((uint64_t)1 << 61) } +#define TAI_EPOCH { TAI_MAGIC + 10UL } +#define TAI_INFINITE_RELATIVE { (uint64_t)1 << 60 } +#define TAI_INFINITE { TAI_MAGIC + ((uint64_t)1 << 61) } #define tai_sec(t) ((t)->x) extern int tai_u64 (tai_t *, uint64_t) ; @@ -58,11 +57,11 @@ struct tain_s uint32_t nano ; /* 0..999999999U */ } ; -#define TAIN_ZERO { .sec = TAI_ZERO, .nano = 0 } -#define TAIN_EPOCH { .sec = TAI_EPOCH, .nano = 0 } -#define TAIN_INFINITE { .sec = TAI_INFINITE, .nano = 0 } -#define TAIN_INFINITE_RELATIVE { .sec = TAI_INFINITE_RELATIVE, .nano = 0 } -#define TAIN_NANO500 { .sec = TAI_ZERO, .nano = 500 } +#define TAIN_ZERO { TAI_ZERO, 0 } +#define TAIN_EPOCH { TAI_EPOCH, 0 } +#define TAIN_INFINITE { TAI_INFINITE, 0 } +#define TAIN_INFINITE_RELATIVE { TAI_INFINITE_RELATIVE, 0 } +#define TAIN_NANO500 { TAI_ZERO, 500 } extern tain_t STAMP ; /* the global process wallclock */ extern tain_t const tain_zero ; |