atom: allow passing NULLs to find_node_pointer()

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2013-12-02 14:23:59 +02:00
parent d873693ba6
commit 048ee7031d
1 changed files with 5 additions and 4 deletions

View File

@ -171,8 +171,10 @@ find_node_pointer(struct atom_table *table, const char *string, size_t len,
} }
} }
*fingerprint_out = fingerprint; if (fingerprint_out)
*nodep_out = nodep; *fingerprint_out = fingerprint;
if (nodep_out)
*nodep_out = nodep;
return found; return found;
} }
@ -180,12 +182,11 @@ xkb_atom_t
atom_lookup(struct atom_table *table, const char *string, size_t len) atom_lookup(struct atom_table *table, const char *string, size_t len)
{ {
struct atom_node **nodep; struct atom_node **nodep;
unsigned int fingerprint;
if (!string) if (!string)
return XKB_ATOM_NONE; return XKB_ATOM_NONE;
if (!find_node_pointer(table, string, len, &nodep, &fingerprint)) if (!find_node_pointer(table, string, len, &nodep, NULL))
return XKB_ATOM_NONE; return XKB_ATOM_NONE;
return (*nodep)->atom; return (*nodep)->atom;