Add function dict_splice
This commit is contained in:
1 parent
d70a971d2e
commit
6bb94db22f
2 files changed
+32
-11
No files matched your search
+4
-10
@@ -27,19 +27,13 @@
|
||||
#include "m-string.h"
|
||||
#include "mympz.h"
|
||||
|
||||
static inline bool oor_equal_p(int k, unsigned char n)
|
||||
{
|
||||
return k == (int)-n-1;
|
||||
}
|
||||
static inline void oor_set(int *k, unsigned char n)
|
||||
{
|
||||
*k = (int)-n-1;
|
||||
}
|
||||
|
||||
static inline bool oor_equal_p(int k, unsigned char n) { return k == (int)-n-1; }
|
||||
static inline void oor_set(int *k, unsigned char n) { *k = (int)-n-1; }
|
||||
static inline void update_value (int *p, const int val) { *p += val; }
|
||||
#include "coverage.h"
|
||||
START_COVERAGE
|
||||
DICT_DEF2(dict_str, string_t, STRING_OPLIST, string_t, STRING_OPLIST)
|
||||
DICT_OA_DEF2(dict_oa_int, int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(oor_equal_p), OOR_SET(oor_set M_IPTR)), int, M_DEFAULT_OPLIST)
|
||||
DICT_OA_DEF2(dict_oa_int, int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(oor_equal_p), OOR_SET(oor_set M_IPTR)), int, M_OPEXTEND(M_DEFAULT_OPLIST, UPDATE(update_value M_IPTR)))
|
||||
END_COVERAGE
|
||||
|
||||
DICT_STOREHASH_DEF2(dict_str2, string_t, STRING_OPLIST, string_t, STRING_OPLIST)
|
||||
|
||||
Reference in new issue
Block a user