summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-10-26 20:46:43 +0200
committerTyge Løvset <[email protected]>2021-10-26 20:46:43 +0200
commit0c6b41fd08bac55281ff9ad41b0d052171881651 (patch)
tree4a8107ce800eba0bd0d659d557133466e01da79c /include
parent0f95c005891b0d4b3b2610fdba241cf78c372d81 (diff)
downloadSTC-modified-0c6b41fd08bac55281ff9ad41b0d052171881651.tar.gz
STC-modified-0c6b41fd08bac55281ff9ad41b0d052171881651.zip
Added some examples and updated docs. Removed cvec_X_erase() and cdeq_X_erase() - may be used wrong. Use cvec_X_erase_n() instead.
Fixed type-bug in cpque.h (same was in cqueue.h).
Diffstat (limited to 'include')
-rw-r--r--include/stc/cdeq.h4
-rw-r--r--include/stc/cpque.h2
-rw-r--r--include/stc/cvec.h5
3 files changed, 2 insertions, 9 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h
index 264761e0..160c7601 100644
--- a/include/stc/cdeq.h
+++ b/include/stc/cdeq.h
@@ -158,10 +158,6 @@ cx_memb(_emplace_range)(Self* self, cx_iter_t it, cx_iter_t it1, cx_iter_t it2)
}
STC_INLINE cx_iter_t
-cx_memb(_erase)(Self* self, size_t idx) {
- return cx_memb(_erase_range_p)(self, self->data + idx, self->data + idx + 1);
-}
-STC_INLINE cx_iter_t
cx_memb(_erase_n)(Self* self, size_t idx, size_t n) {
return cx_memb(_erase_range_p)(self, self->data + idx, self->data + idx + n);
}
diff --git a/include/stc/cpque.h b/include/stc/cpque.h
index 0a06fc40..3fc8ebea 100644
--- a/include/stc/cpque.h
+++ b/include/stc/cpque.h
@@ -53,7 +53,7 @@ STC_INLINE Self cx_memb(_with_capacity)(size_t cap) {
STC_INLINE void cx_memb(_reserve)(Self* self, size_t n) {
if (n >= self->size)
- self->data = (cx_value_t *)c_realloc(self->data, (self->capacity = n)*sizeof(cx_rawvalue_t));
+ self->data = (cx_value_t *)c_realloc(self->data, (self->capacity = n)*sizeof(cx_value_t));
}
STC_INLINE void cx_memb(_clear)(Self* self) {
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index ff5b4399..3810e678 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -172,10 +172,7 @@ STC_INLINE cx_iter_t
cx_memb(_emplace_range)(Self* self, cx_iter_t it, cx_iter_t it1, cx_iter_t it2) {
return cx_memb(_insert_range_p)(self, it.ref, it1.ref, it2.ref, true);
}
-STC_INLINE cx_iter_t
-cx_memb(_erase)(Self* self, size_t idx) {
- return cx_memb(_erase_range_p)(self, self->data + idx, self->data + idx + 1);
-}
+
STC_INLINE cx_iter_t
cx_memb(_erase_n)(Self* self, size_t idx, size_t n) {
return cx_memb(_erase_range_p)(self, self->data + idx, self->data + idx + n);