Xi: remove superfluous cast.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
xkb: add a call to init an XkbRMLVOSet from const chars

Just forcing everything to const char* is not helpful, compiler warnings are
supposed to warn about broken code. Forcing everything to const when it
clearly isn't less than ideal.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
input: un-constify InputAttributes

Introduced in fecc7eb1cf66db64728ee2d68cd9443df7e70879 and reverts most of
that but it's helpfully mixed with other stuff.

InputAttributes are not const, they're strdup'd everywhere but the test code
and freed properly. Revert the const char changes and fix the test up instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Revert "os: xstrtokenize takes and returns const char * now"

This reverts commit d0339a5c66846c9f14e3b584e34688520a0916ab.

seriously, what the fuck? Are we making xstrdup() return a const char now too?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
input: un-constify dev->name

Fallout from fecc7eb1cf66db64728ee2d68cd9443df7e70879, and reverts most of the
rest of that patch.

The device name is allocated and may even change during PreInit. The const
warnings came from the test codes, the correct fix here is to fix the test
code.

touch.c: In function ‘touch_init’:
touch.c:254:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
     dev.name = "test device";

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Revert "xfree86/parser: make strings in xf86MatchGroup const"

This reverts commit f71de60355cc76810657f40c7b5461af86b34bf7.

What warnings?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Revert "xfree86/common: handle string constants in xf86Xinput configuration"

This reverts commit 22592855e90d23013ba7f9e945d567725cb44bf3.

What warning was this supposed to fix?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
dix: prevent a driver from initializing or submitting buttons > MAX_BUTTONS

The server internally relies on arrays with a MAX_BUTTONS maximum size (which
is the max the core protocol can transport). Make sure a driver adheres to
that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
include: make the various button array lengths more obvious

No functional changes, just making a better case for why MAP_LENGTH is 256.
"But can't we remove MAP_LENGTH then?" I hear you say? "Why, yes. Go for it!"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
dix: fix button state check before changing a button mapping

dev->button->down is a bitmask, not a normal array. Use the helper function to
check, we technically allow the mapping to change after the physical button
has been pressed (but not yet processed yet), so only check BUTTON_PROCESSED.

From XSetPointerMapping(3):
"If any of the buttons to be altered are logically in the down state,
XSetPointerMapping returns MappingBusy, and the mapping is not changed."

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
xfree86: device name and driver are not const char

Allocated in one place, freed in another.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
xfree86: un-constify inp_driver/inp_identifier

The only place this isn't allocated is during Xorg -configure where we just
statically assing "mouse"/"kbd" and the identifiers for it. Everywhere else
it's strdup'd and then free'd already.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
xfree86: unconstify another string

Only Xorg -configure uses a hardcoded value here, so let's not change the rest
of the server for that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
xfree86: unconstify driver in the XF86ConfInputClassRec

No const value is ever assigned to it, let's not pretend it's const.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
dix: fix a -Wshadow warning

dispatch.c: In function 'SetVendorString':
dispatch.c:481:29: warning: declaration of 'string' shadows a global declaration [-Wshadow]
 SetVendorString(const char *string)
                             ^
dispatch.c:135:21: warning: shadowed declaration is here [-Wshadow]
 typedef const char *string;

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
mi: fix printf warning about size_t format specifier

mieq.c:290:26: warning: format '%u' expects argument of type 'unsigned int',
but argument 2 has type 'size_t' [-Wformat=]

pnprintf supports size_t since 5ea21560dd071ea4ab87430000d087fd5fe1f092

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
xfree86: use xnfstrdup in the Xorg -configure code

Just for consistency, I'm pretty sure the code is generally not happy for
malloc failures anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Merge remote-tracking branch 'whot/for-keith'
Delete stray ; in struct _DeviceChangedEvent

Caused Solaris Studio cc to complain in every file which included it:
 "../include/eventstr.h", line 179: warning: syntax error:
  empty member declaration

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>