diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2021-03-21 12:33:08 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2021-03-21 12:33:08 -0400 |
commit | e5709866b069fae7a66ff19e2b834cc41add5274 (patch) | |
tree | a9fb42c0d884857cf603717af969aaaf734b6c22 /src/utils | |
parent | c263186300ff673c0426a86886948fe8502b3e7c (diff) |
fix const qualifier warnings
Diffstat (limited to 'src/utils')
-rwxr-xr-x | src/utils/dictionary.c | 10 | ||||
-rwxr-xr-x | src/utils/dictionary.h | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/utils/dictionary.c b/src/utils/dictionary.c index c75e4f3..ac9d933 100755 --- a/src/utils/dictionary.c +++ b/src/utils/dictionary.c @@ -70,7 +70,7 @@ struct dictionary * create_dictionary() { * \return none */ -void put(struct dictionary * d, char * k, char * v) { +void put(struct dictionary * d, const char * k, const char * v) { struct nlist *nl, **p_nl; if (*k == 0) return; @@ -153,7 +153,7 @@ int get_dict_buffer_size(struct dictionary * d) { * \return value for the key */ -char * get(struct dictionary * d, char * key) { +char * get(struct dictionary * d, const char * key) { struct nlist * nl; for (nl = d->list; nl != NULL; nl = nl->next) { @@ -174,7 +174,7 @@ char * get(struct dictionary * d, char * key) { * \return value for the key */ -int get_int(struct dictionary * d, char * key) { +int get_int(struct dictionary * d, const char * key) { struct nlist * nl; for (nl = d->list; nl != NULL; nl = nl->next) { @@ -187,7 +187,7 @@ int get_int(struct dictionary * d, char * key) { } /* Get the key name from a value -char * get_key_name(struct dictionary * d, char * value) { +char * get_key_name(struct dictionary * d, const char * value) { struct nlist * nl; for (nl = d->list; nl != NULL; nl = nl->next) { @@ -209,7 +209,7 @@ char * get_key_name(struct dictionary * d, char * value) { * \return dictionary */ -void parse_str(struct dictionary * d, char * str, int no_blanks) { +void parse_str(struct dictionary * d, const char * str, int no_blanks) { char key[90]; char value[90]; int i; diff --git a/src/utils/dictionary.h b/src/utils/dictionary.h index 899dd9e..b5a1838 100755 --- a/src/utils/dictionary.h +++ b/src/utils/dictionary.h @@ -55,10 +55,10 @@ struct nlist { }; struct dictionary * create_dictionary(); -void put(struct dictionary * d, char * k, char * v); +void put(struct dictionary * d, const char * k, const char * v); void destroy_dictionary(struct dictionary * d); -char * get(struct dictionary * d, char * key); -int get_int(struct dictionary * d, char * key); -//char * get_key_name(struct dictionary * d, char * value); -void parse_str(struct dictionary * d, char * str, int blank_space); +char * get(struct dictionary * d, const char * key); +int get_int(struct dictionary * d, const char * key); +//char * get_key_name(struct dictionary * d, const char * value); +void parse_str(struct dictionary * d, const char * str, int no_blanks); int get_dict_buffer_size(struct dictionary * d); |