Commit b28823cc5929152aa5114274460999aabf612cbc

Daniel Stone 2012-03-09T16:04:00

Remove KcCGST names from the map Signed-off-by: Daniel Stone <daniel@fooishbar.org>

diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index 881af46..f20c2b9 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -329,18 +329,11 @@ struct xkb_key_alias {
 };
 
 struct xkb_names {
-    uint32_t            keycodes;
-    uint32_t            geometry;
-    uint32_t            symbols;
-    uint32_t            types;
-    uint32_t            compat;
     uint32_t            vmods[XkbNumVirtualMods];
     uint32_t            indicators[XkbNumIndicators];
     uint32_t            groups[XkbNumKbdGroups];
     struct xkb_key_name *     keys;
     struct xkb_key_alias *    key_aliases;
-    uint32_t           *radio_groups;
-    uint32_t            phys_symbols;
 
     xkb_keycode_t     num_keys;
     xkb_keycode_t     num_key_aliases;
diff --git a/src/alloc.c b/src/alloc.c
index 76fc40f..de15031 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -102,7 +102,7 @@ XkbcFreeCompatMap(struct xkb_desc * xkb)
 }
 
 int
-XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG, int nTotalAliases)
+XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases)
 {
     struct xkb_names * names;
 
@@ -164,27 +164,6 @@ XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG, int nTotalAl
         names->num_key_aliases = nTotalAliases;
     }
 
-    if ((which & XkbRGNamesMask) && (nTotalRG > 0)) {
-        if (!names->radio_groups)
-            names->radio_groups = _XkbTypedCalloc(nTotalRG, uint32_t);
-        else if (nTotalRG > names->num_rg) {
-            uint32_t *prev_radio_groups = names->radio_groups;
-
-            names->radio_groups = _XkbTypedRealloc(names->radio_groups,
-                                                   nTotalRG, uint32_t);
-            if (names->radio_groups)
-                _XkbClearElems(names->radio_groups, names->num_rg,
-                               nTotalRG - 1, uint32_t);
-            else
-                free(prev_radio_groups);
-        }
-
-        if (!names->radio_groups)
-            return BadAlloc;
-
-        names->num_rg = nTotalRG;
-    }
-
     return Success;
 }
 
@@ -212,7 +191,6 @@ XkbcFreeNames(struct xkb_desc * xkb)
 
     free(names->keys);
     free(names->key_aliases);
-    free(names->radio_groups);
     free(names);
     xkb->names = NULL;
 }
diff --git a/src/xkballoc.h b/src/xkballoc.h
index 56f4ad7..4d36e5a 100644
--- a/src/xkballoc.h
+++ b/src/xkballoc.h
@@ -35,8 +35,7 @@ extern int
 XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI);
 
 extern int
-XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG,
-               int nTotalAliases);
+XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases);
 
 extern int
 XkbcAllocControls(struct xkb_desc * xkb, unsigned which);
diff --git a/src/xkbcomp/alias.c b/src/xkbcomp/alias.c
index a1cf160..af3dc2f 100644
--- a/src/xkbcomp/alias.c
+++ b/src/xkbcomp/alias.c
@@ -246,7 +246,7 @@ ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
     }
     else
     {
-        status = XkbcAllocNames(xkb, XkbKeyAliasesMask, 0, nOld + nNew);
+        status = XkbcAllocNames(xkb, XkbKeyAliasesMask, nOld + nNew);
         if (xkb->names)
             old = xkb->names->key_aliases;
     }
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index b089443..c2e9609 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -817,18 +817,6 @@ CompileCompatMap(XkbFile *file, struct xkb_desc * xkb, unsigned merge,
             WSGO("Couldn't allocate compatibility map\n");
             return False;
         }
