[PATCH 1/1] dlls/ntdll: Remove dead code

David K. k.kahurani at gmail.com
Wed Oct 6 10:45:18 CDT 2021


This trick only occurs once. Haven't seen this anywhere else in the code.
Why this specific function?

Don't you people suppose other code might benefit from this?

On Wed, Oct 6, 2021 at 5:24 PM David K. <k.kahurani at gmail.com> wrote:

>
>
> On Wed, Oct 6, 2021 at 5:12 PM Paul Gofman <pgofman at codeweavers.com>
> wrote:
>
>> On 10/6/21 17:01, David Kahurani wrote:
>> > The if clause here does not make much sense and
>> > would probably get optimized out by a smart compiler
>>
>> Can you please explain why it would be optimized out, exactly? if clause
>> does make some sense, it makes fixme: displayed just once per process
>> instead of spamming it great amount of times.
>>
>
> Didn't take into consideration the storage specifier, sorry and thanks for
> pointing that out.
>
> Without the storage classifier static this would have been dead code. In
> other words, code always gives the same result in which case a compiler
> would replace it with the result instead.
>
>
>>
>> > Signed-off-by: David Kahurani <k.kahurani at gmail.com>
>> > ---
>> >   dlls/ntdll/unix/system.c | 6 +-----
>> >   1 file changed, 1 insertion(+), 5 deletions(-)
>> >
>> > diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
>> > index 82c9f0d..88050fb 100644
>> > --- a/dlls/ntdll/unix/system.c
>> > +++ b/dlls/ntdll/unix/system.c
>> > @@ -2399,7 +2399,6 @@ NTSTATUS WINAPI NtQuerySystemInformation(
>> SYSTEM_INFORMATION_CLASS class,
>> >       case SystemPerformanceInformation:  /* 2 */
>> >       {
>> >           SYSTEM_PERFORMANCE_INFORMATION spi;
>> > -        static BOOL fixme_written = FALSE;
>> >
>> >           get_performance_info( &spi );
>> >           len = sizeof(spi);
>> > @@ -2409,10 +2408,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
>> SYSTEM_INFORMATION_CLASS class,
>> >               else memcpy( info, &spi, len);
>> >           }
>> >           else ret = STATUS_INFO_LENGTH_MISMATCH;
>> > -        if(!fixme_written) {
>> > -            FIXME("info_class SYSTEM_PERFORMANCE_INFORMATION\n");
>> > -            fixme_written = TRUE;
>> > -        }
>> > +        FIXME("info_class SYSTEM_PERFORMANCE_INFORMATION\n");
>> >           break;
>> >       }
>> >
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20211006/928b4893/attachment-0001.htm>


More information about the wine-devel mailing list