mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
chage PL_ObjectForKey to take a plitem directly and typecheck the item
This commit is contained in:
parent
f03cc28b7d
commit
637de7b687
2 changed files with 9 additions and 3 deletions
|
@ -81,7 +81,7 @@ typedef struct plbinary_s plbinary_t;
|
|||
struct hashtab_s;
|
||||
|
||||
plitem_t *PL_GetPropertyList (const char *);
|
||||
plitem_t *PL_ObjectForKey (struct hashtab_s *, const char *);
|
||||
plitem_t *PL_ObjectForKey (plitem_t *, const char *);
|
||||
void PL_FreeItem (struct plitem_s *);
|
||||
|
||||
typedef struct pldata_s { // Unparsed property list string
|
||||
|
|
|
@ -93,9 +93,15 @@ dict_free (void *i, void *unused)
|
|||
}
|
||||
|
||||
plitem_t *
|
||||
PL_ObjectForKey (hashtab_t *table, const char *key)
|
||||
PL_ObjectForKey (plitem_t *item, const char *key)
|
||||
{
|
||||
dictkey_t *k = (dictkey_t *) Hash_Find (table, key);
|
||||
hashtab_t *table = (hashtab_t *) item->data;
|
||||
dictkey_t *k;
|
||||
|
||||
if (item->type != QFDictionary)
|
||||
return NULL;
|
||||
|
||||
k = (dictkey_t *) Hash_Find (table, key);
|
||||
return k ? k->value : NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue