Commit Graph

8 Commits

Author SHA1 Message Date
Hans Goudey
96dff1d3ce Fix: Warnings and build error after previous forward declaration commit 2023-12-13 10:16:07 -05:00
Sergey Sharybin
85c557ffa2 Cleanup: Rename BLI_string_utils.h to BLI_string_utils.hh
All users of it are now C++, which opens doors to add C++ to the
public API.
2023-10-20 10:27:26 +02:00
Campbell Barton
b879a4f2d8 Cleanup: replace MEM_callocN with MEM_mallocN when overwritten afterward
Also pair allocation with memcpy calls.
2023-08-05 20:06:42 +10:00
Hans Goudey
ffe4fbe832 Cleanup: Move editors headers to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110820
2023-08-05 02:57:52 +02:00
Campbell Barton
adf58a77ff Cleanup: use LISTBASE_FOREACH & LISTBASE_FOREACH_BACKWARD macros 2023-08-04 08:51:13 +10:00
Philipp Oeser
ab215965c6 Fix: python textformatting ASAN overflow
Since 3f26bdf840, `text_format_string_literal_find` is used to get the
length of the string literal. This can return -1 though and this can
lead to accessing negative index in the string afterwards.

Now, let `text_format_string_literal_find` return 0 (instead of -1) since 0
is never going to be a valid string length anyways.

Pull Request: https://projects.blender.org/blender/blender/pulls/109441
2023-06-28 14:14:04 +02:00
Guillermo Venegas
3f26bdf840 Cleanup: simplify keyword recognition in text editor
Arrays are used to eliminate the use of many nested if else's that
compare a string value against to many other strings.

These arrays are sorted to be able to perform binary searches on these
string literals arrays.

ref !108775.
2023-06-23 20:11:52 +10:00
Campbell Barton
f9e0f873bd Cleanup: move text editor files to C++
A workaround for over 128 else-if's in a row was needed for MSVC
as it caused error C1061.
2023-06-08 16:04:00 +10:00