diff options
| author | Tyge Løvset <[email protected]> | 2022-09-27 19:29:04 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-09-27 19:29:04 +0200 |
| commit | 0f755b3ba05dd629bd56f1b356c1bcc2214222a9 (patch) | |
| tree | f9253afbb3c71d777f4690d38906b347a474d766 | |
| parent | 57bd093b76083de23af1cfa40be16d166cd440fe (diff) | |
| download | STC-modified-0f755b3ba05dd629bd56f1b356c1bcc2214222a9.tar.gz STC-modified-0f755b3ba05dd629bd56f1b356c1bcc2214222a9.zip | |
Missing paranthesis in c_new().
| -rw-r--r-- | examples/forloops.c | 4 | ||||
| -rw-r--r-- | include/stc/ccommon.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/forloops.c b/examples/forloops.c index 7a68f844..5913aac2 100644 --- a/examples/forloops.c +++ b/examples/forloops.c @@ -66,8 +66,8 @@ int main() #define isOdd(i) (*i.ref & 1)
puts("\n\nc_forfilter:");
- c_forfilter (i, IVec, vec,
- c_flt_skipwhile(i, *i.ref != 65)
+ c_forfilter (i, IVec, vec
+ , c_flt_skipwhile(i, *i.ref != 65)
&& c_flt_takewhile(i, *i.ref != 280)
&& c_flt_skipwhile(i, isOdd(i))
&& isOdd(i)
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index 2e84633c..bae0b68f 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -68,7 +68,7 @@ # define c_alloc(T) c_malloc(sizeof(T)) # define c_alloc_n(T, n) c_malloc(sizeof(T)*(n)) # define c_make(T) (T) -# define c_new(T, ...) (T*)memcpy(c_alloc(T), (T[]){__VA_ARGS__}, sizeof(T)) +# define c_new(T, ...) ((T*)memcpy(c_alloc(T), (T[]){__VA_ARGS__}, sizeof(T))) #else # include <new> # define c_alloc(T) static_cast<T*>(c_malloc(sizeof(T))) |
