Make hashtable const correct.
Hashtable need not modify the filename when loading or saving the hashtable; consequently the filename can be passed as const.
This commit is contained in:
@ -711,7 +711,7 @@ hashtable_iterator_free(HASHITERATOR *iter)
|
|||||||
* @return Number of entries written or -1 on error
|
* @return Number of entries written or -1 on error
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
hashtable_save(HASHTABLE *table, char *filename,
|
hashtable_save(HASHTABLE *table, const char *filename,
|
||||||
int (*keywrite)(int, void*),
|
int (*keywrite)(int, void*),
|
||||||
int (*valuewrite)(int, void*))
|
int (*valuewrite)(int, void*))
|
||||||
{
|
{
|
||||||
@ -771,7 +771,7 @@ hashtable_save(HASHTABLE *table, char *filename,
|
|||||||
* @return Number of entries read or -1 on error
|
* @return Number of entries read or -1 on error
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
hashtable_load(HASHTABLE *table, char *filename,
|
hashtable_load(HASHTABLE *table, const char *filename,
|
||||||
void *(*keyread)(int),
|
void *(*keyread)(int),
|
||||||
void *(*valueread)(int))
|
void *(*valueread)(int))
|
||||||
{
|
{
|
||||||
|
@ -119,11 +119,11 @@ void hashtable_get_stats(void* hashtable,
|
|||||||
int* nelems,
|
int* nelems,
|
||||||
int* longest);
|
int* longest);
|
||||||
extern int hashtable_save(HASHTABLE *,
|
extern int hashtable_save(HASHTABLE *,
|
||||||
char *,
|
const char *filename,
|
||||||
int (*keywrite)(int, void*),
|
int (*keywrite)(int, void*),
|
||||||
int (*valuewrite)(int, void*));
|
int (*valuewrite)(int, void*));
|
||||||
extern int hashtable_load(HASHTABLE *,
|
extern int hashtable_load(HASHTABLE *,
|
||||||
char *,
|
const char *filename,
|
||||||
void *(*keyread)(int),
|
void *(*keyread)(int),
|
||||||
void *(*valueread)(int));
|
void *(*valueread)(int));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user