-        if (info.name != NULL)
-        {
-            if (XkbcAllocNames(xkb, XkbCompatNameMask, 0, 0) == Success)
-                xkb->names->compat =
-                    xkb_intern_atom(info.name);
-	    else
-            {
-                WSGO("Couldn't allocate space for compat name\n");
-                ACTION("Name \"%s\" (from %s) NOT assigned\n",
-                        scanFile, info.name);
-            }
-        }
         size = info.nInterps * sizeof(struct xkb_sym_interpret);
         if (size > 0)
         {
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index ac72213..5657421 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -3650,8 +3650,7 @@ CompileGeometry(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
         if (info.name != NULL)
         {
             geom->name = xkb_intern_atom(info.name);
-            if (XkbcAllocNames(xkb, XkbGeometryNameMask, 0, 0) == Success)
-                xkb->names->geometry = geom->name;
+            XkbcAllocNames(xkb, XkbGeometryNameMask, 0);
         }
         if (info.fontSpec != None)
             geom->label_font = XkbcAtomGetString(info.fontSpec);
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 24ea8dd..e4df035 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -371,7 +371,7 @@ CopyIndicatorMapDefs(struct xkb_desc * xkb, LEDInfo *leds, LEDInfo **unboundRtrn
     LEDInfo *led, *next;
     LEDInfo *unbound, *last;
 
-    if (XkbcAllocNames(xkb, XkbIndicatorNamesMask, 0, 0) != Success)
+    if (XkbcAllocNames(xkb, XkbIndicatorNamesMask, 0) != Success)
     {
         WSGO("Couldn't allocate names\n");
         ACTION("Indicator names may be incorrect\n");
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index 91008fc..e1c90cf 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -891,15 +891,12 @@ CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
             xkb->max_key_code = info.explicitMax;
         else
             xkb->max_key_code = info.computedMax;
-        if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0, 0)
+        if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0)
                 == Success)
         {
             int i;
-            xkb->names->keycodes = xkb_intern_atom(info.name);
             for (i = info.computedMin; i <= info.computedMax; i++)
-            {
                 LongToKeyName(info.names[i], xkb->names->keys[i].name);
-            }
         }
         else
         {
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index 0204060..762ecf0 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -1155,17 +1155,6 @@ CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
         KeyTypeInfo *def;
         struct xkb_key_type *type, *next;
 
-        if (info.name != NULL)
-        {
-            if (XkbcAllocNames(xkb, XkbTypesNameMask, 0, 0) == Success)
-                xkb->names->types = xkb_intern_atom(info.name);
-            else
-            {
-                WSGO("Couldn't allocate space for types name\n");
-                ACTION("Name \"%s\" (from %s) NOT assigned\n",
-                        scanFile, info.name);
-            }
-        }
         i = info.nTypes;
         if ((info.stdPresent & XkbOneLevelMask) == 0)
             i++;
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index 2f1fdd9..f303536 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -289,7 +289,7 @@ FindNamedKey(struct xkb_desc * xkb,
     {
         if ((!xkb->names) || (!xkb->names->keys))
         {
-            if (XkbcAllocNames(xkb, XkbKeyNamesMask, 0, 0) != Success)
+            if (XkbcAllocNames(xkb, XkbKeyNamesMask, 0) != Success)
             {
                 if (warningLevel > 0)
                 {
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index e452b14..f0e2716 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1883,9 +1883,7 @@ CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
     {
         if ((start_from == 0) && (warningLevel >= 5))
         {
-            WARN("Key %s not found in %s keycodes\n",
-                  longText(key->name),
-                  XkbcAtomText(xkb->names->keycodes));
+            WARN("Key %s not found in keycodes\n", longText(key->name));
             ACTION("Symbols ignored\n");
         }
         return False;
@@ -2035,9 +2033,8 @@ CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
         {
             if (warningLevel >= 1)
             {
-                WARN("Key %s not found in %s keycodes\n",
-                      longText(key->nameForOverlayKey),
-                      XkbcAtomText(xkb->names->keycodes));
+                WARN("Key %s not found in keycodes\n",
+                      longText(key->nameForOverlayKey));
                 ACTION("Not treating %s as an overlay key \n",
                         longText(key->name));
             }
@@ -2083,9 +2080,8 @@ CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry)
     {
         if (warningLevel >= 5)
         {
-            WARN("Key %s not found in %s keycodes\n",
-                  longText(entry->u.keyName),
-                  XkbcAtomText(xkb->names->keycodes));
+            WARN("Key %s not found in keycodes\n",
+                  longText(entry->u.keyName));
             ACTION("Modifier map entry for %s not updated\n",
                     XkbcModIndexText(entry->modifier));
         }
@@ -2096,9 +2092,8 @@ CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry)
     {
         if (warningLevel > 5)
         {
-            WARN("Key \"%s\" not found in %s symbol map\n",
-                  XkbcKeysymText(entry->u.keySym),
-                  XkbcAtomText(xkb->names->symbols));
+            WARN("Key \"%s\" not found in symbol map\n",
+                  XkbcKeysymText(entry->u.keySym));
             ACTION("Modifier map entry for %s not updated\n",
                     XkbcModIndexText(entry->modifier));
         }
@@ -2136,8 +2131,7 @@ CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
         KeyInfo *key;
 
         /* alloc memory in the xkb struct */
-        if (XkbcAllocNames(xkb, XkbSymbolsNameMask | XkbGroupNamesMask, 0, 0)
-            != Success)
+        if (XkbcAllocNames(xkb, XkbGroupNamesMask, 0) != Success)
         {
             WSGO("Can not allocate names in CompileSymbols\n");
             ACTION("Symbols not added\n");
@@ -2164,7 +2158,6 @@ CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
         }
 
         /* now copy info into xkb. */
-        xkb->names->symbols = xkb_intern_atom(info.name);
         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 b313cdd..b6476cb 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -48,7 +48,7 @@ ClearVModInfo(VModInfo * info, struct xkb_desc * xkb)
 {
     int i;
 
-    if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0, 0) != Success)
+    if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0) != Success)
         return;
     if (XkbcAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success)
         return;