Patrick Pelissier
2089af8fd3
Fix broken code due to previous commits.
2018-01-24 22:26:46 +01:00
Patrick Pelissier
0b44a55b6a
Replace method EXPECTED_SIZE by INC_ALLOC so that all the way of increasing
...
the size in case of reallocation can be configured and not only the minimum
size.
2017-09-16 18:46:22 +02:00
Patrick Pelissier
95f467f4be
Fix potential bug in case of ill-formed serialized container.
2017-09-16 13:30:09 +02:00
Patrick Pelissier
2e564088b0
Simplify the inclusion of headers.
2017-09-16 10:14:45 +02:00
Patrick Pelissier
1930bdeac1
_DEF macros checks if a global oplist is register if there is no one
...
given in the macro call. If it founds one, it will be it instead
of M_DEFAULT_OPLIST.
2017-09-16 08:31:22 +02:00
Patrick Pelissier
6c71265c8b
Minor cleanup
2017-09-11 22:54:31 +02:00
Patrick Pelissier
a6a89f269f
Simplify code.
2017-09-11 22:49:48 +02:00
Patrick Pelissier
44cdfa0c77
Remove use of feof and ferror as it is not needed as the return of fgetc
...
is sufficent.
2017-08-19 21:05:55 +02:00
Patrick Pelissier
cad4d92a00
_set of a aarray will create only a copy which fits exactly in
...
what is needed. No need for extra space.
2017-08-18 21:25:25 +02:00
Patrick Pelissier
ffc383884d
Add macro M_HASH_FINAL
2017-08-17 20:22:01 +02:00
Patrick Pelissier
32d5f7037b
Fix issue: _insert didn't insert after the iterators.
2017-08-14 19:52:04 +02:00
Patrick Pelissier
14c50a5b9a
Fix overflow issues when computing new size for the array.
2017-08-06 22:39:42 +02:00
Patrick Pelissier
f8a1832fce
Fix conflict between the specialized version of sort in array
...
and the generic version in algo so that we can use the same
prefix for both generation.
2017-07-27 22:19:27 +02:00
Patrick Pelissier
34943e5b2a
Remove array_ prefix from ARRAY_DEF
...
See commit on shared pointers.
2017-07-27 22:16:15 +02:00
Patrick Pelissier
6b90342297
Fix forgotten assertion.
...
Replace fprintf by fputc (faster)
2017-07-11 14:55:23 +02:00
Patrick Pelissier
f08685b097
Fix issue with reserve for array.
2017-07-11 09:32:44 +02:00
Patrick Pelissier
7d00caac83
Add const to iterators:
...
in fact, a const array for an iterator just means that it
can't modify the order of the container (And that's what we want).
It can still modify the pointed object.
2017-07-07 22:57:13 +02:00
Patrick Pelissier
64f3fc380e
Update _insert prototype of array to match list _insert.
2017-07-07 22:53:42 +02:00
Patrick Pelissier
2155df7d6f
Fix bug detected by previous test.
2017-07-06 10:26:14 +02:00
Patrick Pelissier
93ff9c79b9
Rewrite comment (bis)
2017-07-06 10:20:13 +02:00
Patrick Pelissier
8bfb57cdb6
Rewrite comment
2017-07-06 10:19:57 +02:00
Patrick Pelissier
c3114c439b
Remove a contract from _clear since it has not to be true.
...
Add const to a proto.
2017-07-06 10:19:08 +02:00
Patrick Pelissier
dbe24395f4
Add 'const' to _out_str & _equal_p
...
(==> rewrite the iteration loop)
2017-07-05 22:15:12 +02:00
Patrick Pelissier
6f21ee9098
Add TODO
2017-07-05 16:13:48 +02:00
Patrick Pelissier
b3a4ffb962
Use of M_CONST_CAST for array.
2017-05-26 15:44:28 +02:00
Patrick Pelissier
0089b9fe83
Remove last eol
2017-05-24 11:52:41 +02:00
Patrick Pelissier
5386f9a2f7
Update comments.
...
Update hash function.
2017-05-24 11:47:35 +02:00
Patrick Pelissier
3e62d6c719
Export IT_REMOVE operator from array & list
2017-05-22 21:23:39 +02:00
Patrick Pelissier
d345284faf
Uniformization with list _remove operator.
2017-05-22 21:20:16 +02:00
Patrick Pelissier
e1b1f5e861
remove expects now an iterator.
...
<== Uniformisation of the containers.
(List expect an iterator too).
2017-05-22 19:25:30 +02:00
Patrick Pelissier
a65c80d25a
Fix bug in insert_v (missing initialisation).
...
Update API of insert_v to give the number of elements to insert (much more logic).
2017-05-02 20:17:16 +02:00
Patrick Pelissier
afae256429
Add missing assertion
2017-05-02 20:13:42 +02:00
Patrick Pelissier
b085b97c20
Define & use ARRAYI_CONTRACT for proper contract checking.
2017-04-23 09:58:58 +02:00
Patrick Pelissier
206f797e8f
Rewrite the array to simplify the code and make it easier to read.
2017-04-23 09:42:40 +02:00
Patrick Pelissier
418d868b1d
Remove shrink_to_fit which is useless as reserve performs its role now too.
2017-04-14 11:32:17 +02:00
Patrick Pelissier
f69130bb06
Add reserve operation.
2017-04-14 01:24:22 +02:00
Patrick Pelissier
da5691da40
Fix bug in function (invert i & j)
2017-04-13 23:05:13 +02:00
Patrick Pelissier
4991386bb7
Add FREE operator.
...
Use it instead of DEL if necessary.
2017-04-06 01:21:11 +02:00
Patrick Pelissier
ebf24d41cf
Export back NEW / DEL / REALLOC of oplist to container oplist
2017-03-30 20:57:44 +02:00
Patrick Pelissier
8f94c56c49
Add some likely / unlikely for some tests.
2017-03-27 21:48:17 +02:00
Patrick Pelissier
32d22fef51
EXPECTED_SIZE can be overloaded by oplist now.
2017-03-23 21:51:31 +01:00
Patrick Pelissier
fdd7f9d19d
Rewrite the computation of the size of the array to be more flexible.
2017-03-23 21:39:44 +01:00
Patrick Pelissier
00f912a504
Replace M_MEMORY_ALLOC / M_MEMORY_FREE by M_GET_NEW / M_GET_DEL
...
It allows a dual layer of overloading for the memory.
2017-03-19 22:15:01 +01:00
Patrick Pelissier
7b6dd872c6
Export swap operators for array & list
2017-03-14 20:23:55 +01:00
Patrick Pelissier
ecf5547c1e
Rename _swap into _swap_at
...
Add _swap function.
2017-03-14 20:16:38 +01:00
Patrick Pelissier
8dd7ba113a
Add FIXME
2017-03-13 12:32:11 +01:00
Patrick Pelissier
eaf3af8c07
Implement IT_END operator.
...
Add missing IT_LAST operator
2017-03-13 10:32:57 +01:00
Patrick Pelissier
e21b45d9ac
Fix #3 (Empty containers & IN_STR operator).
2017-03-10 01:29:49 +01:00
Patrick Pelissier
320977e1fa
Fix bug in case of empty array and the type doesn't flush the stream.
2017-03-09 22:35:29 +01:00
Patrick Pelissier
14311272ca
Minor cosmetics change
2017-03-07 22:57:44 +01:00