Make XkbcInitAtoms() call optional

master
Kristian Høgsberg 2010-06-30 17:13:21 -04:00
parent 0ece2cdbaf
commit d95b289367
4 changed files with 9 additions and 13 deletions

View File

@ -105,13 +105,6 @@ XkbcInitAtoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value)
do_get_atom_value = get_atom_value;
return;
}
if (nodeTable)
return;
tableLength = InitialTableSize;
nodeTable = (NodePtr *)malloc(InitialTableSize * sizeof(NodePtr));
nodeTable[None] = NULL;
}
static const char *
@ -202,16 +195,22 @@ _XkbcMakeAtom(const char *string, unsigned len, Bool makeit)
if ((lastAtom + 1) >= tableLength) {
NodePtr *table;
int newLength;
table = (NodePtr *)realloc(nodeTable,
tableLength * 2 * sizeof(NodePtr));
if (tableLength == 0)
newLength = InitialTableSize;
else
newLength = tableLength * 2;
table = realloc(nodeTable, newLength * sizeof(NodePtr));
if (!table) {
if (nd->string != string)
free(nd->string);
free(nd);
return BAD_RESOURCE;
}
tableLength <<= 1;
tableLength = newLength;
table[None] = NULL;
nodeTable = table;
}

View File

@ -60,7 +60,6 @@ int main(int argc, char *argv[])
}
uSetErrorFile(NULL);
XkbcInitAtoms(NULL, NULL);
xkb = XkbcCompileKeymapFromFile(file, name);
fclose(file);

View File

@ -54,7 +54,6 @@ int main(int argc, char *argv[])
ktcsg.geometry = argv[5];
uSetErrorFile(NULL);
XkbcInitAtoms(NULL, NULL);
xkb = XkbcCompileKeymapFromComponents(&ktcsg);

View File

@ -53,7 +53,6 @@ int main(int argc, char *argv[])
rmlvo.options = argv[5];
uSetErrorFile(NULL);
XkbcInitAtoms(NULL, NULL);
xkb = XkbcCompileKeymapFromRules(&rmlvo);