On Wed, Oct 6, 2021 at 5:12 PM Paul Gofman <pgofman@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@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;
>       }
>