mirror of
https://github.com/godotengine/godot.git
synced 2025-10-26 11:14:17 +00:00
Merge pull request #102419 from Ivorforce/std-size
Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase.
This commit is contained in:
commit
c937b6d180
33 changed files with 71 additions and 67 deletions
|
|
@ -92,7 +92,7 @@ void OS_LinuxBSD::alert(const String &p_alert, const String &p_title) {
|
|||
String program;
|
||||
|
||||
for (int i = 0; i < path_elems.size(); i++) {
|
||||
for (uint64_t k = 0; k < sizeof(message_programs) / sizeof(char *); k++) {
|
||||
for (uint64_t k = 0; k < std::size(message_programs); k++) {
|
||||
String tested_path = path_elems[i].path_join(message_programs[k]);
|
||||
|
||||
if (FileAccess::exists(tested_path)) {
|
||||
|
|
@ -769,7 +769,7 @@ Vector<String> OS_LinuxBSD::get_system_font_path_for_text(const String &p_font_n
|
|||
|
||||
Vector<String> ret;
|
||||
static const char *allowed_formats[] = { "TrueType", "CFF" };
|
||||
for (size_t i = 0; i < sizeof(allowed_formats) / sizeof(const char *); i++) {
|
||||
for (size_t i = 0; i < std::size(allowed_formats); i++) {
|
||||
FcPattern *pattern = FcPatternCreate();
|
||||
if (pattern) {
|
||||
FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue