eal: improve likely and unlikely macros
authorAleksey Baulin <aleksey.baulin@gmail.com>
Sun, 19 Nov 2017 22:16:04 +0000 (01:16 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 20 Jan 2018 16:47:34 +0000 (17:47 +0100)
commit7a89f8eedc052f7c4030e980bdac25ff489efbb0
treec8adb55a0510ee4df91185c3ef25f2ea821cfc81
parentcd7fc8a84b48f0f807915be02c6f4fed006fb708
eal: improve likely and unlikely macros

A warning is issued when using an argument to likely() or unlikely()
builtins which is evaluated to a pointer value, as __builtin_expect()
expects a 'long int' type for its first argument. With this fix
a pointer value is converted to an integer with the value of 0 or 1.

Signed-off-by: Aleksey Baulin <aleksey.baulin@gmail.com>
lib/librte_eal/common/include/rte_branch_prediction.h