Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Now that we have a clean uthash, remove most of the useless __DECONST
Baptiste Daroussin committed 12 years ago
commit 17ee128f35f5c37a2b675bd3e47d171fa92e474c
parent 3605cfa
8 files changed +63 -63
modified libpkg/elfhints.c
@@ -99,7 +99,7 @@ shlib_list_add(struct shlib_list **shlib_list, const char *dir,

	/* If shlib_file is already in the shlib_list table, don't try
	 * and add it again */
-
	HASH_FIND_STR(*shlib_list, __DECONST(char *, shlib_file), sl);
+
	HASH_FIND_STR(*shlib_list, shlib_file, sl);
	if (sl != NULL)
		return (EPKG_OK);

@@ -117,7 +117,7 @@ shlib_list_add(struct shlib_list **shlib_list, const char *dir,
	
	sl->name = sl->path + dir_len;

-
	HASH_ADD_KEYPTR(hh, *shlib_list, __DECONST(char *, sl->name),
+
	HASH_ADD_KEYPTR(hh, *shlib_list, sl->name,
			strlen(sl->name), sl);

	return (EPKG_OK);
@@ -130,11 +130,11 @@ shlib_list_find_by_name(const char *shlib_file)

	assert(HASH_COUNT(shlibs) != 0);

-
	HASH_FIND_STR(rpath, __DECONST(char *, shlib_file), sl);
+
	HASH_FIND_STR(rpath, shlib_file, sl);
	if (sl != NULL)
		return (sl->path);

-
	HASH_FIND_STR(shlibs, __DECONST(char *, shlib_file), sl);
+
	HASH_FIND_STR(shlibs, shlib_file, sl);
	if (sl != NULL)
		return (sl->path);
		
modified libpkg/pkg.c
@@ -403,7 +403,7 @@ pkg_dep_lookup(const struct pkg *pkg, const char *origin)
	assert(pkg != NULL);
	assert(origin != NULL);

-
	HASH_FIND_STR(pkg->deps, __DECONST(char *, origin), d);
+
	HASH_FIND_STR(pkg->deps, origin, d);

	return (d);
}
@@ -488,7 +488,7 @@ pkg_addlicense(struct pkg *pkg, const char *name)
		return (EPKG_FATAL);
	}

-
	HASH_FIND_STR(pkg->licenses, __DECONST(char *, name), l);
+
	HASH_FIND_STR(pkg->licenses, name, l);
	if (l != NULL) {
		pkg_emit_error("duplicate license listing: %s, ignoring", name);
		return (EPKG_OK);
@@ -511,7 +511,7 @@ pkg_adduid(struct pkg *pkg, const char *name, const char *uidstr)
	assert(pkg != NULL);
	assert(name != NULL && name[0] != '\0');

-
	HASH_FIND_STR(pkg->users, __DECONST(char *, name), u);
+
	HASH_FIND_STR(pkg->users, name, u);
	if (u != NULL) {
		pkg_emit_error("duplicate user listing: %s, ignoring", name);
		return (EPKG_OK);
@@ -545,7 +545,7 @@ pkg_addgid(struct pkg *pkg, const char *name, const char *gidstr)
	assert(pkg != NULL);
	assert(name != NULL && name[0] != '\0');

-
	HASH_FIND_STR(pkg->groups, __DECONST(char *, name), g);
+
	HASH_FIND_STR(pkg->groups, name, g);
	if (g != NULL) {
		pkg_emit_error("duplicate group listing: %s, ignoring", name);
		return (EPKG_OK);
@@ -582,7 +582,7 @@ pkg_adddep(struct pkg *pkg, const char *name, const char *origin, const char *ve
	assert(version != NULL && version[0] != '\0');

	pkg_debug(3, "Pkg: add a new dependency origin: %s, name: %s, version: %s", origin, name, version);
-
	HASH_FIND_STR(pkg->deps, __DECONST(char *, origin), d);
+
	HASH_FIND_STR(pkg->deps, origin, d);
	if (d != NULL) {
		pkg_get(pkg, PKG_NAME, &n1, PKG_VERSION, &v1);
		pkg_emit_error("%s-%s: duplicate dependency listing: %s-%s, ignoring",
@@ -597,7 +597,7 @@ pkg_adddep(struct pkg *pkg, const char *name, const char *origin, const char *ve
	sbuf_set(&d->version, version);
	d->locked = locked;

-
	HASH_ADD_KEYPTR(hh, pkg->deps, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)),
+
	HASH_ADD_KEYPTR(hh, pkg->deps, pkg_dep_get(d, PKG_DEP_ORIGIN),
	    strlen(pkg_dep_get(d, PKG_DEP_ORIGIN)), d);

	return (EPKG_OK);
@@ -621,7 +621,7 @@ pkg_addrdep(struct pkg *pkg, const char *name, const char *origin, const char *v
	sbuf_set(&d->version, version);
	d->locked = locked;

-
	HASH_ADD_KEYPTR(hh, pkg->rdeps, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)),
+
	HASH_ADD_KEYPTR(hh, pkg->rdeps, pkg_dep_get(d, PKG_DEP_ORIGIN),
	    strlen(pkg_dep_get(d, PKG_DEP_ORIGIN)), d);

	return (EPKG_OK);
@@ -644,7 +644,7 @@ pkg_addfile_attr(struct pkg *pkg, const char *path, const char *sha256, const ch
	pkg_debug(3, "Pkg: add new file '%s'", path);

	if (check_duplicates) {
-
		HASH_FIND_STR(pkg->files, __DECONST(char *, path), f);
+
		HASH_FIND_STR(pkg->files, path, f);
		if (f != NULL) {
			pkg_emit_error("duplicate file listing: %s, ignoring", pkg_file_path(f));
			return (EPKG_OK);
@@ -679,7 +679,7 @@ pkg_addcategory(struct pkg *pkg, const char *name)
	assert(pkg != NULL);
	assert(name != NULL && name[0] != '\0');

-
	HASH_FIND_STR(pkg->categories, __DECONST(char *, name), c);
+
	HASH_FIND_STR(pkg->categories, name, c);
	if (c != NULL) {
		pkg_emit_error("duplicate category listing: %s, ignoring", name);
		return (EPKG_OK);
@@ -689,7 +689,7 @@ pkg_addcategory(struct pkg *pkg, const char *name)

	sbuf_set(&c->name, name);

-
	HASH_ADD_KEYPTR(hh, pkg->categories, __DECONST(char *, pkg_category_name(c)),
+
	HASH_ADD_KEYPTR(hh, pkg->categories, pkg_category_name(c),
	    strlen(pkg_category_name(c)), c);

	return (EPKG_OK);
@@ -711,7 +711,7 @@ pkg_adddir_attr(struct pkg *pkg, const char *path, const char *uname, const char

	pkg_debug(3, "Pkg: add new directory '%s'", path);
	if (check_duplicates) {
-
		HASH_FIND_STR(pkg->dirs, __DECONST(char *, path), d);
+
		HASH_FIND_STR(pkg->dirs, path, d);
		if (d != NULL) {
			pkg_emit_error("duplicate directory listing: %s, ignoring", path);
			return (EPKG_OK);
@@ -842,7 +842,7 @@ pkg_addoption(struct pkg *pkg, const char *key, const char *value)
	   default value or description for an option but no actual
	   value. */

-
	HASH_FIND_STR(pkg->options, __DECONST(char *, key), o);
+
	HASH_FIND_STR(pkg->options, key, o);
	if (o == NULL) {
		pkg_option_new(&o);
		sbuf_set(&o->key, key);
@@ -853,7 +853,7 @@ pkg_addoption(struct pkg *pkg, const char *key, const char *value)

	sbuf_set(&o->value, value);
	HASH_ADD_KEYPTR(hh, pkg->options,
-
			__DECONST(char *, pkg_option_opt(o)),
+
			pkg_option_opt(o),
			strlen(pkg_option_opt(o)), o);

	return (EPKG_OK);
@@ -875,7 +875,7 @@ pkg_addoption_default(struct pkg *pkg, const char *key,
	   could be a default value or description for an option but
	   no actual value. */

-
	HASH_FIND_STR(pkg->options, __DECONST(char *, key), o);
+
	HASH_FIND_STR(pkg->options, key, o);
	if (o == NULL) {
		pkg_option_new(&o);
		sbuf_set(&o->key, key);
@@ -886,7 +886,7 @@ pkg_addoption_default(struct pkg *pkg, const char *key,

	sbuf_set(&o->default_value, default_value);
	HASH_ADD_KEYPTR(hh, pkg->options,
-
			__DECONST(char *, pkg_option_default_value(o)),
+
			pkg_option_default_value(o),
			strlen(pkg_option_default_value(o)), o);

	return (EPKG_OK);
@@ -907,7 +907,7 @@ pkg_addoption_description(struct pkg *pkg, const char *key,
	   is already set. Which implies there could be a default
	   value or description for an option but no actual value. */

-
	HASH_FIND_STR(pkg->options, __DECONST(char *, key), o);
+
	HASH_FIND_STR(pkg->options, key, o);
	if (o == NULL) {
		pkg_option_new(&o);
		sbuf_set(&o->key, key);
@@ -918,7 +918,7 @@ pkg_addoption_description(struct pkg *pkg, const char *key,

	sbuf_set(&o->description, description);
	HASH_ADD_KEYPTR(hh, pkg->options,
-
			__DECONST(char *, pkg_option_description(o)),
+
			pkg_option_description(o),
			strlen(pkg_option_description(o)), o);

	return (EPKG_OK);
@@ -932,7 +932,7 @@ pkg_addshlib_required(struct pkg *pkg, const char *name)
	assert(pkg != NULL);
	assert(name != NULL && name[0] != '\0');

-
	HASH_FIND_STR(pkg->shlibs_required, __DECONST(char *, name), s);
+
	HASH_FIND_STR(pkg->shlibs_required, name, s);
	/* silently ignore duplicates in case of shlibs */
	if (s != NULL)
		return (EPKG_OK);
@@ -942,7 +942,7 @@ pkg_addshlib_required(struct pkg *pkg, const char *name)
	sbuf_set(&s->name, name);

	HASH_ADD_KEYPTR(hh, pkg->shlibs_required,
-
	    __DECONST(char *, pkg_shlib_name(s)),
+
	    pkg_shlib_name(s),
	    strlen(pkg_shlib_name(s)), s);

	return (EPKG_OK);
@@ -956,7 +956,7 @@ pkg_addshlib_provided(struct pkg *pkg, const char *name)
	assert(pkg != NULL);
	assert(name != NULL && name[0] != '\0');

-
	HASH_FIND_STR(pkg->shlibs_provided, __DECONST(char *, name), s);
+
	HASH_FIND_STR(pkg->shlibs_provided, name, s);
	/* silently ignore duplicates in case of shlibs */
	if (s != NULL)
		return (EPKG_OK);
@@ -966,7 +966,7 @@ pkg_addshlib_provided(struct pkg *pkg, const char *name)
	sbuf_set(&s->name, name);

	HASH_ADD_KEYPTR(hh, pkg->shlibs_provided,
-
	    __DECONST(char *, pkg_shlib_name(s)),
+
	    pkg_shlib_name(s),
	    strlen(pkg_shlib_name(s)), s);

	return (EPKG_OK);
@@ -983,7 +983,7 @@ pkg_addannotation(struct pkg *pkg, const char *tag, const char *value)

	/* Tags are unique per-package */

-
	HASH_FIND_STR(pkg->annotations, __DECONST(char *, tag), an);
+
	HASH_FIND_STR(pkg->annotations, tag, an);
	if (an != NULL) {
		pkg_emit_error("duplicate annotation tag: %s value: %s,"
			       " ignoring", tag, value);
@@ -996,7 +996,7 @@ pkg_addannotation(struct pkg *pkg, const char *tag, const char *value)
	sbuf_set(&an->value, value);

	HASH_ADD_KEYPTR(hh, pkg->annotations,
-
	    __DECONST(char *, pkg_annotation_tag(an)),
+
	    pkg_annotation_tag(an),
	    strlen(pkg_annotation_tag(an)), an);

	return (EPKG_OK);
@@ -1010,7 +1010,7 @@ pkg_annotation_lookup(const struct pkg *pkg, const char *tag)
	assert(pkg != NULL);
	assert(tag != NULL);

-
	HASH_FIND_STR(pkg->annotations, __DECONST(char *, tag), an);
+
	HASH_FIND_STR(pkg->annotations, tag, an);

	return (an);
}
@@ -1023,7 +1023,7 @@ pkg_delannotation(struct pkg *pkg, const char *tag)
	assert(pkg != NULL);
	assert(tag != NULL);

-
	HASH_FIND_STR(pkg->annotations, __DECONST(char *, tag), an);
+
	HASH_FIND_STR(pkg->annotations, tag, an);
	if (an != NULL) {
		HASH_DEL(pkg->annotations, an);
		pkg_annotation_free(an);
@@ -1502,7 +1502,7 @@ pkg_has_file(struct pkg *p, const char *path)
{
	struct pkg_file *f;

-
	HASH_FIND_STR(p->files, __DECONST(char *, path), f);
+
	HASH_FIND_STR(p->files, path, f);

	return (f != NULL ? true : false);
}
@@ -1512,7 +1512,7 @@ pkg_has_dir(struct pkg *p, const char *path)
{
	struct pkg_dir *d;

-
	HASH_FIND_STR(p->dirs, __DECONST(char *, path), d);
+
	HASH_FIND_STR(p->dirs, path, d);

	return (d != NULL ? true : false);
}
modified libpkg/pkg_config.c
@@ -1063,7 +1063,7 @@ pkg_init(const char *path, const char *reposdir)
		}

		HASH_ADD_INT(config, id, conf);
-
		HASH_ADD_KEYPTR(hhkey, config_by_key, __DECONST(char *, conf->key),
+
		HASH_ADD_KEYPTR(hhkey, config_by_key, conf->key,
		    strlen(conf->key), conf);
	}

@@ -1166,7 +1166,7 @@ pkg_config_lookup(const char *name)
	if (name == NULL)
		return (NULL);

-
	HASH_FIND(hhkey, config_by_key, __DECONST(char *, name), strlen(name), conf);
+
	HASH_FIND(hhkey, config_by_key, name, strlen(name), conf);

	return (conf);
}
@@ -1388,6 +1388,6 @@ pkg_repo_find_name(const char *reponame)
{
	struct pkg_repo *r;

-
	HASH_FIND_STR(repos, __DECONST(char *, reponame), r);
+
	HASH_FIND_STR(repos, reponame, r);
	return (r);
}
modified libpkg/pkg_jobs.c
@@ -140,10 +140,10 @@ populate_local_rdeps(struct pkg_jobs *j, struct pkg *p)
	char *origin;

	while (pkg_rdeps(p, &d) == EPKG_OK) {
-
		HASH_FIND_STR(j->bulk, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), pkg);
+
		HASH_FIND_STR(j->bulk, pkg_dep_get(d, PKG_DEP_ORIGIN), pkg);
		if (pkg != NULL)
			continue;
-
		HASH_FIND_STR(j->seen, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), pkg);
+
		HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), pkg);
		if (pkg != NULL)
			continue;
		if ((pkg = get_local_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), PKG_LOAD_BASIC|PKG_LOAD_RDEPS)) == NULL) {
@@ -165,7 +165,7 @@ remove_from_rdeps(struct pkg_jobs *j, const char *origin)
	struct pkg_dep *d;

	HASH_ITER(hh, j->bulk, pkg, tmp) {
-
		HASH_FIND_STR(pkg->rdeps, __DECONST(char *, origin), d);
+
		HASH_FIND_STR(pkg->rdeps, origin, d);
		if (d != NULL) {
			HASH_DEL(pkg->rdeps, d);
			pkg_dep_free(d);
@@ -264,7 +264,7 @@ jobs_solve_deinstall(struct pkg_jobs *j)
	HASH_ITER(hh, j->bulk, pkg, tmp) {
		d = NULL;
		HASH_ITER(hh, pkg->rdeps, d, dtmp) {
-
			HASH_FIND_STR(j->seen, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), p);
+
			HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), p);
			if (p != NULL) {
				HASH_DEL(pkg->rdeps, d);
				pkg_dep_free(d);
@@ -366,7 +366,7 @@ jobs_solve_upgrade(struct pkg_jobs *j)
	HASH_ITER(hh, j->bulk, pkg, tmp) {
		d = NULL;
		HASH_ITER(hh, pkg->deps, d, dtmp) {
-
			HASH_FIND_STR(j->seen, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), p);
+
			HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), p);
			if (p != NULL) {
				HASH_DEL(pkg->deps, d);
				pkg_dep_free(d);
@@ -398,7 +398,7 @@ remove_from_deps(struct pkg_jobs *j, const char *origin)
	struct pkg_dep *d;

	HASH_ITER(hh, j->bulk, pkg, tmp) {
-
		HASH_FIND_STR(pkg->deps, __DECONST(char *, origin), d);
+
		HASH_FIND_STR(pkg->deps, origin, d);
		if (d != NULL) {
			HASH_DEL(pkg->deps, d);
			pkg_dep_free(d);
@@ -470,10 +470,10 @@ populate_rdeps(struct pkg_jobs *j, struct pkg *p)
	struct pkg_dep *d = NULL;

	while (pkg_rdeps(p, &d) == EPKG_OK) {
-
		HASH_FIND_STR(j->bulk, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), pkg);
+
		HASH_FIND_STR(j->bulk, pkg_dep_get(d, PKG_DEP_ORIGIN), pkg);
		if (pkg != NULL)
			continue;
-
		HASH_FIND_STR(j->seen, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), pkg);
+
		HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), pkg);
		if (pkg != NULL)
			continue;
		if (get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), MATCH_EXACT, true) != EPKG_OK) {
@@ -492,10 +492,10 @@ populate_deps(struct pkg_jobs *j, struct pkg *p)
	struct pkg_dep *d = NULL;

	while (pkg_deps(p, &d) == EPKG_OK) {
-
		HASH_FIND_STR(j->bulk, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), pkg);
+
		HASH_FIND_STR(j->bulk, pkg_dep_get(d, PKG_DEP_ORIGIN), pkg);
		if (pkg != NULL)
			continue;
-
		HASH_FIND_STR(j->seen, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), pkg);
+
		HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), pkg);
		if (pkg != NULL)
			continue;
		if (get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), MATCH_EXACT, false) != EPKG_OK) {
@@ -539,7 +539,7 @@ new_pkg_version(struct pkg_jobs *j)
	}

	/* Remove from seen in case it was explicitly requested. */
-
	HASH_FIND_STR(j->seen, __DECONST(char *, origin), p);
+
	HASH_FIND_STR(j->seen, origin, p);
	if (p != NULL)
		HASH_DEL(j->seen, p);

@@ -868,7 +868,7 @@ jobs_solve_install(struct pkg_jobs *j)
	HASH_ITER(hh, j->bulk, pkg, tmp) {
		d = NULL;
		HASH_ITER(hh, pkg->deps, d, dtmp) {
-
			HASH_FIND_STR(j->seen, __DECONST(char *, pkg_dep_get(d, PKG_DEP_ORIGIN)), p);
+
			HASH_FIND_STR(j->seen, pkg_dep_get(d, PKG_DEP_ORIGIN), p);
			if (p != NULL) {
				HASH_DEL(pkg->deps, d);
				pkg_dep_free(d);
@@ -981,7 +981,7 @@ pkg_jobs_find(struct pkg_jobs *j, const char *origin, struct pkg **p)
{
	struct pkg *pkg;

-
	HASH_FIND_STR(j->jobs, __DECONST(char *, origin), pkg);
+
	HASH_FIND_STR(j->jobs, origin, pkg);
	if (pkg == NULL)
		return (EPKG_FATAL);

modified libpkg/pkg_manifest.c
@@ -140,12 +140,12 @@ pkg_manifest_keys_new(struct pkg_manifest_key **key)
		return (EPKG_OK);

	for (i = 0; manifest_keys[i].key != NULL; i++) {
-
		HASH_FIND_STR(*key, __DECONST(char *, manifest_keys[i].key), k);
+
		HASH_FIND_STR(*key, manifest_keys[i].key, k);
		if (k == NULL) {
			k = calloc(1, sizeof(struct pkg_manifest_key));
			k->key = manifest_keys[i].key;
			k->type = manifest_keys[i].type;
-
			HASH_ADD_KEYPTR(hh, *key, __DECONST(char *, k->key), strlen(k->key), k);
+
			HASH_ADD_KEYPTR(hh, *key, k->key, strlen(k->key), k);
		}
		HASH_FIND_UCLT(k->parser, &manifest_keys[i].valid_type, dp);
		if (dp != NULL)
@@ -619,7 +619,7 @@ parse_manifest(struct pkg *pkg, struct pkg_manifest_key *keys, ucl_object_t *obj

	HASH_ITER(hh, obj->value.ov, sub, tmp) {
		pkg_debug(2, "Manifest: found key: '%s'", ucl_object_key(sub));
-
		HASH_FIND_STR(keys, __DECONST(char *, ucl_object_key(sub)), selected_key);
+
		HASH_FIND_STR(keys, ucl_object_key(sub), selected_key);
		if (selected_key != NULL) {
			HASH_FIND_UCLT(selected_key->parser, &sub->type, dp);
			if (dp != NULL) {
@@ -655,7 +655,7 @@ pkg_parse_manifest(struct pkg *pkg, char *buf, size_t len, struct pkg_manifest_k
		obj = ucl_parser_get_object(p);
		if (obj != NULL) {
			HASH_ITER(hh, obj->value.ov, sub, tmp) {
-
				HASH_FIND_STR(keys, __DECONST(char *, ucl_object_key(sub)), sk);
+
				HASH_FIND_STR(keys, ucl_object_key(sub), sk);
				if (sk != NULL) {
					HASH_FIND_UCLT(sk->parser, &sub->type, dp);
					if (dp == NULL) {
modified libpkg/plugins.c
@@ -179,7 +179,7 @@ pkg_plugin_conf_add_string(struct pkg_plugin *p, int id, const char *key, const
		return (EPKG_FATAL);
	}

-
	HASH_FIND(hhkey, p->conf_by_key, __DECONST(char *, key), strlen(key), conf);
+
	HASH_FIND(hhkey, p->conf_by_key, key, strlen(key), conf);
	if (conf != NULL) {
		pkg_emit_error("A configuration with the same key(%s) is already registred", key);
		return (EPKG_FATAL);
@@ -201,7 +201,7 @@ pkg_plugin_conf_add_string(struct pkg_plugin *p, int id, const char *key, const
	}

	HASH_ADD_INT(p->conf, id, conf);
-
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, __DECONST(char *, conf->key),
+
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, conf->key,
	    strlen(conf->key), conf);

	return (EPKG_OK);
@@ -219,7 +219,7 @@ pkg_plugin_conf_add_bool(struct pkg_plugin *p, int id, const char *key, bool boo
		return (EPKG_FATAL);
	}

-
	HASH_FIND(hhkey, p->conf_by_key, __DECONST(char *, key), strlen(key), conf);
+
	HASH_FIND(hhkey, p->conf_by_key, key, strlen(key), conf);
	if (conf != NULL) {
		pkg_emit_error("A configuration with the same key(%s) is already registred", key);
		return (EPKG_FATAL);
@@ -247,7 +247,7 @@ pkg_plugin_conf_add_bool(struct pkg_plugin *p, int id, const char *key, bool boo
	}

	HASH_ADD_INT(p->conf, id, conf);
-
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, __DECONST(char *, conf->key),
+
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, conf->key,
	    strlen(conf->key), conf);

	return (EPKG_OK);
@@ -266,7 +266,7 @@ pkg_plugin_conf_add_integer(struct pkg_plugin *p, int id, const char *key, int64
		return (EPKG_FATAL);
	}

-
	HASH_FIND(hhkey, p->conf_by_key, __DECONST(char *, key), strlen(key), conf);
+
	HASH_FIND(hhkey, p->conf_by_key, key, strlen(key), conf);
	if (conf != NULL) {
		pkg_emit_error("A configuration with the same key(%s) is already registred", key);
		return (EPKG_FATAL);
@@ -292,7 +292,7 @@ pkg_plugin_conf_add_integer(struct pkg_plugin *p, int id, const char *key, int64
	}

	HASH_ADD_INT(p->conf, id, conf);
-
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, __DECONST(char *, conf->key),
+
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, conf->key,
	    strlen(conf->key), conf);

	return (EPKG_OK);
@@ -309,7 +309,7 @@ pkg_plugin_conf_add_kvlist(struct pkg_plugin *p, int id, const char *key)
		return (EPKG_FATAL);
	}

-
	HASH_FIND(hhkey, p->conf_by_key, __DECONST(char *, key), strlen(key), conf);
+
	HASH_FIND(hhkey, p->conf_by_key, key, strlen(key), conf);
	if (conf != NULL) {
		pkg_emit_error("A configuration with the same key(%s) is already registred", key);
		return (EPKG_FATAL);
@@ -322,7 +322,7 @@ pkg_plugin_conf_add_kvlist(struct pkg_plugin *p, int id, const char *key)
	conf->kvlist = NULL;

	HASH_ADD_INT(p->conf, id, conf);
-
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, __DECONST(char *, conf->key),
+
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, conf->key,
	    strlen(conf->key), conf);

	return (EPKG_OK);
@@ -339,7 +339,7 @@ pkg_plugin_conf_add_list(struct pkg_plugin *p, int id, const char *key)
		return (EPKG_FATAL);
	}

-
	HASH_FIND(hhkey, p->conf_by_key, __DECONST(char *, key), strlen(key), conf);
+
	HASH_FIND(hhkey, p->conf_by_key, key, strlen(key), conf);
	if (conf != NULL) {
		pkg_emit_error("A configuration with the same key(%s) is already registred", key);
		return (EPKG_FATAL);
@@ -352,7 +352,7 @@ pkg_plugin_conf_add_list(struct pkg_plugin *p, int id, const char *key)
	conf->list = NULL;

	HASH_ADD_INT(p->conf, id, conf);
-
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, __DECONST(char *, conf->key),
+
	HASH_ADD_KEYPTR(hhkey, p->conf_by_key, conf->key,
	    strlen(conf->key), conf);

	return (EPKG_OK);
modified libpkg/update.c
@@ -653,7 +653,7 @@ pkg_update_incremental(const char *name, struct pkg_repo *repo, time_t *mtime)
			goto cleanup;
		}
		processed++;
-
		HASH_FIND_STR(ldel, __DECONST(char *, origin), item);
+
		HASH_FIND_STR(ldel, origin, item);
		if (item == NULL) {
			added++;
			pkg_update_increment_item_new(&ladd, origin, digest, num_offset);
modified pkg/version.c
@@ -384,7 +384,7 @@ exec_version(int argc, char **argv)
				continue;

			if (opt & VERSION_SOURCE_INDEX) {
-
				HASH_FIND_STR(indexhead, __DECONST(char *, origin), entry);
+
				HASH_FIND_STR(indexhead, origin, entry);
				if (entry != NULL)
					print_version(pkg, "index", entry->version, limchar, opt);
			} else if (opt & VERSION_SOURCE_PORTS) {