Fix Clang style nits (GH-17685)

This addresses all `-Wlogical-op-parentheses` and `-Wmissing-braces`
warnings across the whole code base (all Windows specific code).
This commit is contained in:
Christoph M. Becker 2025-02-05 14:13:56 +01:00 committed by GitHub
parent dc7161cffe
commit 107bd080a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 12 additions and 13 deletions

View file

@ -137,8 +137,8 @@ PHPAPI int fnmatch(const char *pattern, const char *string, int flags)
tolower((unsigned char)*string)))
;
else if ((flags & FNM_PREFIX_DIRS) && *string == EOS &&
(c == '/' && string != stringstart ||
string == stringstart+1 && *stringstart == '/') )
((c == '/' && string != stringstart) ||
(string == stringstart+1 && *stringstart == '/')))
return (0);
else
return (FNM_NOMATCH);

View file

@ -59,7 +59,7 @@ DIR *opendir(const char *dir)
wcscpy(filespecw, resolvedw);
index = resolvedw_len - 1;
}
if (index >= 0 && filespecw[index] == L'/' || index == 0 && filespecw[index] == L'\\')
if ((index >= 0 && filespecw[index] == L'/') || (index == 0 && filespecw[index] == L'\\'))
filespecw[index] = L'\0';
wcscat(filespecw, L"\\*");

View file

@ -459,7 +459,7 @@ static zend_always_inline BOOL is_compatible(HMODULE handle, BOOL is_smaller, ch
This check is to be extended as new VS versions come out. */
DWORD core_minor = (DWORD)(PHP_LINKER_MINOR/10);
DWORD comp_minor = (DWORD)(minor/10);
if (14 == major && (is_smaller ? core_minor < comp_minor : core_minor > comp_minor) || PHP_LINKER_MAJOR != major)
if ((14 == major && (is_smaller ? core_minor < comp_minor : core_minor > comp_minor)) || PHP_LINKER_MAJOR != major)
#else
if (PHP_LINKER_MAJOR != major)
#endif