diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-10 14:38:58 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-25 14:06:39 +1000 |
commit | c39c8d34282b82d73c3c69a16cf0c2816256d85b (patch) | |
tree | 2874d520eec059a5ee9a1298ae18ed01fcd9d7b7 /hw | |
parent | 16ac78a53c1edeae183db8672104587b306cfe13 (diff) |
input: switch InputOption to use XF86OptionRec storage.
Use the same struct for both InputOption and XF86OptionRec so we don't need
to convert to and fro the two in the config backends.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/src/kinput.c | 9 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Option.c | 1 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Optionstr.h | 13 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 5 | ||||
-rw-r--r-- | hw/xfree86/parser/Flags.c | 5 | ||||
-rw-r--r-- | hw/xfree86/parser/Layout.c | 2 |
6 files changed, 15 insertions, 20 deletions
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 15c9ae2eb..a1bbcaace 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -49,6 +49,7 @@ #include "eventstr.h" #include "xserver-properties.h" #include "inpututils.h" +#include "optionstr.h" #define AtomFromName(x) MakeAtom(x, strlen(x), 1) @@ -1074,7 +1075,7 @@ KdParseKbdOptions (KdKeyboardInfo *ki) { InputOption *option = NULL; - nt_list_for_each_entry(option, ki->options, next) + nt_list_for_each_entry(option, ki->options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); @@ -1174,7 +1175,7 @@ KdParsePointerOptions (KdPointerInfo *pi) { InputOption *option = NULL; - nt_list_for_each_entry(option, pi->options, next) + nt_list_for_each_entry(option, pi->options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); @@ -2222,7 +2223,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes *attrs, KdPointerInfo *pi = NULL; KdKeyboardInfo *ki = NULL; - nt_list_for_each_entry(option, options, next) { + nt_list_for_each_entry(option, options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); @@ -2267,7 +2268,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes *attrs, /* FIXME: change this code below to use KdParseKbdOptions and * KdParsePointerOptions */ - nt_list_for_each_entry(option, options, next) { + nt_list_for_each_entry(option, options, list.next) { const char *key = input_option_get_key(option); const char *value = input_option_get_value(option); diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c index 73b6573f1..1a1f42ab5 100644 --- a/hw/xfree86/common/xf86Option.c +++ b/hw/xfree86/common/xf86Option.c @@ -44,6 +44,7 @@ #include "xf86Xinput.h" #include "xf86Optrec.h" #include "xf86Parser.h" +#include "optionstr.h" static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, Bool markUsed); diff --git a/hw/xfree86/common/xf86Optionstr.h b/hw/xfree86/common/xf86Optionstr.h index 8cc82d34c..fc9385617 100644 --- a/hw/xfree86/common/xf86Optionstr.h +++ b/hw/xfree86/common/xf86Optionstr.h @@ -24,16 +24,7 @@ #ifndef XF86OPTIONSTR_H #define XF86OPTIONSTR_H - -/* - * all records that need to be linked lists should contain a GenericList as - * their first field. - */ -typedef struct generic_list_rec -{ - void *next; -} -GenericListRec, *GenericListPtr, *glp; +#include "list.h" /* * All options are stored using this data type. @@ -48,6 +39,6 @@ typedef struct _XF86OptionRec } XF86OptionRec; -typedef struct _XF86OptionRec *XF86OptionPtr; +typedef struct _InputOption *XF86OptionPtr; #endif diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index ea1f92761..425b35957 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -68,6 +68,7 @@ #include "exglobals.h" #include "eventstr.h" #include "inpututils.h" +#include "optionstr.h" #include <string.h> /* InputClassMatches */ #ifdef HAVE_FNMATCH_H @@ -908,7 +909,7 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, if (!pInfo) return BadAlloc; - nt_list_for_each_entry(option, options, next) { + nt_list_for_each_entry(option, options, list.next) { if (strcasecmp(input_option_get_key(option), "driver") == 0) { if (pInfo->driver) { rval = BadRequest; @@ -946,7 +947,7 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, } } - nt_list_for_each_entry(option, options, next) { + nt_list_for_each_entry(option, options, list.next) { /* Copy option key/value strings from the provided list */ pInfo->options = xf86AddNewOption(pInfo->options, input_option_get_key(option), diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index 7a0794bb0..f0a61707b 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -63,6 +63,7 @@ #include "Configint.h" #include <X11/Xfuncproto.h> #include "Xprintf.h" +#include "optionstr.h" extern LexRec val; @@ -203,7 +204,7 @@ addNewOption2 (XF86OptionPtr head, char *name, char *val, int used) free(new->opt_val); } else - new = calloc (1, sizeof (XF86OptionRec)); + new = calloc (1, sizeof (*new)); new->opt_name = name; new->opt_val = val; new->opt_used = used; @@ -284,7 +285,7 @@ xf86newOption(char *name, char *value) { XF86OptionPtr opt; - opt = calloc(1, sizeof (XF86OptionRec)); + opt = calloc(1, sizeof (*opt)); if (!opt) return NULL; diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c index e1f770bc3..4487b0df6 100644 --- a/hw/xfree86/parser/Layout.c +++ b/hw/xfree86/parser/Layout.c @@ -63,7 +63,7 @@ #include "xf86tokens.h" #include "Configint.h" #include <string.h> - +#include "optionstr.h" /* Needed for auto server layout */ extern int xf86CheckBoolOption(void* optlist, const char *name, int deflt); |