Why are you using this bad/broken API?

Why are you doing an exchange without even checking the result?

Just use InterlockedAdd (but you're not accessing KdpFreeBytes safely
elsewhere, so again, you're just wasting time doing bad
synchronziation).

Best regards,
Alex Ionescu



On Wed, Oct 7, 2009 at 4:04 PM,  <[email protected]> wrote:
> Author: dgorbachev
> Date: Wed Oct  7 22:04:17 2009
> New Revision: 43333
>
> URL: http://svn.reactos.org/svn/reactos?rev=43333&view=rev
> Log:
> Fix GCC 4.1.3 warning.
>
> Modified:
>    trunk/reactos/ntoskrnl/kd/kdio.c
>
> Modified: trunk/reactos/ntoskrnl/kd/kdio.c
> URL: 
> http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdio.c?rev=43333&r1=43332&r2=43333&view=diff
> ==============================================================================
> --- trunk/reactos/ntoskrnl/kd/kdio.c [iso-8859-1] (original)
> +++ trunk/reactos/ntoskrnl/kd/kdio.c [iso-8859-1] Wed Oct  7 22:04:17 2009
> @@ -68,7 +68,7 @@
>                         KdpDebugBuffer, end, NULL, NULL);
>         }
>
> -        InterlockedExchangeAddUL(&KdpFreeBytes, num);
> +        (VOID)InterlockedExchangeAddUL(&KdpFreeBytes, num);
>     }
>  }
>
>
>
>

_______________________________________________
Ros-dev mailing list
[email protected]
http://www.reactos.org/mailman/listinfo/ros-dev

Reply via email to