Skip to content

Commit

Permalink
Fixed some more warnings etc
Browse files Browse the repository at this point in the history
  • Loading branch information
realh committed Sep 9, 2023
1 parent e5a3a81 commit 6d9f04c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 28 deletions.
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ roxterm (3.14.1) unstable; urgency=high
+ Backwards compatibility for older versions of GNOME/gsettings schemas
which don't have a dark theme setting.

-- Tony Houghton <h@realh.co.uk> Sat, 09 Sep 2023 21:56:46 +0100
-- Tony Houghton <h@realh.co.uk> Sat, 09 Sep 2023 22:29:46 +0100

roxterm (3.13.2) unstable; urgency=medium

Expand Down
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
include(CheckSymbolExists)

if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra)
endif()

# roxterm and roxterm-config both depend on these
pkg_check_modules(RTCOMMON REQUIRED
gtk+-3.0>=3.22.0 dbus-1>=1.0 dbus-glib-1>=0.22)
Expand Down
2 changes: 1 addition & 1 deletion src/capplet.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ gboolean capplet_set_boolean_toggle(CappletData *capp,
{
gboolean value = options_lookup_int_with_default(capp->options, name, dflt);
capplet_set_toggle(capp, name, value);
return value;
}

void capplet_set_text_entry(CappletData *capp,
Expand Down Expand Up @@ -303,7 +304,6 @@ int main(int argc, char **argv)
int n;
const char *profile = NULL;
const char *colour_scheme = NULL;
char *logo_filename;
gboolean persist = FALSE;
gboolean open_configlet = FALSE;
gboolean dbus_ok;
Expand Down
2 changes: 1 addition & 1 deletion src/colourscheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ colour_scheme_parse_palette_range(Options * opts, ColourScheme * scheme,

for (n = start; n < 16; ++n)
{
char key[8];
char key[16];
snprintf(key, sizeof(key) - 1, "%d", n);

colour_scheme_lookup_and_parse(opts, scheme, &scheme->palette[n], key,
Expand Down
23 changes: 1 addition & 22 deletions src/configlet.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ static char *configlet_get_configured_name(ConfigletList *cl)

g_return_val_if_fail(optkey, NULL);
const char *default_name;
const char *default_value;
if (strcmp(cl->family, "Colours"))
{
default_name = "Default";
Expand Down Expand Up @@ -429,26 +428,6 @@ static gboolean get_selected_iter(ConfigletList *cl,
gtk_tree_view_get_selection(cl->tvwidget), pmodel, piter);
}

static int get_selected_index(ConfigletList *cl)
{
/* FIXME: Is there a better way of doing this? */
GtkTreeIter iter;
GtkTreeModel *model = gtk_tree_view_get_model(cl->tvwidget);
GtkTreeSelection *selection;
int n = 0;

selection = gtk_tree_view_get_selection(cl->tvwidget);
if (!gtk_tree_model_get_iter_first(model, &iter))
return -1;
while (!gtk_tree_selection_iter_is_selected(selection, &iter))
{
if (!gtk_tree_model_iter_next(model, &iter))
return -1;
++n;
}
return n;
}

static char *get_selected_name(ConfigletList *cl)
{
GtkTreeIter iter;
Expand Down Expand Up @@ -881,7 +860,7 @@ void on_shortcuts_rename_clicked(GtkButton *button, ConfigletData *cg)
on_rename_clicked(&cg->shortcuts);
}

static void configlet_on_dark_pref_changed(gboolean prefer_dark,
static void configlet_on_dark_pref_changed(G_GNUC_UNUSED gboolean prefer_dark,
ConfigletList *cl)
{
char *name = configlet_get_configured_name(cl);
Expand Down
2 changes: 1 addition & 1 deletion src/dragrcv.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef gboolean (*DragReceiveHandler)(GtkWidget *, const char *text,

/* Called when a tab is dropped on a target widget. widget is the dragged
* widget, data is as passed to drag_receive_setup_dest_widget. */
typedef gboolean (*DragReceiveTabHandler)(GtkWidget *widget, gpointer data);
typedef void (*DragReceiveTabHandler)(GtkWidget *widget, gpointer data);

/* Sets up widget as a destination for the types of drag we're interested in.
* It returns a pointer to an opaque data structure which should be deleted
Expand Down
3 changes: 3 additions & 0 deletions src/multitab.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,7 @@ static void multi_win_name_tab_action(MultiWin * win)
multi_tab_set_window_title_template(tab, name);
tab->title_template_locked = (name != NULL);
/* Fall through to destroy */
G_GNUC_FALLTHROUGH;
default:
gtk_widget_destroy(dialog_w);
break;
Expand Down Expand Up @@ -1403,6 +1404,7 @@ static void multi_win_save_session_action(MultiWin * win)
filename, strerror(errno));
}
/* Fall through to destroy */
G_GNUC_FALLTHROUGH;
default:
gtk_widget_destroy(dialog_w);
break;
Expand Down Expand Up @@ -1461,6 +1463,7 @@ static void multi_win_set_window_title_action(MultiWin * win)
multi_win_set_title_template(win, title);
win->title_template_locked = (title != NULL);
/* Fall through to destroy */
G_GNUC_FALLTHROUGH;
default:
gtk_widget_destroy(dialog_w);
break;
Expand Down
1 change: 1 addition & 0 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ static GtkTreeModel *search_create_model(void)
g_error_free(error);
error = NULL;
}
G_GNUC_FALLTHROUGH;
case G_IO_STATUS_EOF:
g_io_channel_shutdown(ioc, FALSE, NULL);
g_io_channel_unref(ioc);
Expand Down
5 changes: 3 additions & 2 deletions src/session-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ static void save_tab_to_fp(MultiTab *tab, gpointer handle)
char *colour_scheme_clause = colour_scheme_name ?
g_strdup_printf("colour_scheme='%s' ", colour_scheme_name) : NULL;
char *s = g_markup_printf_escaped("<tab profile='%s'\n"
" cwd='%s'\n"
" %scwd='%s'\n"
" title_template='%s' window_title='%s'\n"
" title_template_locked='%d'",
roxterm_get_profile_name(roxterm),
cwd ? cwd : (cwd = g_get_current_dir()),
colour_scheme_clause ? colour_scheme_clause : "",
name ? name : "", title ? title : "",
name ? name : "",
title ? title : "",
multi_tab_get_title_template_locked(tab));
g_free(colour_scheme_clause);

Expand Down

0 comments on commit 6d9f04c

Please sign in to comment.