Clarify constraint on _splice

This commit is contained in:
Patrick Pelissier committed 2024-12-25 20:48:34 +01:00
1 parent 9136a4a972
commit 4ab2615a1c
4 files changed
+11

No files matched your search

+7
View File
@@ -1929,6 +1929,7 @@ and `it1` references the inserted element in `list1`.
Move all the element of the list `list2` into the list `list1`,
moving the last element of `list2` after the first element of `list1`.
Afterwards, `list2` remains initialized but is emptied.
`list1` and `list2` shall reference different objects.
##### `void name_reverse(name_t list)`
@@ -2082,6 +2083,7 @@ Afterwards, `it` points to the next element of `list2`.
Move all the element of the list `list2` into the list `list1`,
moving the last element of `list2` after the first element of `list1`.
Afterwards, `list2` is emptied.
`list1` and `list2` shall reference different objects.
##### `void name_reverse(name_t list)`
@@ -2294,6 +2296,7 @@ comparisons.
Move all the elements of the array `array2` to the end of the array `array1`.
Afterwards, `array2` is empty.
`array1` and `array2` shall reference different objects.
_________________
@@ -2702,6 +2705,7 @@ If there is the same key between `dict2` into `dict1`,
then their values are added (as per the `ADD` method of the value type).
Afterward `dict2` is reset (i.e. empty).
This method is only defined if the value type defines an `ADD` method.
`dict1` and `dict2` shall reference different objects.
_________________
@@ -4724,6 +4728,7 @@ This method is created only if the `DIV` operator is defined.
Append in `*a` all elements of `*b` and reset `*b`.
This method is created only if the `SPLICE` operator is defined.
`a` and `b` shall reference different objects.
##### `bool name_get(value_type *val, const name_t *a, key_type const key)`
@@ -5468,6 +5473,7 @@ Afterwards, `it` points to the next element of `list2`.
Move all the element of `list2` into `list1`, moving the last element
of `list2` after the first element of `list1`.
Afterwards, `list2` is emptied.
`list1` and `list2` shall reference different objects.
_________________
@@ -6602,6 +6608,7 @@ Append the buffer of 'n' bytes to the byte string `v`
Append the byte string `src` to the byte string `dst`,
emptying 'src' afterwards.
`dst` and `src` shall reference different objects.
##### `uint8_t bstring_pop_back (bstring_t v)`
+1
View File
@@ -958,6 +958,7 @@
{ \
M_ARRA4_CONTRACT(a1); \
M_ARRA4_CONTRACT(a2); \
M_ASSERT(a1 != a2); \
if (M_LIKELY (a2->size > 0)) { \
size_t newSize = a1->size + a2->size; \
/* To overflow newSize, we need to a1 and a2 a little bit above \
+2
View File
@@ -214,7 +214,9 @@ m_bstring_push_back_bytes (m_bstring_t v, size_t n, const void *buffer)
M_INLINE void
m_bstring_splice(m_bstring_t dst, m_bstring_t src)
{
M_BSTRING_CONTRACT (dst);
M_BSTRING_CONTRACT (src);
M_ASSERT(src != dst);
m_bstring_push_back_bytes(dst, m_bstring_size(src), m_bstr1ng_cstr(src));
m_bstring_reset(src);
}
+1
View File
@@ -1223,6 +1223,7 @@ ARRAY_DEF(m_array_index, m_indexhash_t, M_POD_OPLIST)
M_F(name, _splice)(dict_t d1, dict_t d2) \
{ \
dict_it_t it; \
M_ASSERT(d1 != d2); \
/* NOTE: Despite using set_at, the accessing of the item in d1 \
is not as random as other uses of the HASH table as d2 \
uses the same order than d1 */ \