aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkb
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xkb')
-rw-r--r--xorg-server/xkb/ddxBeep.c10
-rw-r--r--xorg-server/xkb/ddxLoad.c2
-rw-r--r--xorg-server/xkb/maprules.c73
-rw-r--r--xorg-server/xkb/xkb.c10
-rw-r--r--xorg-server/xkb/xkbAccessX.c24
-rw-r--r--xorg-server/xkb/xkbActions.c6
-rw-r--r--xorg-server/xkb/xkbEvents.c4
-rw-r--r--xorg-server/xkb/xkbInit.c12
8 files changed, 73 insertions, 68 deletions
diff --git a/xorg-server/xkb/ddxBeep.c b/xorg-server/xkb/ddxBeep.c
index f95d0ee81..caf78c94d 100644
--- a/xorg-server/xkb/ddxBeep.c
+++ b/xorg-server/xkb/ddxBeep.c
@@ -113,7 +113,7 @@ _XkbDDXBeepInitAtoms(void)
}
static CARD32
-_XkbDDXBeepExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+_XkbDDXBeepExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
DeviceIntPtr dev = (DeviceIntPtr) arg;
KbdFeedbackPtr feed;
@@ -300,11 +300,11 @@ _XkbDDXBeepExpire(OsTimerPtr timer, CARD32 now, pointer arg)
ctrl->bell_duration = duration;
ctrl->bell_pitch = pitch;
if (xkbInfo->beepCount == 0) {
- XkbHandleBell(0, 0, dev, ctrl->bell, (pointer) ctrl,
+ XkbHandleBell(0, 0, dev, ctrl->bell, (void *) ctrl,
KbdFeedbackClass, name, None, NULL);
}
else if (xkbInfo->desc->ctrls->enabled_ctrls & XkbAudibleBellMask) {
- (*dev->kbdfeed->BellProc) (ctrl->bell, dev, (pointer) ctrl,
+ (*dev->kbdfeed->BellProc) (ctrl->bell, dev, (void *) ctrl,
KbdFeedbackClass);
}
ctrl->bell_duration = oldDuration;
@@ -340,11 +340,11 @@ XkbDDXAccessXBeep(DeviceIntPtr dev, unsigned what, unsigned which)
xkbInfo->beepType = what;
xkbInfo->beepCount = 0;
- next = _XkbDDXBeepExpire(NULL, 0, (pointer) dev);
+ next = _XkbDDXBeepExpire(NULL, 0, (void *) dev);
if (next > 0) {
xkbInfo->beepTimer = TimerSet(xkbInfo->beepTimer,
0, next,
- _XkbDDXBeepExpire, (pointer) dev);
+ _XkbDDXBeepExpire, (void *) dev);
}
return 1;
}
diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c
index d462957f4..f458e3bde 100644
--- a/xorg-server/xkb/ddxLoad.c
+++ b/xorg-server/xkb/ddxLoad.c
@@ -299,7 +299,7 @@ XkbDDXLoadKeymapByNames(DeviceIntPtr keybd,
Bool
XkbDDXNamesFromRules(DeviceIntPtr keybd,
- char *rules_name,
+ const char *rules_name,
XkbRF_VarDefsPtr defs, XkbComponentNamesPtr names)
{
char buf[PATH_MAX];
diff --git a/xorg-server/xkb/maprules.c b/xorg-server/xkb/maprules.c
index 5462763d1..6f5f8ccf3 100644
--- a/xorg-server/xkb/maprules.c
+++ b/xorg-server/xkb/maprules.c
@@ -218,10 +218,10 @@ typedef struct _FileSpec {
} FileSpec;
typedef struct {
- char *model;
- char *layout[XkbNumKbdGroups + 1];
- char *variant[XkbNumKbdGroups + 1];
- char *options;
+ const char *model;
+ const char *layout[XkbNumKbdGroups + 1];
+ const char *variant[XkbNumKbdGroups + 1];
+ const char *options;
} XkbRF_MultiDefsRec, *XkbRF_MultiDefsPtr;
#define NDX_BUFF_SIZE 4
@@ -343,9 +343,9 @@ SetUpRemap(InputLine * line, RemapSpec * remap)
}
static Bool
-MatchOneOf(char *wanted, char *vals_defined)
+MatchOneOf(const char *wanted, const char *vals_defined)
{
- char *str, *next;
+ const char *str, *next;
int want_len = strlen(wanted);
for (str = vals_defined, next = NULL; str != NULL; str = next) {
@@ -469,7 +469,7 @@ CheckLine(InputLine * line,
}
static char *
-_Concat(char *str1, char *str2)
+_Concat(char *str1, const char *str2)
{
int len;
@@ -498,12 +498,13 @@ squeeze_spaces(char *p1)
static Bool
MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
{
-
+ char *options;
memset((char *) mdefs, 0, sizeof(XkbRF_MultiDefsRec));
mdefs->model = defs->model;
- mdefs->options = Xstrdup(defs->options);
- if (mdefs->options)
- squeeze_spaces(mdefs->options);
+ options = Xstrdup(defs->options);
+ if (options)
+ squeeze_spaces(options);
+ mdefs->options = options;
if (defs->layout) {
if (!strchr(defs->layout, ',')) {
@@ -511,13 +512,15 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
}
else {
char *p;
+ char *layout;
int i;
- mdefs->layout[1] = Xstrdup(defs->layout);
- if (mdefs->layout[1] == NULL)
+ layout = Xstrdup(defs->layout);
+ if (layout == NULL)
return FALSE;
- squeeze_spaces(mdefs->layout[1]);
- p = mdefs->layout[1];
+ squeeze_spaces(layout);
+ mdefs->layout[1] = layout;
+ p = layout;
for (i = 2; i <= XkbNumKbdGroups; i++) {
if ((p = strchr(p, ','))) {
*p++ = '\0';
@@ -538,13 +541,15 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
}
else {
char *p;
+ char *variant;
int i;
- mdefs->variant[1] = Xstrdup(defs->variant);
- if (mdefs->variant[1] == NULL)
+ variant = Xstrdup(defs->variant);
+ if (variant == NULL)
return FALSE;
- squeeze_spaces(mdefs->variant[1]);
- p = mdefs->variant[1];
+ squeeze_spaces(variant);
+ mdefs->variant[1] = variant;
+ p = variant;
for (i = 2; i <= XkbNumKbdGroups; i++) {
if ((p = strchr(p, ','))) {
*p++ = '\0';
@@ -564,13 +569,13 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
static void
FreeMultiDefs(XkbRF_MultiDefsPtr defs)
{
- free(defs->options);
- free(defs->layout[1]);
- free(defs->variant[1]);
+ free((void *) defs->options);
+ free((void *) defs->layout[1]);
+ free((void *) defs->variant[1]);
}
static void
-Apply(char *src, char **dst)
+Apply(const char *src, char **dst)
{
if (src) {
if (*src == '+' || *src == '!') {
@@ -596,7 +601,7 @@ XkbRF_ApplyRule(XkbRF_RulePtr rule, XkbComponentNamesPtr names)
}
static Bool
-CheckGroup(XkbRF_RulesPtr rules, char *group_name, char *name)
+CheckGroup(XkbRF_RulesPtr rules, const char *group_name, const char *name)
{
int i;
char *p;
@@ -1013,15 +1018,15 @@ XkbRF_Free(XkbRF_RulesPtr rules, Bool freeRules)
return;
if (rules->rules) {
for (i = 0, rule = rules->rules; i < rules->num_rules; i++, rule++) {
- free(rule->model);
- free(rule->layout);
- free(rule->variant);
- free(rule->option);
- free(rule->keycodes);
- free(rule->symbols);
- free(rule->types);
- free(rule->compat);
- free(rule->geometry);
+ free((void *) rule->model);
+ free((void *) rule->layout);
+ free((void *) rule->variant);
+ free((void *) rule->option);
+ free((void *) rule->keycodes);
+ free((void *) rule->symbols);
+ free((void *) rule->types);
+ free((void *) rule->compat);
+ free((void *) rule->geometry);
memset((char *) rule, 0, sizeof(XkbRF_RuleRec));
}
free(rules->rules);
@@ -1031,7 +1036,7 @@ XkbRF_Free(XkbRF_RulesPtr rules, Bool freeRules)
if (rules->groups) {
for (i = 0, group = rules->groups; i < rules->num_groups; i++, group++) {
- free(group->name);
+ free((void *) group->name);
free(group->words);
}
free(rules->groups);
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c
index 408775039..5d74aab7f 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -369,7 +369,7 @@ _XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin,
int percent, int forceSound, int eventOnly, Atom name)
{
int base;
- pointer ctrl;
+ void *ctrl;
int oldPitch, oldDuration;
int newPercent;
@@ -389,7 +389,7 @@ _XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin,
return BadValue;
}
base = k->ctrl.bell;
- ctrl = (pointer) &(k->ctrl);
+ ctrl = (void *) &(k->ctrl);
oldPitch = k->ctrl.bell_pitch;
oldDuration = k->ctrl.bell_duration;
if (pitch != 0) {
@@ -421,7 +421,7 @@ _XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin,
return BadValue;
}
base = b->ctrl.percent;
- ctrl = (pointer) &(b->ctrl);
+ ctrl = (void *) &(b->ctrl);
oldPitch = b->ctrl.pitch;
oldDuration = b->ctrl.duration;
if (pitch != 0) {
@@ -4414,7 +4414,7 @@ ProcXkbSetNames(ClientPtr client)
* (swapped) 16 bit string length, non-zero terminated.
*/
static char *
-XkbWriteCountedString(char *wire, char *str, Bool swap)
+XkbWriteCountedString(char *wire, const char *str, Bool swap)
{
CARD16 len, *pLen, paddedLen;
@@ -6816,7 +6816,7 @@ ProcXkbDispatch(ClientPtr client)
}
static int
-XkbClientGone(pointer data, XID id)
+XkbClientGone(void *data, XID id)
{
DevicePtr pXDev = (DevicePtr) data;
diff --git a/xorg-server/xkb/xkbAccessX.c b/xorg-server/xkb/xkbAccessX.c
index 13051e034..cb4bca008 100644
--- a/xorg-server/xkb/xkbAccessX.c
+++ b/xorg-server/xkb/xkbAccessX.c
@@ -279,7 +279,7 @@ AccessXStickyKeysTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN)
} /* AccessXStickyKeysTurnOff */
static CARD32
-AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+AccessXKRGExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
xkbControlsNotify cn;
DeviceIntPtr dev = arg;
@@ -309,7 +309,7 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
}
static CARD32
-AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
DeviceIntPtr dev = (DeviceIntPtr) arg;
XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
@@ -331,7 +331,7 @@ AccessXCancelRepeatKey(XkbSrvInfoPtr xkbi, KeyCode key)
}
static CARD32
-AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
DeviceIntPtr keybd;
XkbSrvInfoPtr xkbi;
@@ -370,7 +370,7 @@ AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg)
xkbi->repeatKeyTimer = TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay,
AccessXRepeatKeyExpire,
- (pointer) keybd);
+ (void *) keybd);
}
}
}
@@ -378,7 +378,7 @@ AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg)
}
static CARD32
-AccessXBounceKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+AccessXBounceKeyExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
XkbSrvInfoPtr xkbi = ((DeviceIntPtr) arg)->key->xkbInfo;
@@ -387,7 +387,7 @@ AccessXBounceKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg)
}
static CARD32
-AccessXTimeoutExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+AccessXTimeoutExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
DeviceIntPtr dev = (DeviceIntPtr) arg;
XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
@@ -467,12 +467,12 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd)
if (XkbAX_NeedFeedback(ctrls, XkbAX_SlowWarnFBMask)) {
xkbi->krgTimerActive = _KRG_WARN_TIMER;
xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 4000,
- AccessXKRGExpire, (pointer) keybd);
+ AccessXKRGExpire, (void *) keybd);
}
else {
xkbi->krgTimerActive = _KRG_TIMER;
xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 8000,
- AccessXKRGExpire, (pointer) keybd);
+ AccessXKRGExpire, (void *) keybd);
}
if (!(ctrls->enabled_ctrls & XkbSlowKeysMask)) {
CARD32 now = GetTimeInMillis();
@@ -514,7 +514,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd)
xkbi->slowKey = key;
xkbi->slowKeysTimer = TimerSet(xkbi->slowKeysTimer,
0, ctrls->slow_keys_delay,
- AccessXSlowKeyExpire, (pointer) keybd);
+ AccessXSlowKeyExpire, (void *) keybd);
ignoreKeyEvent = TRUE;
}
@@ -546,7 +546,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd)
xkbi->repeatKeyTimer = TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay,
AccessXRepeatKeyExpire,
- (pointer) keybd);
+ (void *) keybd);
}
}
}
@@ -608,7 +608,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd)
xkbi->bounceKeysTimer = TimerSet(xkbi->bounceKeysTimer, 0,
ctrls->debounce_delay,
AccessXBounceKeyExpire,
- (pointer) keybd);
+ (void *) keybd);
}
/* Don't transmit the KeyRelease if SlowKeys is turned on and
@@ -651,7 +651,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd)
xkbi->lastPtrEventTime = 0;
xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0,
ctrls->ax_timeout * 1000,
- AccessXTimeoutExpire, (pointer) keybd);
+ AccessXTimeoutExpire, (void *) keybd);
xkbi->krgTimerActive = _ALL_TIMEOUT_TIMER;
}
else if (xkbi->krgTimerActive != _OFF_TIMER) {
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c
index 09f8e489b..3fbf05183 100644
--- a/xorg-server/xkb/xkbActions.c
+++ b/xorg-server/xkb/xkbActions.c
@@ -51,7 +51,7 @@ static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x,
int y);
void
-xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, pointer data)
+xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, void *data)
{
xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device);
ProcessInputProc backupproc;
@@ -470,7 +470,7 @@ _XkbFilterISOLock(XkbSrvInfoPtr xkbi,
}
static CARD32
-_XkbPtrAccelExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+_XkbPtrAccelExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
XkbSrvInfoPtr xkbi = (XkbSrvInfoPtr) arg;
XkbControlsPtr ctrls = xkbi->desc->ctrls;
@@ -540,7 +540,7 @@ _XkbFilterPointerMove(XkbSrvInfoPtr xkbi,
xkbi->mouseKeysDY = XkbPtrActionY(&pAction->ptr);
xkbi->mouseKeyTimer = TimerSet(xkbi->mouseKeyTimer, 0,
xkbi->desc->ctrls->mk_delay,
- _XkbPtrAccelExpire, (pointer) xkbi);
+ _XkbPtrAccelExpire, (void *) xkbi);
}
else if (filter->keycode == keycode) {
filter->active = 0;
diff --git a/xorg-server/xkb/xkbEvents.c b/xorg-server/xkb/xkbEvents.c
index 66a6e1509..e2ba38886 100644
--- a/xorg-server/xkb/xkbEvents.c
+++ b/xorg-server/xkb/xkbEvents.c
@@ -480,7 +480,7 @@ XkbHandleBell(BOOL force,
BOOL eventOnly,
DeviceIntPtr kbd,
CARD8 percent,
- pointer pCtrl,
+ void *pCtrl,
CARD8 class, Atom name, WindowPtr pWin, ClientPtr pClient)
{
xkbBellNotify bn;
@@ -500,7 +500,7 @@ XkbHandleBell(BOOL force,
if ((force || (xkbi->desc->ctrls->enabled_ctrls & XkbAudibleBellMask)) &&
(!eventOnly)) {
if (kbd->kbdfeed->BellProc)
- (*kbd->kbdfeed->BellProc) (percent, kbd, (pointer) pCtrl, class);
+ (*kbd->kbdfeed->BellProc) (percent, kbd, (void *) pCtrl, class);
}
interest = kbd->xkb_interest;
if ((!interest) || (force))
diff --git a/xorg-server/xkb/xkbInit.c b/xorg-server/xkb/xkbInit.c
index b7c521b12..d3bcbc9f2 100644
--- a/xorg-server/xkb/xkbInit.c
+++ b/xorg-server/xkb/xkbInit.c
@@ -129,11 +129,11 @@ XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO)
if (!rmlvo)
return;
- free(rmlvo->rules);
- free(rmlvo->model);
- free(rmlvo->layout);
- free(rmlvo->variant);
- free(rmlvo->options);
+ free((void *) rmlvo->rules);
+ free((void *) rmlvo->model);
+ free((void *) rmlvo->layout);
+ free((void *) rmlvo->variant);
+ free((void *) rmlvo->options);
if (freeRMLVO)
free(rmlvo);
@@ -142,7 +142,7 @@ XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO)
}
static Bool
-XkbWriteRulesProp(ClientPtr client, pointer closure)
+XkbWriteRulesProp(ClientPtr client, void *closure)
{
int len, out;
Atom name;