Don't cast away constness for the key in g_hash_table_lookup().

Change-Id: Ibd5cf8947028d90a734de629e3c4202af9d0514b
Reviewed-on: https://code.wireshark.org/review/12887
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-12-28 13:00:39 -08:00
parent c2b7743264
commit bc13e834cc
5 changed files with 9 additions and 9 deletions

View File

@ -112,7 +112,7 @@ static p1_address_ctx_t *get_do_address_ctx(asn1_ctx_t* actx)
if (actx->pinfo->private_table) {
/* First check if called from an extension attribute */
ctx = (p1_address_ctx_t *)g_hash_table_lookup(actx->pinfo->private_table, (gpointer)P1_ADDRESS_CTX);
ctx = (p1_address_ctx_t *)g_hash_table_lookup(actx->pinfo->private_table, P1_ADDRESS_CTX);
}
if (!ctx) {

View File

@ -915,7 +915,7 @@ static p1_address_ctx_t *get_do_address_ctx(asn1_ctx_t* actx)
if (actx->pinfo->private_table) {
/* First check if called from an extension attribute */
ctx = (p1_address_ctx_t *)g_hash_table_lookup(actx->pinfo->private_table, (gpointer)P1_ADDRESS_CTX);
ctx = (p1_address_ctx_t *)g_hash_table_lookup(actx->pinfo->private_table, P1_ADDRESS_CTX);
}
if (!ctx) {

View File

@ -2156,7 +2156,7 @@ has_heur_dissector_list(const gchar *name) {
heur_dtbl_entry_t* find_heur_dissector_by_unique_short_name(const char *short_name)
{
return (heur_dtbl_entry_t*)g_hash_table_lookup(heuristic_short_names, (gpointer)short_name);
return (heur_dtbl_entry_t*)g_hash_table_lookup(heuristic_short_names, short_name);
}
void
@ -2205,7 +2205,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const char *dis
}
/* Ensure short_name is unique */
if (g_hash_table_lookup(heuristic_short_names, (gpointer)short_name) != NULL) {
if (g_hash_table_lookup(heuristic_short_names, short_name) != NULL) {
g_error("Duplicate heuristic short_name \"%s\"!"
" This might be caused by an inappropriate plugin or a development error.", short_name);
}

View File

@ -5321,7 +5321,7 @@ proto_register_protocol(const char *name, const char *short_name,
}
g_hash_table_insert(proto_names, key, (gpointer)name);
existing_protocol = (const protocol_t *)g_hash_table_lookup(proto_short_names, (gpointer)short_name);
existing_protocol = (const protocol_t *)g_hash_table_lookup(proto_short_names, short_name);
if (existing_protocol != NULL) {
g_error("Duplicate protocol short_name \"%s\"!"
" This might be caused by an inappropriate plugin or a development error.", short_name);
@ -5339,7 +5339,7 @@ proto_register_protocol(const char *name, const char *short_name,
" Allowed are lower characters, digits, '-', '_' and '.'."
" This might be caused by an inappropriate plugin or a development error.", filter_name);
}
existing_protocol = (const protocol_t *)g_hash_table_lookup(proto_filter_names, (gpointer)filter_name);
existing_protocol = (const protocol_t *)g_hash_table_lookup(proto_filter_names, filter_name);
if (existing_protocol != NULL) {
g_error("Duplicate protocol filter_name \"%s\"!"
" This might be caused by an inappropriate plugin or a development error.", filter_name);
@ -5533,7 +5533,7 @@ proto_get_id_by_filter_name(const gchar *filter_name)
DISSECTOR_ASSERT_HINT(filter_name, "No filter name present");
protocol = (const protocol_t *)g_hash_table_lookup(proto_filter_names, (gpointer)filter_name);
protocol = (const protocol_t *)g_hash_table_lookup(proto_filter_names, filter_name);
if (protocol == NULL)
return -1;
@ -5547,7 +5547,7 @@ proto_get_id_by_short_name(const gchar *short_name)
DISSECTOR_ASSERT_HINT(short_name, "No short name present");
protocol = (const protocol_t *)g_hash_table_lookup(proto_short_names, (gpointer)short_name);
protocol = (const protocol_t *)g_hash_table_lookup(proto_short_names, short_name);
if (protocol == NULL)
return -1;

View File

@ -97,7 +97,7 @@ static int PrivateTable__index(lua_State* L) {
const gchar* name = luaL_checkstring(L,2);
const gchar* string;
string = (const gchar *)(g_hash_table_lookup (priv->table, (gpointer) name));
string = (const gchar *)(g_hash_table_lookup (priv->table, name));
if (string) {
lua_pushstring(L, string);