# include <unistd.h>
#endif
+# ifdef __GNUC__
+# define STFU __extension__ /* ignore gcc -pendantic warnings in next sexp */
+# else
+# define STFU /* */
+# endif
+
+
#ifdef ENABLE_NLS
# include <locale.h>
#endif /* ENABLE_NLS */
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- return;
-
- path = gtk_tree_model_get_path (model, &iter);
+ path = gtk_tree_path_new_first ();
+ else
+ path = gtk_tree_model_get_path (model, &iter);
-# if 0
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (widget),
- path, NULL, FALSE, 0.0, 0.0);
-# else
gtk_tree_view_set_cursor (GTK_TREE_VIEW (widget), path, NULL, FALSE);
-# endif
+
+ gtk_tree_path_free (path);
+
#else /* !HAVE_GTK2 */
GtkScrolledWindow *scroller = 0;
while (parent && !parent->window)
parent = parent->parent;
- if (!GTK_WIDGET (parent)->window) /* too early to pop up transient dialogs */
+ if (!parent ||
+ !GTK_WIDGET (parent)->window) /* too early to pop up transient dialogs */
{
fprintf (stderr, "%s: too early for dialog?\n", progname);
return;
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
gtk_window_set_title (GTK_WINDOW (dialog), progclass);
- GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);
gtk_widget_show (ok);
gtk_widget_grab_focus (ok);
if (cancel)
{
- GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT);
+ STFU GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT);
gtk_widget_show (cancel);
}
gtk_widget_show (label);
sprintf (help_command + strlen(help_command),
p->load_url_command, p->help_url, p->help_url);
strcat (help_command, " ) &");
-fprintf(stderr, "## %s\n", help_command);
system (help_command);
free (help_command);
}
"\n"));
if (root_p)
+
+# ifdef __GNUC__
+ __extension__ /* don't warn about "string length is greater than
+ the length ISO C89 compilers are required to
+ support" in the following expression... */
+# endif
strcat (buf,
_("You are running as root. This usually means that xscreensaver\n"
"was unable to contact your X server because access control is\n"
if (!was) gtk_widget_set_sensitive (parent, True);
#ifdef HAVE_GTK2
model = gtk_tree_view_get_model (GTK_TREE_VIEW (list));
- g_assert (model);
+ STFU g_assert (model);
gtk_tree_model_iter_nth_child (model, &iter, NULL, list_elt);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
gtk_tree_selection_select_iter (selection, &iter);
else
{
char c;
- if (sscanf (line, "%u%c", &value, &c) != 1)
+ if (sscanf (line, "%d%c", &value, &c) != 1)
value = -1;
if (!sec_p)
value *= 60;
else if (!strcasecmp (visual, "greyscale")) visual = "GrayScale";
else if (!strcasecmp (visual, "pseudocolor")) visual = "PseudoColor";
else if (!strcasecmp (visual, "directcolor")) visual = "DirectColor";
- else if (1 == sscanf (visual, " %ld %c", &id, &c)) ;
+ else if (1 == sscanf (visual, " %lu %c", &id, &c)) ;
else if (1 == sscanf (visual, " 0x%lx %c", &id, &c)) ;
else
{
char *str;
int list_elt;
- g_return_if_fail (!gdk_pointer_is_grabbed ());
+ STFU g_return_if_fail (!gdk_pointer_is_grabbed ());
str = gtk_tree_path_to_string (path);
list_elt = strtol (str, NULL, 10);
}
+#ifdef __GNUC__
+ __extension__ /* shut up about "string length is greater than the length
+ ISO C89 compilers are required to support" when including
+ the .ad file... */
+#endif
+
static char *defaults[] = {
#include "XScreenSaver_ad.h"
0
gtk_widget_ref (outer_vbox);
gtk_container_remove (GTK_CONTAINER (s->toplevel_widget),
outer_vbox);
- GTK_OBJECT_SET_FLAGS (outer_vbox, GTK_FLOATING);
+ STFU GTK_OBJECT_SET_FLAGS (outer_vbox, GTK_FLOATING);
gtk_container_add (GTK_CONTAINER (capplet), outer_vbox);
/* Find the window above us, and set the title and close handler. */