summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/advanced.c4
-rw-r--r--examples/cstr_match.c2
-rw-r--r--examples/sptr_ex.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/advanced.c b/examples/advanced.c
index 1c5da926..60276b09 100644
--- a/examples/advanced.c
+++ b/examples/advanced.c
@@ -22,7 +22,7 @@ uint64_t vikingraw_hash(const VikingRaw* raw, size_t ignore) {
uint64_t hash = c_strhash(raw->name) ^ (c_strhash(raw->country) >> 15);
return hash;
}
-static inline int vikingraw_equals(const VikingRaw* rx, const VikingRaw* ry) {
+static inline bool vikingraw_equalto(const VikingRaw* rx, const VikingRaw* ry) {
return strcmp(rx->name, ry->name) == 0 && strcmp(rx->country, ry->country) == 0;
}
@@ -37,7 +37,7 @@ static inline VikingRaw viking_toRaw(const Viking* vk) {
#define i_tag vk
#define i_key Viking
#define i_val int
-#define i_equ vikingraw_equals
+#define i_equ vikingraw_equalto
#define i_hash vikingraw_hash
#define i_keyraw VikingRaw
#define i_keyfrom viking_fromRaw
diff --git a/examples/cstr_match.c b/examples/cstr_match.c
index 28c1a22b..9e5cc11c 100644
--- a/examples/cstr_match.c
+++ b/examples/cstr_match.c
@@ -6,7 +6,7 @@ int main()
c_autovar (cstr ss = cstr_lit("The quick brown fox jumps over the lazy dog.JPG"), cstr_del(&ss)) {
size_t pos = cstr_find_n(ss, "brown", 0, 5);
printf("%zu [%s]\n", pos, pos == cstr_npos ? "<NULL>" : &ss.str[pos]);
- printf("equals: %d\n", cstr_equalto(ss, "The quick brown fox jumps over the lazy dog.JPG"));
+ printf("equals: %d\n", cstr_equals(ss, "The quick brown fox jumps over the lazy dog.JPG"));
printf("contains: %d\n", cstr_contains(ss, "umps ove"));
printf("starts_with: %d\n", cstr_starts_with(ss, "The quick brown"));
printf("ends_with: %d\n", cstr_ends_with(ss, ".jpg"));
diff --git a/examples/sptr_ex.c b/examples/sptr_ex.c
index 17ac27e1..8c803db5 100644
--- a/examples/sptr_ex.c
+++ b/examples/sptr_ex.c
@@ -38,7 +38,7 @@ void example3()
});
c_foreach (s, cvec_song, v)
- if (!cstr_equalto(s.ref->get->artist, "Bob Dylan"))
+ if (!cstr_equals(s.ref->get->artist, "Bob Dylan"))
cvec_song_emplace_back(&v2, *s.ref); // note: calls csptr_song_clone()
c_apply(cvec_song, push_back, &v2, {