Skip to content

Trim functions - #81

Open
mwsis wants to merge 14 commits into
synesissoftware:masterfrom
mwsis:trim_functions
Open

mwsis wants to merge 14 commits into
synesissoftware:masterfrom
mwsis:trim_functions

Conversation

@mwsis

@mwsis mwsis commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

mwsis and others added 13 commits October 20, 2026 17:26
Add STLSoft_C_string_trim_{left,right,all}[_chars]_a() over
stlsoft_C_string_slice_m_t, with make-slice helpers and unit tests;
- the default trim set matches C++ trim (" \n\r\t\v");
- every zero-length result is the null slice {0, NULL};
- correct the copy_functions.h namespace-endif comment.
* 1.11.2 version elements

* fix(stlsoft): silence GCC 12+ free-nonheap warning in auto_buffer

Mark `deallocate_()` `STLSOFT_NOINLINE` on GCC 12+ so `operator delete`
stays out of the inlined destructor, and suppress `-Wfree-nonheap-object`
around the external-buffer `delete`, which GCC misattributes to the
internal buffer.

* test(stlsoft): compare a full sun_path with a counted string

A 108-character path fills Linux sun_path and is not NUL-terminated.
TEST_MS_EQ then read past the array. Use TEST_MS_EQ_N when the path
length is the capacity, as the 104-character case already does.

---------

Co-authored-by: Matt Wilson <matthew.wilson.synesis@gmail.com>
* refactor(unit-tests): applying xTests' null macros

* 1.11.2-alpha1

* `auto_buffer` extraneous warning (synesissoftware#74)

* 1.11.2 version elements

* fix(stlsoft): silence GCC 12+ free-nonheap warning in auto_buffer

Mark `deallocate_()` `STLSOFT_NOINLINE` on GCC 12+ so `operator delete`
stays out of the inlined destructor, and suppress `-Wfree-nonheap-object`
around the external-buffer `delete`, which GCC misattributes to the
internal buffer.

* test(stlsoft): compare a full sun_path with a counted string

A 108-character path fills Linux sun_path and is not NUL-terminated.
TEST_MS_EQ then read past the array. Use TEST_MS_EQ_N when the path
length is the capacity, as the 104-character case already does.

---------

Co-authored-by: Matt Wilson <matthew.wilson.synesis@gmail.com>

---------

Co-authored-by: synesissoftware <matthew@synesis.com.au>
…roughout the repo (synesissoftware#75)

* `auto_buffer` extraneous warning (synesissoftware#74)

* 1.11.2 version elements

* fix(stlsoft): silence GCC 12+ free-nonheap warning in auto_buffer

Mark `deallocate_()` `STLSOFT_NOINLINE` on GCC 12+ so `operator delete`
stays out of the inlined destructor, and suppress `-Wfree-nonheap-object`
around the external-buffer `delete`, which GCC misattributes to the
internal buffer.

* test(stlsoft): compare a full sun_path with a counted string

A 108-character path fills Linux sun_path and is not NUL-terminated.
TEST_MS_EQ then read past the array. Use TEST_MS_EQ_N when the path
length is the capacity, as the 104-character case already does.

---------

Co-authored-by: Matt Wilson <matthew.wilson.synesis@gmail.com>

* chore(nomenclature): standardise use of alpha/beta/rc nomenclature throughout the repo

---------

Co-authored-by: Matt Wilson <matthew.wilson.synesis@gmail.com>
* test(stlsoft): add exhaustive c_string unit tests

Cover strnchr, strnicmp, strnistrn, strnpbrkn, strnrchr, and strnstrn,
plus each wchar analogue, with C and C++ programs. strnistrn stays on
the current inner loop, so the first-character false-match cases fail;

* fix(stlsoft): compare each strnistrn character, not only the first

The inner loops of stlsoft_C_strnistrn() and stlsoft_C_wcsnistrn() compared
*s1 with *s2 on every index, so a first-character hit was treated as a full
match. Index the pair, and fold the wide form with towupper.

* chore(automated tests): namespace commenting

* fix(stlsoft): quiet MSVC C4310

Store high-bit c_string test bytes in unsigned char so MSVC does not warn
C4310.

---------

Co-authored-by: Matt Wilson <matthew.wilson.synesis@gmail.com>
@mwsis
mwsis requested a review from synesissoftware October 25, 2026 09:39
@mwsis mwsis self-assigned this Oct 25, 2026
Comment thread include/stlsoft/string/trim_functions.h Outdated
@mwsis
mwsis changed the base branch from master to dev October 27, 2026 05:11
@mwsis
mwsis changed the base branch from dev to master October 27, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants