From: Dan Nicholson Date: Sat, 28 Mar 2009 13:56:26 +0000 (-0700) Subject: xkbcomp: Drop unused Display argument in Atom functions X-Git-Tag: accepted/2.0alpha-wayland/20121109.204519~482 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8544cde52e8b1e2cac21aa1ca9760c5a0f834472;p=profile%2Fivi%2Flibxkbcommon.git xkbcomp: Drop unused Display argument in Atom functions The xkbcommon Atom implementation doesn't take Display into account. --- diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c index ee9bce7..0f70fce 100644 --- a/src/xkbcomp/action.c +++ b/src/xkbcomp/action.c @@ -372,7 +372,7 @@ CheckModifierField(XkbcDescPtr xkb, if (value->op == ExprIdent) { register char *valStr; - valStr = XkbcAtomGetString(NULL, value->value.str); + valStr = XkbcAtomGetString(value->value.str); if (valStr && ((uStrCaseCmp(valStr, "usemodmapmods") == 0) || (uStrCaseCmp(valStr, "modmapmods") == 0))) { @@ -1311,7 +1311,7 @@ HandleActionDef(ExprDef * def, exprOpText(def->op)); return False; } - str = XkbcAtomGetString(NULL, def->value.action.name); + str = XkbcAtomGetString(def->value.action.name); if (!str) { WSGO("Missing name in action definition!!\n"); @@ -1454,12 +1454,12 @@ ActionsInit(void) constTrue.common.next = NULL; constTrue.op = ExprIdent; constTrue.type = TypeBoolean; - constTrue.value.str = XkbcInternAtom(NULL, "true", False); + constTrue.value.str = XkbcInternAtom("true", False); constFalse.common.stmtType = StmtExpr; constFalse.common.next = NULL; constFalse.op = ExprIdent; constFalse.type = TypeBoolean; - constFalse.value.str = XkbcInternAtom(NULL, "false", False); + constFalse.value.str = XkbcInternAtom("false", False); actionsInitialized = 1; } return; diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c index 8275e0f..de6a1f2 100644 --- a/src/xkbcomp/compat.c +++ b/src/xkbcomp/compat.c @@ -831,7 +831,7 @@ CompileCompatMap(XkbFile *file, XkbcDescPtr xkb, unsigned merge, { if (XkbAllocNames(xkb, XkbCompatNameMask, 0, 0) == Success) xkb->names->compat = - XkbcInternAtom(xkb->dpy, info.name, False); + XkbcInternAtom(info.name, False); else { WSGO("Couldn't allocate space for compat name\n"); diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c index 3fd6782..5631cfe 100644 --- a/src/xkbcomp/expr.c +++ b/src/xkbcomp/expr.c @@ -135,17 +135,17 @@ ExprResolveLhs(ExprDef * expr, { case ExprIdent: elem_rtrn->str = NULL; - field_rtrn->str = XkbcAtomGetString(NULL, expr->value.str); + field_rtrn->str = XkbcAtomGetString(expr->value.str); *index_rtrn = NULL; return True; case ExprFieldRef: - elem_rtrn->str = XkbcAtomGetString(NULL, expr->value.field.element); - field_rtrn->str = XkbcAtomGetString(NULL, expr->value.field.field); + elem_rtrn->str = XkbcAtomGetString(expr->value.field.element); + field_rtrn->str = XkbcAtomGetString(expr->value.field.field); *index_rtrn = NULL; return True; case ExprArrayRef: - elem_rtrn->str = XkbcAtomGetString(NULL, expr->value.array.element); - field_rtrn->str = XkbcAtomGetString(NULL, expr->value.array.field); + elem_rtrn->str = XkbcAtomGetString(expr->value.array.element); + field_rtrn->str = XkbcAtomGetString(expr->value.array.field); *index_rtrn = expr->value.array.entry; return True; } @@ -166,7 +166,7 @@ SimpleLookup(char * priv, { return False; } - str = XkbcAtomGetString(NULL, field); + str = XkbcAtomGetString(field); for (entry = (LookupEntry *) priv; (entry != NULL) && (entry->name != NULL); entry++) { @@ -190,7 +190,7 @@ RadioLookup(char * priv, if ((field == None) || (elem != None) || (type != TypeInt)) return False; - str = XkbcAtomGetString(NULL, field); + str = XkbcAtomGetString(field); if (str) { if (uStrCasePrefix("group", str)) @@ -218,7 +218,7 @@ TableLookup(char * priv, if ((priv == NULL) || (field == None) || (type != TypeInt)) return False; - str = XkbcAtomGetString(NULL, elem); + str = XkbcAtomGetString(elem); while (tbl) { if (((str == NULL) && (tbl->element == NULL)) || @@ -264,7 +264,7 @@ LookupModMask(char * priv, if ((elem != None) || (type != TypeInt)) return False; - str = XkbcAtomGetString(NULL, field); + str = XkbcAtomGetString(field); if (str == NULL) return False; if (uStrCaseCmp(str, "all") == 0) @@ -397,7 +397,7 @@ ExprResolveBoolean(ExprDef * expr, val_rtrn->ival = expr->value.ival; return True; case ExprIdent: - bogus = XkbcAtomGetString(NULL, expr->value.str); + bogus = XkbcAtomGetString(expr->value.str); if (bogus) { if ((uStrCaseCmp(bogus, "true") == 0) || @@ -487,7 +487,7 @@ ExprResolveFloat(ExprDef * expr, if (expr->type == TypeString) { register char *str; - str = XkbcAtomGetString(NULL, expr->value.str); + str = XkbcAtomGetString(expr->value.str); if ((str != NULL) && (strlen(str) == 1)) { val_rtrn->uval = str[0] * XkbGeomPtsPerMM; @@ -600,7 +600,7 @@ ExprResolveInteger(ExprDef * expr, if (expr->type == TypeString) { register char *str; - str = XkbcAtomGetString(NULL, expr->value.str); + str = XkbcAtomGetString(expr->value.str); if (str != NULL) switch (strlen(str)) { @@ -726,7 +726,7 @@ ExprResolveString(ExprDef * expr, exprTypeText(expr->type)); return False; } - val_rtrn->str = XkbcAtomGetString(NULL, expr->value.str); + val_rtrn->str = XkbcAtomGetString(expr->value.str); if (val_rtrn->str == NULL) { static char *empty = ""; @@ -1051,7 +1051,7 @@ ExprResolveKeySym(ExprDef * expr, if (expr->op == ExprIdent) { char *str; - str = XkbcAtomGetString(NULL, expr->value.str); + str = XkbcAtomGetString(expr->value.str); if ((str != NULL) && ((sym = XStringToKeysym(str)) != NoSymbol)) { val_rtrn->uval = sym; diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c index a6a3f98..e7eac3b 100644 --- a/src/xkbcomp/geometry.c +++ b/src/xkbcomp/geometry.c @@ -540,7 +540,7 @@ InitSectionInfo(SectionInfo * si, GeometryInfo * info) { *si = info->dfltSection; si->defs.defined &= ~_GS_Default; - si->name = XkbcInternAtom(info->dpy, "unknown", False); + si->name = XkbcInternAtom("unknown", False); si->priority = info->nextPriority++; if (info->nextPriority > XkbGeomMaxPriority) info->nextPriority = XkbGeomMaxPriority; @@ -552,7 +552,7 @@ InitSectionInfo(SectionInfo * si, GeometryInfo * info) si->defs.merge = info->merge; si->defs.next = NULL; si->geometry = info; - si->name = XkbcInternAtom(info->dpy, "default", False); + si->name = XkbcInternAtom("default", False); InitRowInfo(&si->dfltRow, si, info); } return; @@ -584,7 +584,7 @@ ClearSectionInfo(SectionInfo * si, GeometryInfo * info) { si->defs.defined &= ~_GS_Default; - si->name = XkbcInternAtom(info->dpy, "default", False); + si->name = XkbcInternAtom("default", False); si->top = si->left = 0; si->width = si->height = 0; si->angle = 0; @@ -1498,7 +1498,7 @@ SetShapeDoodadField(DoodadInfo * di, return ReportBadType(typeName, field, ddText(info->dpy, di), "string"); } - di->shape = XkbcInternAtom(info->dpy, tmp.str, False); + di->shape = XkbcInternAtom(tmp.str, False); di->defs.defined |= _GD_Shape; return True; } @@ -1633,7 +1633,7 @@ SetTextDoodadField(DoodadInfo * di, "string"); } di->defs.defined |= def; - *pField.str = XkbcInternAtom(NULL, tmp.str, False); + *pField.str = XkbcInternAtom(tmp.str, False); } else { @@ -1687,17 +1687,17 @@ SetIndicatorDoodadField(DoodadInfo * di, if (uStrCaseCmp(field, "oncolor") == 0) { di->defs.defined |= _GD_Color; - di->color = XkbcInternAtom(NULL, tmp.str, False); + di->color = XkbcInternAtom(tmp.str, False); } else if (uStrCaseCmp(field, "offcolor") == 0) { di->defs.defined |= _GD_OffColor; - di->offColor = XkbcInternAtom(NULL, tmp.str, False); + di->offColor = XkbcInternAtom(tmp.str, False); } else if (uStrCaseCmp(field, "shape") == 0) { di->defs.defined |= _GD_Shape; - di->shape = XkbcInternAtom(info->dpy, tmp.str, False); + di->shape = XkbcInternAtom(tmp.str, False); } return True; } @@ -1761,7 +1761,7 @@ SetLogoDoodadField(DoodadInfo * di, return ReportBadType(typeName, field, ddText(info->dpy, di), "string"); } - di->shape = XkbcInternAtom(info->dpy, tmp.str, False); + di->shape = XkbcInternAtom(tmp.str, False); di->defs.defined |= _GD_Shape; return True; } @@ -1867,7 +1867,7 @@ SetDoodadField(DoodadInfo * di, "string"); } di->defs.defined |= _GD_Color; - di->color = XkbcInternAtom(NULL, tmp.str, False); + di->color = XkbcInternAtom(tmp.str, False); return True; } switch (di->type) @@ -2077,7 +2077,7 @@ SetKeyField(KeyInfo * key, return ReportBadType("key", field, keyText(key), "string"); } key->defs.defined |= _GK_Shape; - key->shape = XkbcInternAtom(info->dpy, tmp.str, False); + key->shape = XkbcInternAtom(tmp.str, False); } else if ((uStrCaseCmp(field, "color") == 0) || (uStrCaseCmp(field, "keycolor") == 0)) @@ -2093,7 +2093,7 @@ SetKeyField(KeyInfo * key, return ReportBadType("key", field, keyText(key), "string"); } key->defs.defined |= _GK_Color; - key->color = XkbcInternAtom(NULL, tmp.str, False); + key->color = XkbcInternAtom(tmp.str, False); } else if ((uStrCaseCmp(field, "name") == 0) || (uStrCaseCmp(field, "keyname") == 0)) @@ -2351,7 +2351,7 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info) info->errorCount++; return ReportBadType("keyboard", field.str, "geometry", "string"); } - info->baseColor = XkbcInternAtom(NULL, tmp.str, False); + info->baseColor = XkbcInternAtom(tmp.str, False); return True; } else if (uStrCaseCmp(field.str, "labelcolor") == 0) @@ -2366,7 +2366,7 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info) info->errorCount++; return ReportBadType("keyboard", field.str, "geometry", "string"); } - info->labelColor = XkbcInternAtom(NULL, tmp.str, False); + info->labelColor = XkbcInternAtom(tmp.str, False); return True; } else @@ -2384,7 +2384,7 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info) info->errorCount++; return ReportBadType("keyboard", field.str, "geometry", "string"); } - *pField = XkbcInternAtom(NULL, tmp.str, False); + *pField = XkbcInternAtom(tmp.str, False); return True; } @@ -2420,7 +2420,7 @@ HandleShapeBody(ShapeDef * def, ShapeInfo * si, unsigned merge, { if (ol->nPoints < 1) { - SetShapeField(si, XkbcAtomGetString(NULL, ol->field), NULL, + SetShapeField(si, XkbcAtomGetString(ol->field), NULL, ol->points, info); continue; } @@ -2499,7 +2499,7 @@ HandleShapeDef(ShapeDef * def, XkbcDescPtr xkb, unsigned merge, bzero(&si, sizeof(ShapeInfo)); si.defs.merge = merge; si.name = - XkbcInternAtom(info->dpy, XkbcAtomGetString(NULL, def->name), False); + XkbcInternAtom(info->dpy, XkbcAtomGetString(def->name), False); si.dfltCornerRadius = info->dfltCornerRadius; if (!HandleShapeBody(def, &si, merge, info)) return False; @@ -2526,7 +2526,7 @@ HandleDoodadDef(DoodadDef * def, } InitDoodadInfo(&new, def->type, si, info); new.name = - XkbcInternAtom(info->dpy, XkbcAtomGetString(NULL, def->name), False); + XkbcInternAtom(info->dpy, XkbcAtomGetString(def->name), False); for (var = def->body; var != NULL; var = (VarDef *) var->common.next) { if (ExprResolveLhs(var->name, &elem, &field, &ndx) == 0) @@ -2566,7 +2566,7 @@ HandleOverlayDef(OverlayDef * def, } bzero(&ol, sizeof(OverlayInfo)); ol.name = - XkbcInternAtom(info->dpy, XkbcAtomGetString(NULL, def->name), False); + XkbcInternAtom(info->dpy, XkbcAtomGetString(def->name), False); for (keyDef = def->keys; keyDef; keyDef = (OverlayKeyDef *) keyDef->common.next) { @@ -2818,7 +2818,7 @@ HandleSectionDef(SectionDef * def, merge = def->merge; InitSectionInfo(&si, info); si.defs.merge = merge; - str = XkbcAtomGetString(NULL, def->name); + str = XkbcAtomGetString(def->name); if ((str == NULL) || (strlen(str) < 1)) { ERROR("Section defined without a name\n"); @@ -2826,7 +2826,7 @@ HandleSectionDef(SectionDef * def, return False; } si.name = - XkbcInternAtom(info->dpy, XkbcAtomGetString(NULL, def->name), False); + XkbcInternAtom(info->dpy, XkbcAtomGetString(def->name), False); if (!HandleSectionBody(def, &si, merge, info)) return False; if (!AddSection(info, &si)) @@ -2926,7 +2926,7 @@ CopyShapeDef(Display * dpy, XkbGeometryPtr geom, ShapeInfo * si) Atom name; si->index = geom->num_shapes; - name = XkbcInternAtom(dpy, XkbcAtomGetString(NULL, si->name), False); + name = XkbcInternAtom(dpy, XkbcAtomGetString(si->name), False); shape = XkbAddGeomShape(geom, name, si->nOutlines); if (!shape) { @@ -3015,7 +3015,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) WARN1("No color for doodad %s\n", ddText(info->dpy, di)); ACTION("Using black\n"); } - di->color = XkbcInternAtom(NULL, "black", False); + di->color = XkbcInternAtom("black", False); } break; case XkbTextDoodad: @@ -3036,7 +3036,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION("Using black\n"); } - di->color = XkbcInternAtom(NULL, "black", False); + di->color = XkbcInternAtom("black", False); } if ((di->defs.defined & _GD_FontSpec) != 0) { @@ -3060,7 +3060,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION1("Using \"%s\"\n", DFLT_FONT); } - di->font = XkbcInternAtom(NULL, DFLT_FONT, False); + di->font = XkbcInternAtom(DFLT_FONT, False); } if ((di->defs.defined & _GD_FontSlant) == 0) { @@ -3070,7 +3070,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION1("Using \"%s\"\n", DFLT_SLANT); } - di->fontSlant = XkbcInternAtom(NULL, DFLT_SLANT, False); + di->fontSlant = XkbcInternAtom(DFLT_SLANT, False); } if ((di->defs.defined & _GD_FontWeight) == 0) { @@ -3080,7 +3080,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION1("Using \"%s\"\n", DFLT_WEIGHT); } - di->fontWeight = XkbcInternAtom(NULL, DFLT_WEIGHT, False); + di->fontWeight = XkbcInternAtom(DFLT_WEIGHT, False); } if ((di->defs.defined & _GD_FontSetWidth) == 0) { @@ -3090,7 +3090,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION1("Using \"%s\"\n", DFLT_SET_WIDTH); } - di->fontSetWidth = XkbcInternAtom(NULL, DFLT_SET_WIDTH, False); + di->fontSetWidth = XkbcInternAtom(DFLT_SET_WIDTH, False); } if ((di->defs.defined & _GD_FontVariant) == 0) { @@ -3100,7 +3100,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION1("Using \"%s\"\n", DFLT_VARIANT); } - di->fontVariant = XkbcInternAtom(NULL, DFLT_VARIANT, False); + di->fontVariant = XkbcInternAtom(DFLT_VARIANT, False); } if ((di->defs.defined & _GD_FontEncoding) == 0) { @@ -3110,7 +3110,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION1("Using \"%s\"\n", DFLT_ENCODING); } - di->fontEncoding = XkbcInternAtom(NULL, DFLT_ENCODING, False); + di->fontEncoding = XkbcInternAtom(DFLT_ENCODING, False); } if ((di->defs.defined & _GD_FontSize) == 0) { @@ -3129,7 +3129,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) char *tmp; size = (di->fontSize * 120) / 100; size = (size * 254) / 720; /* convert to mm/10 */ - for (nLines = 1, tmp = XkbcAtomGetString(NULL, di->text); *tmp; + for (nLines = 1, tmp = XkbcAtomGetString(di->text); *tmp; tmp++) { if (*tmp == '\n') @@ -3150,7 +3150,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) unsigned width, tmp; char *str; width = tmp = 0; - for (str = XkbcAtomGetString(NULL, di->text); *str; str++) + for (str = XkbcAtomGetString(di->text); *str; str++) { if (*str != '\n') tmp++; @@ -3204,7 +3204,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION("Using green\n"); } - di->color = XkbcInternAtom(NULL, "green", False); + di->color = XkbcInternAtom("green", False); } if ((di->defs.defined & _GD_OffColor) == 0) { @@ -3214,7 +3214,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) ddText(info->dpy, di)); ACTION("Using black\n"); } - di->offColor = XkbcInternAtom(NULL, "black", False); + di->offColor = XkbcInternAtom("black", False); } break; case XkbLogoDoodad: @@ -3253,7 +3253,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info) WARN1("No color for doodad %s\n", ddText(info->dpy, di)); ACTION("Using black\n"); } - di->color = XkbcInternAtom(NULL, "black", False); + di->color = XkbcInternAtom("black", False); } break; default: @@ -3276,19 +3276,19 @@ FontFromParts(Atom fontTok, char *font, *weight, *slant, *setWidth, *variant, *encoding; char *rtrn; - font = (fontTok != None ? XkbcAtomGetString(NULL, fontTok) : DFLT_FONT); + font = (fontTok != None ? XkbcAtomGetString(fontTok) : DFLT_FONT); weight = - (weightTok != None ? XkbcAtomGetString(NULL, weightTok) : DFLT_WEIGHT); + (weightTok != None ? XkbcAtomGetString(weightTok) : DFLT_WEIGHT); slant = - (slantTok != None ? XkbcAtomGetString(NULL, slantTok) : DFLT_SLANT); + (slantTok != None ? XkbcAtomGetString(slantTok) : DFLT_SLANT); setWidth = (setWidthTok != - None ? XkbcAtomGetString(NULL, setWidthTok) : DFLT_SET_WIDTH); + None ? XkbcAtomGetString(setWidthTok) : DFLT_SET_WIDTH); variant = - (varTok != None ? XkbcAtomGetString(NULL, varTok) : DFLT_VARIANT); + (varTok != None ? XkbcAtomGetString(varTok) : DFLT_VARIANT); encoding = (encodingTok != - None ? XkbcAtomGetString(NULL, encodingTok) : DFLT_ENCODING); + None ? XkbcAtomGetString(encodingTok) : DFLT_ENCODING); if (size == 0) size = DFLT_SIZE; totalSize = @@ -3315,7 +3315,7 @@ CopyDoodadDef(XkbGeometryPtr geom, if (!VerifyDoodadInfo(di, info)) return False; - name = XkbcInternAtom(NULL, XkbcAtomGetString(NULL, di->name), False); + name = XkbcInternAtom(XkbcAtomGetString(di->name), False); doodad = XkbAddGeomDoodad(geom, section, name); if (!doodad) { @@ -3337,7 +3337,7 @@ CopyDoodadDef(XkbGeometryPtr geom, return False; doodad->shape.angle = di->angle; color = - XkbAddGeomColor(geom, XkbcAtomGetString(NULL, di->color), + XkbAddGeomColor(geom, XkbcAtomGetString(di->color), geom->num_colors); shape = &geom->shapes[si->index]; XkbSetShapeDoodadColor(geom, &doodad->shape, color); @@ -3354,10 +3354,10 @@ CopyDoodadDef(XkbGeometryPtr geom, di->fontVariant, di->fontSize, di->fontEncoding); else - doodad->text.font = XkbcAtomGetString(NULL, di->fontSpec); - doodad->text.text = XkbcAtomGetString(NULL, di->text); + doodad->text.font = XkbcAtomGetString(di->fontSpec); + doodad->text.text = XkbcAtomGetString(di->text); color = - XkbAddGeomColor(geom, XkbcAtomGetString(NULL, di->color), + XkbAddGeomColor(geom, XkbcAtomGetString(di->color), geom->num_colors); XkbSetTextDoodadColor(geom, &doodad->text, color); break; @@ -3367,12 +3367,12 @@ CopyDoodadDef(XkbGeometryPtr geom, return False; shape = &geom->shapes[si->index]; color = - XkbAddGeomColor(geom, XkbcAtomGetString(NULL, di->color), + XkbAddGeomColor(geom, XkbcAtomGetString(di->color), geom->num_colors); XkbSetIndicatorDoodadShape(geom, &doodad->indicator, shape); XkbSetIndicatorDoodadOnColor(geom, &doodad->indicator, color); color = - XkbAddGeomColor(geom, XkbcAtomGetString(NULL, di->offColor), + XkbAddGeomColor(geom, XkbcAtomGetString(di->offColor), geom->num_colors); XkbSetIndicatorDoodadOffColor(geom, &doodad->indicator, color); break; @@ -3382,7 +3382,7 @@ CopyDoodadDef(XkbGeometryPtr geom, return False; doodad->logo.angle = di->angle; color = - XkbAddGeomColor(geom, XkbcAtomGetString(NULL, di->color), + XkbAddGeomColor(geom, XkbcAtomGetString(di->color), geom->num_colors); shape = &geom->shapes[si->index]; XkbSetLogoDoodadColor(geom, &doodad->logo, color); @@ -3510,7 +3510,7 @@ CopyOverlayDef(XkbGeometryPtr geom, if (!VerifyOverlayInfo(geom, section, oi, info, rowMap, rowSize)) return False; - name = XkbcInternAtom(NULL, XkbcAtomGetString(NULL, oi->name), False); + name = XkbcInternAtom(XkbcAtomGetString(oi->name), False); ol = XkbAddGeomOverlay(section, name, oi->nRows); if (!ol) { @@ -3560,7 +3560,7 @@ CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info) RowInfo *ri; Atom name; - name = XkbcInternAtom(NULL, XkbcAtomGetString(NULL, si->name), False); + name = XkbcInternAtom(XkbcAtomGetString(si->name), False); section = XkbAddGeomSection(geom, name, si->nRows, si->nDoodads, si->nOverlays); if (section == NULL) @@ -3620,7 +3620,7 @@ CopySectionDef(XkbGeometryPtr geom, SectionInfo * si, GeometryInfo * info) if (ki->color != None) color = XkbAddGeomColor(geom, - XkbcAtomGetString(NULL, ki->color), + XkbcAtomGetString(ki->color), geom->num_colors); else color = XkbAddGeomColor(geom, "white", geom->num_colors); @@ -3689,13 +3689,13 @@ CompileGeometry(XkbFile *file, XkbcDescPtr xkb, unsigned merge) geom->height_mm = info.heightMM; if (info.name != NULL) { - geom->name = XkbcInternAtom(xkb->dpy, info.name, False); + geom->name = XkbcInternAtom(info.name, False); if (XkbAllocNames(xkb, XkbGeometryNameMask, 0, 0) == Success) xkb->names->geometry = geom->name; } if (info.fontSpec != None) geom->label_font = - uStringDup(XkbcAtomGetString(NULL, info.fontSpec)); + uStringDup(XkbcAtomGetString(info.fontSpec)); else geom->label_font = FontFromParts(info.font, info.fontWeight, info.fontSlant, @@ -3707,14 +3707,14 @@ CompileGeometry(XkbFile *file, XkbcDescPtr xkb, unsigned merge) XkbAddGeomColor(geom, "white", geom->num_colors); if (info.baseColor == None) - info.baseColor = XkbcInternAtom(NULL, "white", False); + info.baseColor = XkbcInternAtom("white", False); if (info.labelColor == None) - info.labelColor = XkbcInternAtom(NULL, "black", False); + info.labelColor = XkbcInternAtom("black", False); geom->base_color = - XkbAddGeomColor(geom, XkbcAtomGetString(NULL, info.baseColor), + XkbAddGeomColor(geom, XkbcAtomGetString(info.baseColor), geom->num_colors); geom->label_color = - XkbAddGeomColor(geom, XkbcAtomGetString(NULL, info.labelColor), + XkbAddGeomColor(geom, XkbcAtomGetString(info.labelColor), geom->num_colors); if (info.props) diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c index 3428d37..6841894 100644 --- a/src/xkbcomp/indicators.c +++ b/src/xkbcomp/indicators.c @@ -47,7 +47,7 @@ void ClearIndicatorMapInfo(Display * dpy, LEDInfo * info) { - info->name = XkbcInternAtom(dpy, "default", False); + info->name = XkbcInternAtom("default", False); info->indicator = _LED_NotBound; info->flags = info->which_mods = info->real_mods = 0; info->vmods = 0; @@ -481,7 +481,7 @@ BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound, ERROR("No unnamed indicators found\n"); ACTION1 ("Virtual indicator map \"%s\" not bound\n", - XkbcAtomGetString(xkb->dpy, led->name)); + XkbcAtomGetString(led->name)); continue; } } @@ -516,8 +516,8 @@ BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound, ERROR1("Multiple names bound to indicator %d\n", (unsigned int) led->indicator); ACTION2("Using %s, ignoring %s\n", - XkbcAtomGetString(xkb->dpy, old), - XkbcAtomGetString(xkb->dpy, led->name)); + XkbcAtomGetString(old), + XkbcAtomGetString(led->name)); led->indicator = _LED_NotBound; if (force) { diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c index c1f19da..2c9eb58 100644 --- a/src/xkbcomp/keycodes.c +++ b/src/xkbcomp/keycodes.c @@ -728,7 +728,7 @@ HandleIndicatorNameDef(IndicatorNameDef * def, info->errorCount++; return ReportBadType("indicator", "name", buf, "string"); } - ii.name = XkbcInternAtom(NULL, tmp.str, False); + ii.name = XkbcInternAtom(tmp.str, False); ii.virtual = def->virtual; if (!AddIndicatorName(info, &ii)) return False; @@ -845,7 +845,7 @@ CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge) == Success) { register int i; - xkb->names->keycodes = XkbcInternAtom(xkb->dpy, info.name, False); + xkb->names->keycodes = XkbcInternAtom(info.name, False); uDEBUG2(1, "key range: %d..%d\n", xkb->min_key_code, xkb->max_key_code); for (i = info.computedMin; i <= info.computedMax; i++) @@ -873,7 +873,7 @@ CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge) { xkb->names->indicators[ii->ndx - 1] = XkbcInternAtom(xkb->dpy, - XkbcAtomGetString(NULL, ii->name), False); + XkbcAtomGetString(ii->name), False); if (xkb->indicators != NULL) { register unsigned bit; diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c index c40bf65..fc8ffa1 100644 --- a/src/xkbcomp/keytypes.c +++ b/src/xkbcomp/keytypes.c @@ -128,10 +128,10 @@ extern Bool AddLevelName(KeyTypeInfo * /* type */ , static void InitKeyTypesInfo(KeyTypesInfo * info, XkbcDescPtr xkb, KeyTypesInfo * from) { - tok_ONE_LEVEL = XkbcInternAtom(NULL, "ONE_LEVEL", False); - tok_TWO_LEVEL = XkbcInternAtom(NULL, "TWO_LEVEL", False); - tok_ALPHABETIC = XkbcInternAtom(NULL, "ALPHABETIC", False); - tok_KEYPAD = XkbcInternAtom(NULL, "KEYPAD", False); + tok_ONE_LEVEL = XkbcInternAtom("ONE_LEVEL", False); + tok_TWO_LEVEL = XkbcInternAtom("TWO_LEVEL", False); + tok_ALPHABETIC = XkbcInternAtom("ALPHABETIC", False); + tok_KEYPAD = XkbcInternAtom("KEYPAD", False); info->dpy = NULL; info->name = uStringDup("default"); info->errorCount = 0; @@ -327,7 +327,7 @@ AddKeyType(XkbcDescPtr xkb, KeyTypesInfo * info, KeyTypeInfo * new) && (warningLevel > 0)) || (warningLevel > 9)) { WARN1("Multiple definitions of the %s key type\n", - XkbcAtomGetString(NULL, new->name)); + XkbcAtomGetString(new->name)); ACTION("Earlier definition ignored\n"); } FreeKeyTypeInfo(old); @@ -343,7 +343,7 @@ AddKeyType(XkbcDescPtr xkb, KeyTypesInfo * info, KeyTypeInfo * new) if (report) { WARN1("Multiple definitions of the %s key type\n", - XkbcAtomGetString(NULL, new->name)); + XkbcAtomGetString(new->name)); ACTION("Later definition ignored\n"); } FreeKeyTypeInfo(new); @@ -865,7 +865,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value) return False; } return - AddLevelName(type, level, XkbcInternAtom(NULL, rtrn.str, False), True, + AddLevelName(type, level, XkbcInternAtom(rtrn.str, False), True, True); } @@ -1222,7 +1222,7 @@ CompileKeyTypes(XkbFile *file, XkbcDescPtr xkb, unsigned merge) if (info.name != NULL) { if (XkbAllocNames(xkb, XkbTypesNameMask, 0, 0) == Success) - xkb->names->types = XkbcInternAtom(xkb->dpy, info.name, False); + xkb->names->types = XkbcInternAtom(info.name, False); else { WSGO("Couldn't allocate space for types name\n"); diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index d728c8a..912abb9 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -242,9 +242,9 @@ InitSymbolsInfo(SymbolsInfo * info, XkbcDescPtr xkb) { register int i; - tok_ONE_LEVEL = XkbcInternAtom(NULL, "ONE_LEVEL", False); - tok_TWO_LEVEL = XkbcInternAtom(NULL, "TWO_LEVEL", False); - tok_KEYPAD = XkbcInternAtom(NULL, "KEYPAD", False); + tok_ONE_LEVEL = XkbcInternAtom("ONE_LEVEL", False); + tok_TWO_LEVEL = XkbcInternAtom("TWO_LEVEL", False); + tok_KEYPAD = XkbcInternAtom("KEYPAD", False); info->name = NULL; info->explicit_group = 0; info->errorCount = 0; @@ -1134,7 +1134,7 @@ SetSymbolsField(KeyInfo * key, } if (arrayNdx == NULL) { - key->dfltType = XkbcInternAtom(NULL, tmp.str, False); + key->dfltType = XkbcInternAtom(tmp.str, False); key->defs.defined |= _Key_Type_Dflt; } else if (!ExprResolveInteger(arrayNdx, &ndx, SimpleLookup, @@ -1155,7 +1155,7 @@ SetSymbolsField(KeyInfo * key, } else { - key->types[ndx.uval - 1] = XkbcInternAtom(NULL, tmp.str, False); + key->types[ndx.uval - 1] = XkbcInternAtom(tmp.str, False); key->typesDefined |= (1 << (ndx.uval - 1)); } } @@ -1396,7 +1396,7 @@ SetGroupName(SymbolsInfo * info, ExprDef * arrayNdx, ExprDef * value) return False; } info->groupNames[tmp.uval - 1 + info->explicit_group] = - XkbcInternAtom(NULL, name.str, False); + XkbcInternAtom(name.str, False); return True; } @@ -1794,23 +1794,23 @@ FindAutomaticType(int width, KeySym * syms, Atom * typeNameRtrn, *autoType = False; if ((width == 1) || (width == 0)) { - *typeNameRtrn = XkbcInternAtom(NULL, "ONE_LEVEL", False); + *typeNameRtrn = XkbcInternAtom("ONE_LEVEL", False); *autoType = True; } else if (width == 2) { if (syms && KSIsLower(syms[0]) && KSIsUpper(syms[1])) { - *typeNameRtrn = XkbcInternAtom(NULL, "ALPHABETIC", False); + *typeNameRtrn = XkbcInternAtom("ALPHABETIC", False); } else if (syms && (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1]))) { - *typeNameRtrn = XkbcInternAtom(NULL, "KEYPAD", False); + *typeNameRtrn = XkbcInternAtom("KEYPAD", False); *autoType = True; } else { - *typeNameRtrn = XkbcInternAtom(NULL, "TWO_LEVEL", False); + *typeNameRtrn = XkbcInternAtom("TWO_LEVEL", False); *autoType = True; } } @@ -1819,16 +1819,15 @@ FindAutomaticType(int width, KeySym * syms, Atom * typeNameRtrn, if (syms && KSIsLower(syms[0]) && KSIsUpper(syms[1])) if (KSIsLower(syms[2]) && KSIsUpper(syms[3])) *typeNameRtrn = - XkbcInternAtom(NULL, "FOUR_LEVEL_ALPHABETIC", False); + XkbcInternAtom("FOUR_LEVEL_ALPHABETIC", False); else - *typeNameRtrn = XkbcInternAtom(NULL, - "FOUR_LEVEL_SEMIALPHABETIC", + *typeNameRtrn = XkbcInternAtom("FOUR_LEVEL_SEMIALPHABETIC", False); else if (syms && (XkbKSIsKeypad(syms[0]) || XkbKSIsKeypad(syms[1]))) - *typeNameRtrn = XkbcInternAtom(NULL, "FOUR_LEVEL_KEYPAD", False); + *typeNameRtrn = XkbcInternAtom("FOUR_LEVEL_KEYPAD", False); else - *typeNameRtrn = XkbcInternAtom(NULL, "FOUR_LEVEL", False); + *typeNameRtrn = XkbcInternAtom("FOUR_LEVEL", False); /* XXX: why not set autoType here? */ } return ((width >= 0) && (width <= 4)); @@ -2243,7 +2242,7 @@ CompileSymbols(XkbFile *file, XkbcDescPtr xkb, unsigned merge) } /* now copy info into xkb. */ - xkb->names->symbols = XkbcInternAtom(xkb->dpy, info.name, False); + xkb->names->symbols = XkbcInternAtom(info.name, False); if (info.aliases) ApplyAliases(xkb, False, &info.aliases); for (i = 0; i < XkbNumKbdGroups; i++) diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c index a842bc6..8b9d378 100644 --- a/src/xkbcomp/vmod.c +++ b/src/xkbcomp/vmod.c @@ -88,9 +88,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info) srv = info->xkb->server; names = info->xkb->names; - stmtName = - XkbcInternAtom(info->xkb->dpy, XkbcAtomGetString(NULL, stmt->name), - False); + stmtName = XkbcInternAtom(XkbcAtomGetString(stmt->name), False); for (i = 0, bit = 1, nextFree = -1; i < XkbNumVirtualMods; i++, bit <<= 1) { if (info->defined & bit) @@ -182,7 +180,7 @@ LookupVModIndex(char * priv, return False; } /* get the actual name */ - fieldStr = XkbcAtomGetString(xkb->dpy, field); + fieldStr = XkbcAtomGetString(field); if (fieldStr == NULL) return False; /* For each named modifier, get the name and compare it to the one passed @@ -192,7 +190,7 @@ LookupVModIndex(char * priv, */ for (i = 0; i < XkbNumVirtualMods; i++) { - modStr = XkbcAtomGetString(xkb->dpy, xkb->names->vmods[i]); + modStr = XkbcAtomGetString(xkb->names->vmods[i]); if ((modStr != NULL) && (uStrCaseCmp(fieldStr, modStr) == 0)) { val_rtrn->uval = i; @@ -231,7 +229,7 @@ FindKeypadVMod(XkbcDescPtr xkb) Atom name; ExprResult rtrn; - name = XkbcInternAtom(xkb->dpy, "NumLock", False); + name = XkbcInternAtom("NumLock", False); if ((xkb) && LookupVModIndex((char *) xkb, None, name, TypeInt, &rtrn)) { return rtrn.ival; @@ -251,8 +249,8 @@ ResolveVirtualModifier(ExprDef * def, ExprResult * val_rtrn, VModInfo * info) for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { char *str1, *str2; - str1 = XkbcAtomGetString(info->xkb->dpy, names->vmods[i]); - str2 = XkbcAtomGetString(NULL, def->value.str); + str1 = XkbcAtomGetString(names->vmods[i]); + str2 = XkbcAtomGetString(def->value.str); if ((info->available & bit) && (uStrCaseCmp(str1, str2) == Equal)) { val_rtrn->uval = i; diff --git a/src/xkbcomp/xkbparse.c b/src/xkbcomp/xkbparse.c index 7499746..1c070ec 100644 --- a/src/xkbcomp/xkbparse.c +++ b/src/xkbcomp/xkbparse.c @@ -2596,57 +2596,57 @@ yyreduce: case 118: #line 630 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"action",False); } + { (yyval.sval)= XkbcInternAtom("action",False); } break; case 119: #line 632 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"interpret",False); } + { (yyval.sval)= XkbcInternAtom("interpret",False); } break; case 120: #line 634 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"type",False); } + { (yyval.sval)= XkbcInternAtom("type",False); } break; case 121: #line 636 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"key",False); } + { (yyval.sval)= XkbcInternAtom("key",False); } break; case 122: #line 638 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"group",False); } + { (yyval.sval)= XkbcInternAtom("group",False); } break; case 123: #line 640 "xkbparse.y" - {(yyval.sval)=XkbcInternAtom(NULL,"modifier_map",False);} + {(yyval.sval)=XkbcInternAtom("modifier_map",False);} break; case 124: #line 642 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"indicator",False); } + { (yyval.sval)= XkbcInternAtom("indicator",False); } break; case 125: #line 644 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"shape",False); } + { (yyval.sval)= XkbcInternAtom("shape",False); } break; case 126: #line 646 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"row",False); } + { (yyval.sval)= XkbcInternAtom("row",False); } break; case 127: #line 648 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"section",False); } + { (yyval.sval)= XkbcInternAtom("section",False); } break; case 128: #line 650 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"text",False); } + { (yyval.sval)= XkbcInternAtom("text",False); } break; case 129: @@ -2974,17 +2974,17 @@ yyreduce: case 179: #line 844 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,scanStr,False); } + { (yyval.sval)= XkbcInternAtom(scanStr,False); } break; case 180: #line 845 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,"default",False); } + { (yyval.sval)= XkbcInternAtom("default",False); } break; case 181: #line 848 "xkbparse.y" - { (yyval.sval)= XkbcInternAtom(NULL,scanStr,False); } + { (yyval.sval)= XkbcInternAtom(scanStr,False); } break; case 182: diff --git a/src/xkbcomp/xkbparse.y b/src/xkbcomp/xkbparse.y index aaf56e2..3dd99a0 100644 --- a/src/xkbcomp/xkbparse.y +++ b/src/xkbcomp/xkbparse.y @@ -558,27 +558,27 @@ FieldSpec : Ident { $$= $1; } ; Element : ACTION_TOK - { $$= XkbcInternAtom(NULL,"action",False); } + { $$= XkbcInternAtom("action",False); } | INTERPRET - { $$= XkbcInternAtom(NULL,"interpret",False); } + { $$= XkbcInternAtom("interpret",False); } | TYPE - { $$= XkbcInternAtom(NULL,"type",False); } + { $$= XkbcInternAtom("type",False); } | KEY - { $$= XkbcInternAtom(NULL,"key",False); } + { $$= XkbcInternAtom("key",False); } | GROUP - { $$= XkbcInternAtom(NULL,"group",False); } + { $$= XkbcInternAtom("group",False); } | MODIFIER_MAP - {$$=XkbcInternAtom(NULL,"modifier_map",False);} + {$$=XkbcInternAtom("modifier_map",False);} | INDICATOR - { $$= XkbcInternAtom(NULL,"indicator",False); } + { $$= XkbcInternAtom("indicator",False); } | SHAPE - { $$= XkbcInternAtom(NULL,"shape",False); } + { $$= XkbcInternAtom("shape",False); } | ROW - { $$= XkbcInternAtom(NULL,"row",False); } + { $$= XkbcInternAtom("row",False); } | SECTION - { $$= XkbcInternAtom(NULL,"section",False); } + { $$= XkbcInternAtom("section",False); } | TEXT - { $$= XkbcInternAtom(NULL,"text",False); } + { $$= XkbcInternAtom("text",False); } ; OptMergeMode : MergeMode { $$= $1; } @@ -764,11 +764,11 @@ Integer : INTEGER { $$= scanInt; } KeyName : KEYNAME { $$= scanStr; scanStr= NULL; } ; -Ident : IDENT { $$= XkbcInternAtom(NULL,scanStr,False); } - | DEFAULT { $$= XkbcInternAtom(NULL,"default",False); } +Ident : IDENT { $$= XkbcInternAtom(scanStr,False); } + | DEFAULT { $$= XkbcInternAtom("default",False); } ; -String : STRING { $$= XkbcInternAtom(NULL,scanStr,False); } +String : STRING { $$= XkbcInternAtom(scanStr,False); } ; OptMapName : MapName { $$= $1; }