summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-26 23:56:09 +0200
committerTyge Løvset <[email protected]>2022-09-26 23:56:09 +0200
commit60c4432678073faa271fe9b6f632c5a3789d5727 (patch)
treeaf8dc7b274bf1d7ad96b7774275092a1ecbe1a03 /include
parent2c31b421b6c867ab956a843dace0d95769a97667 (diff)
downloadSTC-modified-60c4432678073faa271fe9b6f632c5a3789d5727.tar.gz
STC-modified-60c4432678073faa271fe9b6f632c5a3789d5727.zip
Deprecated c_pair() macro. Replaced with c_PAIR(), analogous to c_ARGsv() macro which are both unsafe regarding side effects on arg.
Diffstat (limited to 'include')
-rw-r--r--include/stc/ccommon.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index 1961833b..c6bf1f72 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -118,6 +118,8 @@ typedef const char* crawstr;
#define c_sv2(str, n) (c_make(csview){str, n})
#define c_PRIsv ".*s"
#define c_ARGsv(sv) (int)(sv).size, (sv).str
+#define c_PAIR(ref) (ref)->first, (ref)->second
+#define c_pair(ref) c_PAIR(ref) // [deprecated]
#define _c_ROTL(x, k) (x << (k) | x >> (8*sizeof(x) - (k)))
@@ -261,7 +263,6 @@ STC_INLINE void crange_next(crange_iter* it)
*b = (n)*sizeof *b > (BYTES) ? c_alloc_n(type, n) : _c_b \
; b; b != _c_b ? c_free(b) : (void)0, b = NULL)
-#define c_pair(v) (v)->first, (v)->second
#define c_drop(C, ...) do { c_forlist (_i, C*, {__VA_ARGS__}) C##_drop(*_i.ref); } while(0)
#define c_find_if(it, C, cnt, pred) do { \