Skip to content

Commit

Permalink
compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailin Nemui committed Apr 24, 2017
1 parent 13a1e59 commit ea7c421
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/gui-keyboard.c
Expand Up @@ -80,7 +80,7 @@ char *gui_keyboard_get_event_string(GdkEventKey *event)
if (event->keyval > 255) {
len = cmd->len;
g_string_append(cmd, gdk_keyval_name(event->keyval));
g_strdown(cmd->str+len);
ascii_strdown(cmd->str+len);
} else if (event->keyval == ' ')
g_string_append(cmd, "space");
else if (event->keyval == '\n')
Expand Down
2 changes: 1 addition & 1 deletion src/gui-nicklist-view.c
Expand Up @@ -348,6 +348,6 @@ void gui_nicklist_views_deinit(void)
for (i = 0; i < 256; i++)
{
if (status_pixbufs[i] != NULL)
gdk_pixbuf_unref(status_pixbufs[i]);
g_object_unref(status_pixbufs[i]);
}
}
2 changes: 1 addition & 1 deletion src/gui-tab-move.c
Expand Up @@ -70,7 +70,7 @@ static void create_pixmap_popup(GtkWidget **widget, char **data)

pixbuf = gdk_pixbuf_new_from_xpm_data((const char **) data);
gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap, &bitmap, 128);
gdk_pixbuf_unref(pixbuf);
g_object_unref(pixbuf);

win = gtk_window_new(GTK_WINDOW_POPUP);
image = gtk_image_new_from_pixmap(pixmap, bitmap);
Expand Down
4 changes: 2 additions & 2 deletions src/gui-tab.c
Expand Up @@ -550,6 +550,6 @@ void gui_tabs_init(void)

void gui_tabs_deinit(void)
{
gdk_pixbuf_unref(move_pixbuf);
gdk_pixbuf_unref(right_pixbuf);
g_object_unref(move_pixbuf);
g_object_unref(right_pixbuf);
}
3 changes: 0 additions & 3 deletions src/gui-window-activity.c
Expand Up @@ -50,7 +50,6 @@ static void sig_activity(Window *window)

static void tab_update_activity(Tab *tab)
{
GdkColor color;
GList *tmp;
int data_level;

Expand All @@ -68,8 +67,6 @@ static void tab_update_activity(Tab *tab)

static void tab_clear_activity(Tab *tab)
{
GList *tmp;

tab->data_level = 0;
}

Expand Down
2 changes: 0 additions & 2 deletions src/gui-window.c
Expand Up @@ -309,11 +309,9 @@ static void sig_window_created(Window *window, void *automatic)
static void sig_window_destroyed(Window *window)
{
WindowGui *gui;
GtkWidget *widget;
Frame *frame;

gui = WINDOW_GUI(window);
widget = gui->widget;

signal_emit("gui window destroyed", 1, gui);

Expand Down
8 changes: 4 additions & 4 deletions src/setup-channels.c
Expand Up @@ -133,7 +133,7 @@ static void network_remove_with_channels(const char *network)

next = tmp->next;
if (channel->chatnet == NULL ||
g_strcasecmp(channel->chatnet, network) != 0)
g_ascii_strcasecmp(channel->chatnet, network) != 0)
continue;

channel_setup_remove(channel);
Expand Down Expand Up @@ -198,7 +198,7 @@ static gboolean store_find_network_func(GtkTreeModel *model, GtkTreePath *path,
return FALSE;

gtk_tree_model_get(model, iter, COL_NAME, &iter_name, -1);
if (g_strcasecmp(iter_name, rec->network) == 0) {
if (g_ascii_strcasecmp(iter_name, rec->network) == 0) {
rec->found = TRUE;
memcpy(rec->iter, iter, sizeof(GtkTreeIter));
}
Expand Down Expand Up @@ -433,7 +433,7 @@ static void sig_channel_added(ChannelConfig *channel)
/* we were below a network */
gtk_tree_model_get(model, &parent, COL_NAME, &name, -1);
if (channel->chatnet == NULL ||
g_strcasecmp(channel->chatnet, name) != 0)
g_ascii_strcasecmp(channel->chatnet, name) != 0)
append = TRUE;
g_free(name);
} else {
Expand Down Expand Up @@ -492,7 +492,7 @@ static int network_has_channels(const char *network)
CHANNEL_SETUP_REC *rec = tmp->data;

if (rec->chatnet != NULL &&
g_strcasecmp(rec->chatnet, network) == 0)
g_ascii_strcasecmp(rec->chatnet, network) == 0)
return TRUE;
}

Expand Down
2 changes: 1 addition & 1 deletion src/setup-completion.c
Expand Up @@ -109,7 +109,7 @@ static CONFIG_NODE *completion_find_node(const char *key, int create)
if (node == NULL)
return NULL;

return config_node_section(node, key, create ? NODE_TYPE_BLOCK : -1);
return iconfig_node_section(node, key, create ? NODE_TYPE_BLOCK : -1);
}

