Commit Graph
198 Commits
Author SHA1 Message Date
Patrick Pelissier 61f8dcdbae Add string_set_char function 2021-09-22 23:07:35 +02:00
Patrick Pelissier 8ce59c2e9d Maintenance:
* update comments
* simplify code.
2021-08-07 00:34:18 +02:00
Patrick Pelissier e46bbaffb9 Avoid GCC warning (-Wstringop-truncation) 2021-07-05 23:14:21 +02:00
Patrick Pelissier 408959c927 Be more precise in the bound check. 2021-07-05 22:32:19 +02:00
Patrick Pelissier a5b6d8e391 Rewrite assertion to be more robust. 2021-07-04 00:20:10 +02:00
Patrick Pelissier 3ac08b0395 Add test with a lot of different kind of M_LET with list of strings. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 154b503bc6 Avoid using the input more than once in macros string_init_* (Avoid issues) 2021-07-01 22:12:15 +02:00
Patrick Pelissier 0535ceeaeb Add support of string_t by M_PRINT macro. 2021-06-19 22:46:41 +02:00
Patrick Pelissier 5d4fa31083 Update doc & comments 2021-03-28 11:48:58 +02:00
Patrick Pelissier 07db846f3b Rename internal string functions to be compliant with new scheme. Not sure if this scheme will remain however (still searching for a better naming that fits all criteria). 2021-03-01 22:18:32 +01:00
Patrick Pelissier 517da1b999 Rename generated internal functions
to avoid "poluting" userspace naming.
2021-02-13 11:45:05 +01:00
Patrick Pelissier 25fe26deaa Happy new year 2021-01-13 20:18:01 +01:00
Patrick Pelissier cd357c5eb7 Rewrite the wrappers of strncpy & strncat:
Add one argument about the allocation of the dest buffer
Theses wrappers are internal (so no impact to API)
and only used in a few place in m-string.
This make the wrappers able to use the function
strncpy_s & strncat_s for MSVC rather than using
reimplementation of the original functions.
2021-01-13 08:34:47 +01:00
Patrick Pelissier 8a9d5f6a00 Add macro string_sets (like string_cats) 2021-01-10 09:51:38 +01:00
Patrick Pelissier 5f05c1e169 Make stdarg an optional header. Some works remain to do to make stdio fully optional 2021-01-10 09:40:37 +01:00
Patrick Pelissier ffc2ec8c4b Fix format 2021-01-10 09:25:27 +01:00
Patrick Pelissier eabc867c2a Rename used namespace for C++ to m_lib 2021-01-10 08:48:46 +01:00
Patrick Pelissier a42b854f14 Add macro string_cats to concat multiple strings 2021-01-07 22:13:10 +01:00
Patrick Pelissier 1b4c608087 Rename operator TEST_EMPTY into EMPTY_P to be compliant with iterator operator 2021-01-07 22:13:10 +01:00
Patrick Pelissier 1671ca8d67 Add more assertions 2020-12-21 15:16:16 +01:00
Patrick Pelissier f5bc8796f7 Add functions:
* string_vprintf
* string_init_vprintf
2020-12-15 22:14:43 +01:00
Patrick Pelissier 5f0b6b9f26 Fix format 2020-12-05 12:42:45 +01:00
Patrick Pelissier de2268c406 Factorization of comparaison by using memcmp 2020-11-29 20:06:56 +01:00
Patrick Pelissier 2a28f8d407 Add string_init_printf 2020-11-25 22:41:11 +01:00
Patrick Pelissier b343d356c3 Add support for empty replaced string 2020-11-22 23:29:38 +01:00
Patrick Pelissier 2e4404ca7e Fix a (strange) warning for gcc 8 without assertions.
Add back the assertions as compile hints.
2020-11-22 23:20:04 +01:00
Patrick Pelissier 29eebaf38d Factorization of the allocation. 2020-11-22 23:11:09 +01:00
Patrick Pelissier d0d69aebfa Add final null char in computation of the needed size for the new function _replace_all 2020-11-22 23:09:37 +01:00
Patrick Pelissier 55e7b3083a Add function string_replace_all[_str]
to replace all occurences of a string by another.
2020-11-22 23:04:32 +01:00
Patrick Pelissier d898d6d4cc Remove duplicate function 2020-11-21 10:26:02 +01:00
Patrick Pelissier 45f8b31efc Add function string_subset 2020-11-19 22:31:33 +01:00
Patrick Pelissier b0a74f162e Fix string_printf in case of error in formating. 2020-11-05 22:51:28 +01:00
Patrick Pelissier d169a06f79 Rename STRING_ASSERT_SLOW into M_ASERT_SLOW 2020-10-31 17:30:14 +01:00
Patrick Pelissier a29682ca29 Create M_ASSERT macro to encapsulate assert within M*LIB
The goal is to enable the user to override this macro if needed so that it can enable or disable the M*LIB witout impacting its own assertions.
2020-10-29 22:46:17 +01:00
Patrick Pelissier 22ce001f03 Remove incorrect use of M_ASSUME by assert 2020-10-24 23:14:14 +02:00
Patrick Pelissier 5e658a81fe Adding INIT_WITH support for bounded string within M_LET 2020-10-24 14:03:27 +02:00
Patrick Pelissier 27bb62533a Use of M_ASSERT_INDEX
to validate user input.
2020-10-21 23:57:52 +02:00
Patrick Pelissier 54d4b80368 Reformat macro to 80 characters 2020-10-21 23:23:40 +02:00
Patrick Pelissier 35718ae551 Rename type as internal types 2020-10-03 14:07:14 +02:00
Patrick Pelissier b3a1a75f6f Rename internal types:
a suffix ending with _ct means confidential type
ans is reserved for M*LIB internal usage.

OPLIST doesn't use the external types
but rather the internal types.
It enables to be independent of the real names
of the external types.
Such external names are planned to be fully customizable
(i.e. the user may define a name that suits its coding style)
2020-10-03 14:07:14 +02:00
Patrick Pelissier 5f9feb833c Replace TAB by SPACE 2020-07-25 19:17:25 +02:00
Patrick Pelissier 56d2a74818 Fix some warnings 2020-07-09 23:38:34 +02:00
Patrick Pelissier 8a36b5ff15 Workaround to avoid CLANG unused function warnings 2020-07-09 22:14:00 +02:00
Patrick Pelissier f2a06ede62 Add mechanism to disable temporary compiler warnings in a sequence of code. 2020-07-01 11:47:55 +02:00
Patrick Pelissier dfbf34daf6 Remove a warning with some compiler by encoding 0 as UINT_MAX+1 2020-06-26 23:48:59 +02:00
Patrick Pelissier 9784a16d47 Get ride of modular arithmetic 2020-06-26 00:25:15 +02:00
Patrick Pelissier 68788a6fb8 Add M_ENUM_OPLIST 2020-06-24 21:13:13 +02:00
Patrick Pelissier cc6da8941c * Fix wanings for reduce precision on integers.
* Add wrapper for strncat
2020-06-22 00:14:37 +02:00
Patrick Pelissier 4f4605befb Use of Annex K for MSVS to reduce warnings. 2020-06-21 23:36:34 +02:00
Patrick Pelissier 3f84f54d65 Add casts to avoid some compiler warnings
if the compiler is not able to detect the cast if safe.
2020-06-21 23:03:40 +02:00