Changeset e19eb97 for dict.c


Ignore:
Timestamp:
Aug 15, 2009, 7:08:18 PM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1077891a
Parents:
fa4562c
git-author:
Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
Message:
Add const qualifiers for char * and void *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • dict.c

    r2b37be2 re19eb97  
    3131 * this element would logically go, and stores the index in pos.
    3232 * Returns 1 if found, else 0. */
    33 int _owl_dict_find_pos(owl_dict *d, char *k, int *pos) {
     33int _owl_dict_find_pos(owl_dict *d, const char *k, int *pos) {
    3434  int lo = 0, hi = d->size;
    3535  while (lo < hi) {
     
    5050
    5151/* returns the value corresponding to key k */
    52 void *owl_dict_find_element(owl_dict *d, char *k) {
     52void *owl_dict_find_element(owl_dict *d, const char *k) {
    5353  int found, pos;
    5454  found = _owl_dict_find_pos(d, k, &pos);
     
    8282   Will return -2 if replace=NULL and match was found.
    8383*/
    84 int owl_dict_insert_element(owl_dict *d, char *k, void *v, void (*free_on_replace)(void *old)) {
     84int owl_dict_insert_element(owl_dict *d, const char *k, void *v, void (*free_on_replace)(void *old)) {
    8585  int pos, found;
    8686  char *dupk;
     
    113113/* Doesn't free the value of the element, but does
    114114 * return it so the caller can free it. */
    115 void *owl_dict_remove_element(owl_dict *d, char *k) {
     115void *owl_dict_remove_element(owl_dict *d, const char *k) {
    116116  int i;
    117117  int pos, found;
Note: See TracChangeset for help on using the changeset viewer.