mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-30 12:40:42 +00:00
fix some inconsistencies pointed out by doxygen
This commit is contained in:
parent
6c447b4b75
commit
16f0a54a84
2 changed files with 28 additions and 27 deletions
|
@ -133,11 +133,11 @@ plitem_t *PL_GetPropertyList (const char *);
|
||||||
plitem_t *PL_ObjectForKey (plitem_t *, const char *);
|
plitem_t *PL_ObjectForKey (plitem_t *, const char *);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\fn plitem_t *PL_ObjectAtIndex (plitem_t *array, int idx)
|
\fn plitem_t *PL_ObjectAtIndex (plitem_t *array, int index)
|
||||||
\brief Retrieve a value from an array object.
|
\brief Retrieve a value from an array object.
|
||||||
|
|
||||||
\param array The array to get the value from
|
\param array The array to get the value from
|
||||||
\param idx The index within the array to retrieve
|
\param index The index within the array to retrieve
|
||||||
|
|
||||||
\return You are NOT responsible for freeing the returned object. It will
|
\return You are NOT responsible for freeing the returned object. It will
|
||||||
be destroyed when its container is.
|
be destroyed when its container is.
|
||||||
|
@ -159,11 +159,12 @@ plitem_t *PL_D_AllKeys (plitem_t *);
|
||||||
/**
|
/**
|
||||||
\fn qboolean PL_D_AddObject (plitem_t *dict, plitem_t *key, plitem_t *value)
|
\fn qboolean PL_D_AddObject (plitem_t *dict, plitem_t *key, plitem_t *value)
|
||||||
\fn qboolean PL_A_AddObject (plitem_t *array, plitem_t *item)
|
\fn qboolean PL_A_AddObject (plitem_t *array, plitem_t *item)
|
||||||
\fn qboolean PL_A_InsertObjectAtIndex (plitem_t *array, plitem_t *item, int ind)
|
\fn qboolean PL_A_InsertObjectAtIndex (plitem_t *array, plitem_t *item, int index)
|
||||||
|
|
||||||
\param dict The dictionary to add the key/value pair to
|
|
||||||
\param array The array to add the item to
|
\param array The array to add the item to
|
||||||
|
\param dict The dictionary to add the key/value pair to
|
||||||
\param item The item to be added to the array
|
\param item The item to be added to the array
|
||||||
|
\param index The location at which to insert the item into the array
|
||||||
\param key The key of the key/value pair to be added to the dictionary
|
\param key The key of the key/value pair to be added to the dictionary
|
||||||
\param value The value of the key/value pair to be added to the dictionary
|
\param value The value of the key/value pair to be added to the dictionary
|
||||||
|
|
||||||
|
@ -173,7 +174,7 @@ plitem_t *PL_D_AllKeys (plitem_t *);
|
||||||
*/
|
*/
|
||||||
qboolean PL_D_AddObject (plitem_t *, plitem_t *, plitem_t *);
|
qboolean PL_D_AddObject (plitem_t *, plitem_t *, plitem_t *);
|
||||||
qboolean PL_A_AddObject (plitem_t *, plitem_t *);
|
qboolean PL_A_AddObject (plitem_t *, plitem_t *);
|
||||||
qboolean PL_A_InsertObjectAtIndex (plitem_t *, plitem_t *, int ind);
|
qboolean PL_A_InsertObjectAtIndex (plitem_t *, plitem_t *, int);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
plitem_t *PL_NewDictionary (void);
|
plitem_t *PL_NewDictionary (void);
|
||||||
|
|
|
@ -144,12 +144,12 @@ PL_Free (plitem_t *item)
|
||||||
}
|
}
|
||||||
|
|
||||||
plitem_t *
|
plitem_t *
|
||||||
PL_ObjectForKey (plitem_t *item, const char *key)
|
PL_ObjectForKey (plitem_t *dict, const char *key)
|
||||||
{
|
{
|
||||||
hashtab_t *table = (hashtab_t *) item->data;
|
hashtab_t *table = (hashtab_t *) dict->data;
|
||||||
dictkey_t *k;
|
dictkey_t *k;
|
||||||
|
|
||||||
if (item->type != QFDictionary)
|
if (dict->type != QFDictionary)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
k = (dictkey_t *) Hash_Find (table, key);
|
k = (dictkey_t *) Hash_Find (table, key);
|
||||||
|
@ -219,45 +219,45 @@ PL_D_AddObject (plitem_t *dict, plitem_t *key, plitem_t *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean
|
qboolean
|
||||||
PL_A_InsertObjectAtIndex (plitem_t *array_item, plitem_t *item, int index)
|
PL_A_InsertObjectAtIndex (plitem_t *array, plitem_t *item, int index)
|
||||||
{
|
{
|
||||||
plarray_t *array;
|
plarray_t *arr;
|
||||||
|
|
||||||
if (array_item->type != QFArray)
|
if (array->type != QFArray)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
array = (plarray_t *)array_item->data;
|
arr = (plarray_t *)array->data;
|
||||||
|
|
||||||
if (array->numvals == array->maxvals) {
|
if (arr->numvals == arr->maxvals) {
|
||||||
int size = (array->maxvals + 128) * sizeof (plitem_t *);
|
int size = (arr->maxvals + 128) * sizeof (plitem_t *);
|
||||||
plitem_t **tmp = realloc (array->values, size);
|
plitem_t **tmp = realloc (arr->values, size);
|
||||||
|
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
array->maxvals += 128;
|
arr->maxvals += 128;
|
||||||
array->values = tmp;
|
arr->values = tmp;
|
||||||
memset (array->values + array->numvals, 0,
|
memset (arr->values + arr->numvals, 0,
|
||||||
(array->maxvals - array->numvals) * sizeof (plitem_t *));
|
(arr->maxvals - arr->numvals) * sizeof (plitem_t *));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
index = array->numvals;
|
index = arr->numvals;
|
||||||
|
|
||||||
if (index < 0 || index > array->numvals)
|
if (index < 0 || index > arr->numvals)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
memmove (array->values + index + 1, array->values + index,
|
memmove (arr->values + index + 1, arr->values + index,
|
||||||
(array->numvals - index) * sizeof (plitem_t *));
|
(arr->numvals - index) * sizeof (plitem_t *));
|
||||||
array->values[index] = item;
|
arr->values[index] = item;
|
||||||
array->numvals++;
|
arr->numvals++;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean
|
qboolean
|
||||||
PL_A_AddObject (plitem_t *array_item, plitem_t *item)
|
PL_A_AddObject (plitem_t *array, plitem_t *item)
|
||||||
{
|
{
|
||||||
return PL_A_InsertObjectAtIndex (array_item, item, -1);
|
return PL_A_InsertObjectAtIndex (array, item, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static qboolean
|
static qboolean
|
||||||
|
|
Loading…
Reference in a new issue