xfree86: switch options from pointer to XF86OptionPtr

In all cases, the pointer was simply type-cast anyway. Let's get some
compile-time type safety going, how about that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>

Squashed in:
xfree86: Move definition of xf86OptionPtr into separate header file

The pile of spaghettis that is the xfree86 include dependencies make it
rather hard to have a single typedef somewhere that's not interfering with
everything else or drags in a whole bunch of other includes.

Move the xf86OptionRec and GenericListRec declarations into a separate
header.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Peter Hutterer
2011-08-03 16:01:28 +10:00
parent 05284a03f9
commit 24823f1ab0
13 changed files with 168 additions and 134 deletions

View File

@@ -33,14 +33,15 @@
static void
xfree86_option_list_duplicate(void)
{
pointer options;
pointer duplicate;
XF86OptionPtr options;
XF86OptionPtr duplicate;
const char *o1 = "foo",
*o2 = "bar",
*v1 = "one",
*v2 = "two";
const char *o_null= "NULL";
char *val1, *val2;
XF86OptionPtr a, b;
duplicate = xf86OptionListDuplicate(NULL);
assert(!duplicate);
@@ -67,9 +68,9 @@ xfree86_option_list_duplicate(void)
assert(strcmp(val1, v2) == 0);
assert(strcmp(val1, val2) == 0);
val1 = xf86FindOption(options, o_null);
val2 = xf86FindOption(duplicate, o_null);
assert(val1 && val2);
a = xf86FindOption(options, o_null);
b = xf86FindOption(duplicate, o_null);
assert(a && b);
}
int main(int argc, char** argv)