[lkml]   [2003]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] 2.4.22pre10: {,un}likely_p() macros for pointers
Willy Tarreau wrote:
> It may well be when you use it in boolean constructs. The following functions
> return exactly the same result with different code :
> int test1(int u, int v, int x, int y) {
> return (u > v) || (x > y);
> }
> int test2(int u, int v, int x, int y) {
> return !!(u > v) | !!(x > y);
> }

Yes, it sounds familiar. Although my code was not as contrived :) it
was from a real program. Also, try "x != 0" instead of "!!x" and see
if you get different results.

-- Jamie
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:47    [W:0.029 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site