static void completion_edited(GtkCellRendererText *cell, char *path_string,
Expand Down
25 changes: 24 additions & 1 deletion src/setup-highlighting-edit.c
Expand Up @@ -114,7 +114,13 @@ static void highlight_channels_store_fill(GtkListStore *store, Highlight *highli
static void regexp_update_invalid(GtkToggleButton *toggle, GtkEntry *entry,
GtkWidget *label)
{
regex_t preg;
#ifdef USE_GREGEX
GRegex *preg;
GError *re_error;
#else
regex_t preg;
int regexp_compiled;
#endif
const char *text;

if (!gtk_toggle_button_get_active(toggle)) {
Expand All @@ -124,6 +130,22 @@ static void regexp_update_invalid(GtkToggleButton *toggle, GtkEntry *entry,
}

text = gtk_entry_get_text(entry);
#ifdef USE_GREGEX
re_error = NULL;
preg = g_regex_new(text, G_REGEX_OPTIMIZE | G_REGEX_RAW | G_REGEX_CASELESS, 0, &re_error);
g_error_free(re_error);

if (preg != NULL) {
/* regexp ok */
g_regex_unref(preg);

gtk_widget_hide(label);
} else {
/* invalid regexp - show the error label */
gtk_widget_show(label);
}

#else
if (regcomp(&preg, text, REG_EXTENDED|REG_ICASE|REG_NOSUB) == 0) {
/* regexp ok */
regfree(&preg);
Expand All @@ -133,6 +155,7 @@ static void regexp_update_invalid(GtkToggleButton *toggle, GtkEntry *entry,
/* invalid regexp - show the error label */
gtk_widget_show(label);
}
#endif
}

static gboolean event_text_changed(GtkEntry *entry, GObject *obj)
Expand Down
25 changes: 24 additions & 1 deletion src/setup-ignores-edit.c
Expand Up @@ -125,7 +125,13 @@ static void ignore_channels_store_fill(GtkListStore *store, Ignore *ignore)
static void regexp_update_invalid(GtkToggleButton *toggle, GtkEntry *entry,
GtkWidget *label)
{
regex_t preg;
#ifdef USE_GREGEX
GRegex *preg;
GError *re_error;
#else
regex_t preg;
int regexp_compiled;
#endif
const char *text;

if (!gtk_toggle_button_get_active(toggle)) {
Expand All @@ -135,6 +141,22 @@ static void regexp_update_invalid(GtkToggleButton *toggle, GtkEntry *entry,
}

text = gtk_entry_get_text(entry);
#ifdef USE_GREGEX
re_error = NULL;
preg = g_regex_new(text, G_REGEX_OPTIMIZE | G_REGEX_RAW | G_REGEX_CASELESS, 0, &re_error);
g_error_free(re_error);

if (preg != NULL) {
/* regexp ok */
g_regex_unref(preg);

gtk_widget_hide(label);
} else {
/* invalid regexp - show the error label */
gtk_widget_show(label);
}

#else
if (regcomp(&preg, text, REG_EXTENDED|REG_ICASE|REG_NOSUB) == 0) {
/* regexp ok */
regfree(&preg);
Expand All @@ -144,6 +166,7 @@ static void regexp_update_invalid(GtkToggleButton *toggle, GtkEntry *entry,
/* invalid regexp - show the error label */
gtk_widget_show(label);
}
#endif
}

static gboolean event_pattern_changed(GtkEntry *entry, GObject *obj)
Expand Down
4 changes: 2 additions & 2 deletions src/setup-servers-server.c
Expand Up @@ -64,9 +64,9 @@ static void server_save(GObject *obj, ServerConfig *server)

entry = g_object_get_data(obj, "ipproto");
value = gtk_entry_get_text(entry);
if (g_strcasecmp(value, "ipv4") == 0)
if (g_ascii_strcasecmp(value, "ipv4") == 0)
server->family = AF_INET;
else if (g_strcasecmp(value, "ipv6") == 0)
else if (g_ascii_strcasecmp(value, "ipv6") == 0)
server->family = AF_INET6;
else
server->family = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/setup-servers.c
Expand Up @@ -227,7 +227,7 @@ static void network_remove_with_servers(NetworkConfig *network)

next = tmp->next;
if (server->chatnet == NULL ||
g_strcasecmp(server->chatnet, network->name) != 0)
g_ascii_strcasecmp(server->chatnet, network->name) != 0)
continue;

server_setup_remove(server);
Expand Down Expand Up @@ -349,7 +349,7 @@ static void server_store_fill_network(GtkTreeStore *store, GtkTreeIter *parent,
continue;

if (server->chatnet == NULL ||
g_strcasecmp(server->chatnet, network->name) != 0)
g_ascii_strcasecmp(server->chatnet, network->name) != 0)
continue;

gtk_tree_store_append(store, &iter, parent);
Expand Down Expand Up @@ -606,7 +606,7 @@ static void sig_server_added(ServerConfig *server)
gtk_tree_model_get(model, &parent, COL_PTR,
&network, -1);
if (server->chatnet == NULL ||
g_strcasecmp(server->chatnet, network->name) != 0)
g_ascii_strcasecmp(server->chatnet, network->name) != 0)
append = TRUE;
} else {
/* we didn't have network */
Expand Down

0 comments on commit ea7c421

Please sign in to comment.