Removes some annoying casts.
Signed-off-by: Ran Benita <ran234@gmail.com>
info->def.next = (CommonInfo *) * info_in;
memcpy(info->alias, def->alias, XkbKeyNameLength);
memcpy(info->real, def->real, XkbKeyNameLength);
- *info_in = (AliasInfo *) AddCommonInfo(&(*info_in)->def, &info->def);
+ *info_in = AddCommonInfo(&(*info_in)->def, &info->def);
return true;
}
info->dflt.interp.act.any.data[i] = 0;
ClearIndicatorMapInfo(keymap->ctx, &info->ledDflt);
info->nInterps = 0;
- info->interps = (SymInterpInfo *) ClearCommonInfo(&info->interps->defs);
+ info->interps = ClearCommonInfo(&info->interps->defs);
memset(&info->groupCompat[0], 0,
XkbNumKbdGroups * sizeof(GroupCompatInfo));
- info->leds = (LEDInfo *) ClearCommonInfo(&info->leds->defs);
+ info->leds = ClearCommonInfo(&info->leds->defs);
while (info->act) {
next = info->act->next;
free(info->act);
if (si)
{
memset(si, 0, sizeof(SymInterpInfo));
- info->interps =
- (SymInterpInfo *) AddCommonInfo(&info->interps->defs,
- (CommonInfo *) si);
+ info->interps = AddCommonInfo(&info->interps->defs, &si->defs);
info->nInterps++;
}
return si;
if (ii)
{
InitIndicatorNameInfo(ii, info);
- info->leds = (IndicatorNameInfo *) AddCommonInfo(&info->leds->defs,
- (CommonInfo *) ii);
+ info->leds = AddCommonInfo(&info->leds->defs, &ii->defs);
}
return ii;
}
{
FreeKeyTypeInfo(type);
}
- info->types = (KeyTypeInfo *) ClearCommonInfo(&info->types->defs);
+ info->types = ClearCommonInfo(&info->types->defs);
}
FreeKeyTypeInfo(&info->dflt);
}
{
memset(type, 0, sizeof(KeyTypeInfo));
type->defs.fileID = info->fileID;
- info->types = (KeyTypeInfo *) AddCommonInfo(&info->types->defs,
- (CommonInfo *) type);
+ info->types = AddCommonInfo(&info->types->defs, &type->defs);
info->nTypes++;
}
return type;
}
*old = *new;
old->matchingMapIndex = -1;
- type->preserve =
- (PreserveInfo *) AddCommonInfo(&type->preserve->defs, &old->defs);
+ type->preserve = AddCommonInfo(&type->preserve->defs, &old->defs);
return true;
}
return useNew;
}
-char *
+void *
ClearCommonInfo(CommonInfo * cmn)
{
if (cmn != NULL)
return NULL;
}
-char *
+void *
AddCommonInfo(CommonInfo * old, CommonInfo * new)
{
CommonInfo *first;
if (old)
{
old->next = new;
- return (char *) first;
+ return first;
}
- return (char *) new;
+ return new;
}
/***====================================================================***/
UseNewField(unsigned field, CommonInfo *oldDefs, CommonInfo *newDefs,
unsigned *pCollide);
-extern char *
+extern void *
ClearCommonInfo(CommonInfo *cmn);
-extern char *
+extern void *
AddCommonInfo(CommonInfo *old, CommonInfo *new);
extern int