mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
correct wrong function prefixes: g_istr -> i_istr
This commit is contained in:
parent
edb2f699d1
commit
9181796472
@ -740,8 +740,7 @@ int cmd_get_params(const char *data, gpointer *free_me, int count, ...)
|
||||
opthash = (GHashTable **) va_arg(args, GHashTable **);
|
||||
|
||||
rec->options = *opthash =
|
||||
g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
ignore_unknown = count & PARAM_FLAG_UNKNOWN_OPTIONS;
|
||||
error = get_cmd_options(&datad, ignore_unknown,
|
||||
|
@ -408,17 +408,17 @@ char *convert_home(const char *path)
|
||||
}
|
||||
}
|
||||
|
||||
int g_istr_equal(gconstpointer v, gconstpointer v2)
|
||||
int i_istr_equal(gconstpointer v, gconstpointer v2)
|
||||
{
|
||||
return g_ascii_strcasecmp((const char *) v, (const char *) v2) == 0;
|
||||
}
|
||||
|
||||
int g_istr_cmp(gconstpointer v, gconstpointer v2)
|
||||
int i_istr_cmp(gconstpointer v, gconstpointer v2)
|
||||
{
|
||||
return g_ascii_strcasecmp((const char *) v, (const char *) v2);
|
||||
}
|
||||
|
||||
guint g_istr_hash(gconstpointer v)
|
||||
guint i_istr_hash(gconstpointer v)
|
||||
{
|
||||
const signed char *p;
|
||||
guint32 h = 5381;
|
||||
|
@ -41,11 +41,11 @@ GList *optlist_remove_known(const char *cmd, GHashTable *optlist);
|
||||
char *convert_home(const char *path);
|
||||
|
||||
/* Case-insensitive string hash functions */
|
||||
int g_istr_equal(gconstpointer v, gconstpointer v2);
|
||||
unsigned int g_istr_hash(gconstpointer v);
|
||||
int i_istr_equal(gconstpointer v, gconstpointer v2);
|
||||
unsigned int i_istr_hash(gconstpointer v);
|
||||
|
||||
/* Case-insensitive GCompareFunc func */
|
||||
int g_istr_cmp(gconstpointer v, gconstpointer v2);
|
||||
int i_istr_cmp(gconstpointer v, gconstpointer v2);
|
||||
|
||||
/* Find `mask' from `data', you can use * and ? wildcards. */
|
||||
int match_wildcards(const char *mask, const char *data);
|
||||
|
@ -456,8 +456,7 @@ static void sig_channel_created(CHANNEL_REC *channel)
|
||||
{
|
||||
g_return_if_fail(IS_CHANNEL(channel));
|
||||
|
||||
channel->nicks = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
channel->nicks = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
}
|
||||
|
||||
static void nicklist_remove_hash(gpointer key, NICK_REC *nick,
|
||||
|
@ -876,8 +876,7 @@ static int sig_autosave(void)
|
||||
|
||||
void settings_init(void)
|
||||
{
|
||||
settings = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
settings = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
last_errors = NULL;
|
||||
last_invalid_modules = NULL;
|
||||
|
@ -425,7 +425,8 @@ static GList *completion_get_settings(const char *key, SettingType type)
|
||||
SETTINGS_REC *rec = tmp->data;
|
||||
|
||||
if ((type == SETTING_TYPE_ANY || rec->type == type) && g_ascii_strncasecmp(rec->key, key, len) == 0)
|
||||
complist = g_list_insert_sorted(complist, g_strdup(rec->key), (GCompareFunc) g_istr_cmp);
|
||||
complist = g_list_insert_sorted(complist, g_strdup(rec->key),
|
||||
(GCompareFunc) i_istr_cmp);
|
||||
}
|
||||
g_slist_free(sets);
|
||||
return complist;
|
||||
@ -460,7 +461,8 @@ static GList *completion_get_aliases(const char *alias, char cmdchar)
|
||||
be appended after command completions and kept in
|
||||
uppercase to show it's an alias */
|
||||
if (glist_find_icase_string(complist, word) == NULL)
|
||||
complist = g_list_insert_sorted(complist, word, (GCompareFunc) g_istr_cmp);
|
||||
complist =
|
||||
g_list_insert_sorted(complist, word, (GCompareFunc) i_istr_cmp);
|
||||
else
|
||||
g_free(word);
|
||||
}
|
||||
@ -489,7 +491,8 @@ static GList *completion_get_commands(const char *cmd, char cmdchar)
|
||||
word = cmdchar == '\0' ? g_strdup(rec->cmd) :
|
||||
g_strdup_printf("%c%s", cmdchar, rec->cmd);
|
||||
if (glist_find_icase_string(complist, word) == NULL)
|
||||
complist = g_list_insert_sorted(complist, word, (GCompareFunc) g_istr_cmp);
|
||||
complist =
|
||||
g_list_insert_sorted(complist, word, (GCompareFunc) i_istr_cmp);
|
||||
else
|
||||
g_free(word);
|
||||
}
|
||||
@ -523,7 +526,8 @@ static GList *completion_get_subcommands(const char *cmd)
|
||||
continue;
|
||||
|
||||
if (g_ascii_strncasecmp(rec->cmd, cmd, len) == 0)
|
||||
complist = g_list_insert_sorted(complist, g_strdup(rec->cmd+skip), (GCompareFunc) g_istr_cmp);
|
||||
complist = g_list_insert_sorted(complist, g_strdup(rec->cmd + skip),
|
||||
(GCompareFunc) i_istr_cmp);
|
||||
}
|
||||
return complist;
|
||||
}
|
||||
|
@ -56,8 +56,7 @@ THEME_REC *theme_create(const char *path, const char *name)
|
||||
rec->name = g_strdup(name);
|
||||
rec->abstracts = g_hash_table_new((GHashFunc) g_str_hash,
|
||||
(GCompareFunc) g_str_equal);
|
||||
rec->modules = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
rec->modules = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
themes = g_slist_append(themes, rec);
|
||||
signal_emit("theme created", 1, rec);
|
||||
|
||||
|
@ -176,8 +176,7 @@ static void print_netjoins(NETJOIN_SERVER_REC *server, const char *filter_channe
|
||||
|
||||
/* save nicks to string, clear now_channels and remove the same
|
||||
channels from old_channels list */
|
||||
channels = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
channels = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
for (tmp = server->netjoins; tmp != NULL; tmp = next) {
|
||||
NETJOIN_REC *rec = tmp->data;
|
||||
|
||||
|
@ -102,8 +102,7 @@ void event_connected(IRC_SERVER_REC *server, const char *data, const char *from)
|
||||
|
||||
void irc_server_init_bare_minimum(IRC_SERVER_REC *server) {
|
||||
server->rawlog = rawlog_create();
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
/* set the standards */
|
||||
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
|
||||
|
@ -283,8 +283,7 @@ static void server_init(IRC_SERVER_REC *server)
|
||||
g_free(cmd);
|
||||
}
|
||||
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
/* set the standards */
|
||||
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
|
||||
@ -417,10 +416,9 @@ static void sig_connected(IRC_SERVER_REC *server)
|
||||
(QUERY_REC *(*)(SERVER_REC *, const char *)) irc_query_find;
|
||||
server->nick_comp_func = irc_nickcmp_rfc1459;
|
||||
|
||||
server->splits = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->splits = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
if (!server->session_reconnect)
|
||||
if (!server->session_reconnect)
|
||||
server_init(server);
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,8 @@ static void sig_session_restore_server(IRC_SERVER_REC *server,
|
||||
server->connrec->sasl_password = g_strdup(config_node_get_str(node, "sasl_password", NULL));
|
||||
|
||||
if (server->isupport == NULL) {
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport =
|
||||
g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
}
|
||||
|
||||
node = config_node_section(NULL, node, "isupport", -1);
|
||||
|
@ -120,8 +120,7 @@ static void flood_init_server(IRC_SERVER_REC *server)
|
||||
rec = g_new0(MODULE_SERVER_REC, 1);
|
||||
MODULE_DATA_SET(server, rec);
|
||||
|
||||
rec->floodlist = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
rec->floodlist = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
}
|
||||
|
||||
static void flood_hash_destroy(const char *key, FLOOD_REC *flood)
|
||||
|
@ -20,13 +20,13 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
static int g_istr_equal(gconstpointer v, gconstpointer v2)
|
||||
static int i_istr_equal(gconstpointer v, gconstpointer v2)
|
||||
{
|
||||
return g_ascii_strcasecmp((const char *) v, (const char *) v2) == 0;
|
||||
}
|
||||
|
||||
/* a char* hash function from ASU */
|
||||
static unsigned int g_istr_hash(gconstpointer v)
|
||||
static unsigned int i_istr_hash(gconstpointer v)
|
||||
{
|
||||
const char *s = (const char *) v;
|
||||
unsigned int h = 0, g;
|
||||
@ -314,7 +314,7 @@ CONFIG_REC *config_open(const char *fname, int create_mode)
|
||||
rec->create_mode = create_mode;
|
||||
rec->mainnode = g_new0(CONFIG_NODE, 1);
|
||||
rec->mainnode->type = NODE_TYPE_BLOCK;
|
||||
rec->cache = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal);
|
||||
rec->cache = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
rec->cache_nodes = g_hash_table_new((GHashFunc) g_direct_hash, (GCompareFunc) g_direct_equal);
|
||||
|
||||
return rec;
|
||||
|
@ -102,8 +102,7 @@ static void server_destroy_flood_tear_down(ServerDestroyFloodData *fixture, cons
|
||||
|
||||
static void irc_server_init_bare_minimum(IRC_SERVER_REC *server)
|
||||
{
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
/* set the standards */
|
||||
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
|
||||
|
Loading…
Reference in New Issue
Block a user