Clarify constraint on _splice
This commit is contained in:
1 parent
9136a4a972
commit
4ab2615a1c
4 files changed
+11
No files matched your search
@@ -1929,6 +1929,7 @@ and `it1` references the inserted element in `list1`.
|
|||||||
Move all the element of the list `list2` into the list `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`.
|
moving the last element of `list2` after the first element of `list1`.
|
||||||
Afterwards, `list2` remains initialized but is emptied.
|
Afterwards, `list2` remains initialized but is emptied.
|
||||||
|
`list1` and `list2` shall reference different objects.
|
||||||
|
|
||||||
##### `void name_reverse(name_t list)`
|
##### `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`,
|
Move all the element of the list `list2` into the list `list1`,
|
||||||
moving the last element of `list2` after the first element of `list1`.
|
moving the last element of `list2` after the first element of `list1`.
|
||||||
Afterwards, `list2` is emptied.
|
Afterwards, `list2` is emptied.
|
||||||
|
`list1` and `list2` shall reference different objects.
|
||||||
|
|
||||||
##### `void name_reverse(name_t list)`
|
##### `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`.
|
Move all the elements of the array `array2` to the end of the array `array1`.
|
||||||
Afterwards, `array2` is empty.
|
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).
|
then their values are added (as per the `ADD` method of the value type).
|
||||||
Afterward `dict2` is reset (i.e. empty).
|
Afterward `dict2` is reset (i.e. empty).
|
||||||
This method is only defined if the value type defines an `ADD` method.
|
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`.
|
Append in `*a` all elements of `*b` and reset `*b`.
|
||||||
This method is created only if the `SPLICE` operator is defined.
|
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)`
|
##### `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
|
Move all the element of `list2` into `list1`, moving the last element
|
||||||
of `list2` after the first element of `list1`.
|
of `list2` after the first element of `list1`.
|
||||||
Afterwards, `list2` is emptied.
|
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`,
|
Append the byte string `src` to the byte string `dst`,
|
||||||
emptying 'src' afterwards.
|
emptying 'src' afterwards.
|
||||||
|
`dst` and `src` shall reference different objects.
|
||||||
|
|
||||||
##### `uint8_t bstring_pop_back (bstring_t v)`
|
##### `uint8_t bstring_pop_back (bstring_t v)`
|
||||||
|
|
||||||
|
|||||||
@@ -958,6 +958,7 @@
|
|||||||
{ \
|
{ \
|
||||||
M_ARRA4_CONTRACT(a1); \
|
M_ARRA4_CONTRACT(a1); \
|
||||||
M_ARRA4_CONTRACT(a2); \
|
M_ARRA4_CONTRACT(a2); \
|
||||||
|
M_ASSERT(a1 != a2); \
|
||||||
if (M_LIKELY (a2->size > 0)) { \
|
if (M_LIKELY (a2->size > 0)) { \
|
||||||
size_t newSize = a1->size + a2->size; \
|
size_t newSize = a1->size + a2->size; \
|
||||||
/* To overflow newSize, we need to a1 and a2 a little bit above \
|
/* To overflow newSize, we need to a1 and a2 a little bit above \
|
||||||
|
|||||||
@@ -214,7 +214,9 @@ m_bstring_push_back_bytes (m_bstring_t v, size_t n, const void *buffer)
|
|||||||
M_INLINE void
|
M_INLINE void
|
||||||
m_bstring_splice(m_bstring_t dst, m_bstring_t src)
|
m_bstring_splice(m_bstring_t dst, m_bstring_t src)
|
||||||
{
|
{
|
||||||
|
M_BSTRING_CONTRACT (dst);
|
||||||
M_BSTRING_CONTRACT (src);
|
M_BSTRING_CONTRACT (src);
|
||||||
|
M_ASSERT(src != dst);
|
||||||
m_bstring_push_back_bytes(dst, m_bstring_size(src), m_bstr1ng_cstr(src));
|
m_bstring_push_back_bytes(dst, m_bstring_size(src), m_bstr1ng_cstr(src));
|
||||||
m_bstring_reset(src);
|
m_bstring_reset(src);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) \
|
M_F(name, _splice)(dict_t d1, dict_t d2) \
|
||||||
{ \
|
{ \
|
||||||
dict_it_t it; \
|
dict_it_t it; \
|
||||||
|
M_ASSERT(d1 != d2); \
|
||||||
/* NOTE: Despite using set_at, the accessing of the item in d1 \
|
/* 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 \
|
is not as random as other uses of the HASH table as d2 \
|
||||||
uses the same order than d1 */ \
|
uses the same order than d1 */ \
|
||||||
|
|||||||
Reference in new issue
Block a user