Example my assembly with gcc -02 flag
Before: 
After: 
-- v4: d3dcompiler: replaced to char, wchar_t parameter if possible wcmdmain: replaced to char, wchar_t parameter if possible
From: Herman Semenov GermanAizek@yandex.ru
--- programs/cmd/wcmdmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 2c64785d44a..50c71857bab 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -704,7 +704,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR startchar) return WCMD_strsubstW(start, endOfVar + 1, startCopy, substrlength); /* search and replace manipulation */ } else { - WCHAR *equalspos = wcsstr(colonpos, L"="); + WCHAR *equalspos = wcschr(colonpos, '='); WCHAR *replacewith = equalspos+1; WCHAR *found = NULL; WCHAR *searchIn;
From: Herman Semenov GermanAizek@yandex.ru
--- dlls/d3dcompiler_43/compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index 6fffcfb82ab..5059deee9f1 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -176,7 +176,7 @@ static const char *get_line(const char **ptr) const char *p, *q;
p = *ptr; - if (!(q = strstr(p, "\n"))) + if (!(q = strchr(p, '\n'))) { if (!*p) return NULL;
On Thu Jul 25 16:01:22 2024 +0000, Matteo Bruni wrote:
You probably want to split this into two separate patches, possibly two separate MRs.
Done.
No one has reviewed this branch after fixes.
@Mystral, no one has reviewed this branch after fixes.
This MR currently has actual merge conflicts (so you should rebase it)
What's a point of these changes?
On Mon Oct 21 16:18:44 2024 +0000, Nikolay Sivov wrote:
What's a point of these changes?
@nsivov, more info: https://www.quora.com/Is-strstr-or-strchr-faster-If-one-is-faster-what-could...
On Mon Oct 21 16:18:44 2024 +0000, Herman Semenov wrote:
@nsivov, more info: https://www.quora.com/Is-strstr-or-strchr-faster-If-one-is-faster-what-could...
@nsivov, example diff gcc implementation
https://github.com/gcc-mirror/gcc/blob/master/libiberty/strstr.c
https://github.com/gcc-mirror/gcc/blob/master/libiberty/strchr.c