Coverity scan detected that asserts were setting values, not checking them:
CID 53252: Side effect in assertion (ASSERT_SIDE_EFFECT)
assignment_where_comparison_intended: Assignment item->b = i * 2
has a side effect. This code will work differently in a non-debug build.
Did you intend to use a comparison ("==") instead?
CID 53259: Side effect in assertion (ASSERT_SIDE_EFFECT)
assignment_where_comparison_intended: Assignment item->a = i
has a side effect. This code will work differently in a non-debug build.
Did you intend to use a comparison ("==") instead?
CID 53260: Side effect in assertion (ASSERT_SIDE_EFFECT)
assignment_where_comparison_intended: Assignment item->a = i
has a side effect. This code will work differently in a non-debug build.
Did you intend to use a comparison ("==") instead?
CID 53261: Side effect in assertion (ASSERT_SIDE_EFFECT)
assignment_where_comparison_intended: Assignment item->b = i * 2
has a side effect. This code will work differently in a non-debug build.
Did you intend to use a comparison ("==") instead?
Fixing those to be == caused test_nt_list_insert to start failing as
part assumed append order, part assumed insert order, so it had to be
fixed to use consistent ordering.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
We never use child[2], so it's state is undefined.
This issue seems to have existed since the test was first
written: 92788e677b
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:
-bap
-psl
-T PrivatePtr
-T pmWait
-T _XFUNCPROTOBEGIN
-T _XFUNCPROTOEND
-T _X_EXPORT
The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.
The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.
The comparison was done with this script:
dir1=$1
dir2=$2
for dir in $dir1 $dir2; do
(cd $dir && find . -name '*.o' | while read file; do
dir=`dirname $file`
base=`basename $file .o`
dump=$dir/$base.dump
objdump -d $file > $dump
done)
done
find $dir1 -name '*.dump' | while read dump; do
otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
diff -u $dump $otherdump
done
Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Rename functions/macros from list_* to xorg_list_*
Rename struct from struct list to struct xorg_list.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
In-sed-I-trust: Peter Hutterer <peter.hutterer@who-t.net>
The existing list_add() prepends to the list, but in some cases we need the
list ordered in the way we append the elements.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This is a set of macros to provide a struct list-alike interface for classic
linked lists such as the XF86OptionRec or the DeviceIntRec. The typical
format for these is to have a "struct foo *next" pointer in each struct foo
and walk through those. These macros provide a few basic functions to add to,
remove from and iterate through these lists.
While struct list is in some ways more flexible, switching legacy code to
use struct list is not alway viable. These macros at least reduce the amount
of open-coded lists.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
The few features from the glib test suite we used can be replaced with
assert and printf. This patch is a simple replacement for these two
g_assert → assert
g_test_message → printf
g_test_init is removed and so is g_test_bug_base. g_test_run replaced with a
simple return 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
This has less purpose as a test but more as documentation on how to actually
use the differnent list calls.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>