[PATCH v4 0/2] MR6158: Replaced on simpler functions with char, wchar_t parameter if possible
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 https://gitlab.winehq.org/wine/wine/-/merge_requests/6158
From: Herman Semenov <GermanAizek(a)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; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6158
From: Herman Semenov <GermanAizek(a)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; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6158
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.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6158#note_77059
No one has reviewed this branch after fixes. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6158#note_85600
@Mystral, no one has reviewed this branch after fixes. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6158#note_85602
This MR currently has actual merge conflicts (so you should rebase it) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6158#note_85604
What's a point of these changes? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6158#note_85608
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...
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6158#note_85615
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 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6158#note_85616
participants (4)
-
Aida Jonikienė -
Herman Semenov -
Herman Semenov (@GermanAizek) -
Nikolay Sivov (@nsivov)