Commit Graph

18 Commits

Author SHA1 Message Date
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Nikita Nemkin
5d039f3be3 regex: Match ^ at most once in repeated searches
When doing successive matches, track the input start and current search
start positions separately to prevent the `^` anchor from matching in
the middle of the string.  Add policy CMP0186 to provide compatibility.

Issue: #26629
Fixes: #16899
2025-02-13 20:00:02 +05:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Daniel Pfeifer
58c5f77837 clang-tidy: fix readability-redundant-* warnings 2024-10-11 15:37:21 +02:00
Alex Richardson
e563201f9e cmList: Use ptrdiff_t for index_type
In commit 87fe031a07 (cmList class: various enhancements, 2023-04-26,
v3.27.0-rc1~142^2~1) this changed from `int` to `intptr_t`, but on some
systems (e.g. CHERI-enabled Arm or RISC-V), `intptr_t` is larger than 64
bits and using it for `index_type` here incurs an unnecessary
performance penalty.  Additionally, using `intptr_t` here results in an
ambiguous overload while calling `cmStrCat` with `intptr_t`: `error:
conversion from '__intcap' to 'const cmAlphaNum' is ambiguous`.

Instead of adding `intptr_t` overloads for `cmAlphaNum` for CHERI
systems, we can change the type to `ptrdiff_t` (which will be the same
as `intptr_t` on all other systems) and avoid carrying diffs that only
compile with a CHERI enabled compiler.
2024-03-08 09:49:03 -05:00
Brad King
641c02a3ce cmList: Avoid using operator-> on input iterator
As of C++23, some standard library iterator types deprecate it.
2023-11-07 09:13:25 -05:00
Matthew Woehlke
7b3464320f Reduce sign conversion warnings
Add some static casts to make explicit some sign conversions in order to
avoid warnings about the same. This is by no means an attempt to fix all
such warnings, but these instances were especially egregious as they
would be raised across many source files.

Also change a post-increment of an iterator to pre-increment. At worst,
this does nothing, but pre-increment is potentially more efficient.
2023-08-29 15:57:24 -04:00
Brad King
4ee45988cb Merge topic 'cmList-INSERT-regression'
45ed175f08 list(INSERT): restore old behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8732
2023-08-19 08:37:09 -04:00
Marc Chevrier
45ed175f08 list(INSERT): restore old behavior
Fixes: #25191
2023-08-17 12:07:41 +02:00
Marc Chevrier
a9a34edc82 cmList: Fix performance regression in append/prepend
Fixes: #25147
2023-08-04 09:55:47 +02:00
Marc Chevrier
7f9f96151a cmList: Fix performance regression in append/prepend
Fixes: #25147
2023-08-04 09:52:08 +02:00
Nicolas van Kempen
a6e8811cf0 cmList: Fix performance regression in Join / to_string
Refactoring in commit 45f17e5a85 (cmList: Add container conversion to
string, 2023-06-20) accidentally introduced unnecessary string copies
and allocations. Remove unnecessary copies.
2023-07-06 11:23:58 -04:00
Marc Chevrier
45f17e5a85 cmList: Add container conversion to string 2023-06-22 15:44:17 +02:00
Marc Chevrier
1cfaed0684 list(): restore SUBLIST behavior
Fixes: #25002
2023-06-16 15:14:03 +02:00
Marc Chevrier
241304190f CMake code rely on cmList class for CMake lists management (part. 2) 2023-04-29 09:54:31 +02:00
Marc Chevrier
87fe031a07 cmList class: various enhancements 2023-04-29 09:54:22 +02:00
Marc Chevrier
51b0d45d91 cmExpandList and cmExpandLists rely on cmList class 2023-04-23 14:48:36 +02:00
Marc Chevrier
9f60f19ee9 cmList: CMake list implementation
Fixes: #24548
2023-04-05 17:54:55 +02:00