[Patch] Warning fixes
- From: degger fhm edu
- To: gtk-devel-list gnome org
- Subject: [Patch] Warning fixes
- Date: Wed, 14 Nov 2001 16:45:40 +0100 (CET)
Hija,
another buch of fixes for you:
2001-11-13 Daniel Egger <degger fhm edu>
* gdk/gdkglobals.c: Don't use GDKVAR for gdk_threads_mutex as it
will add an extern to the declaration.
* gdk/gdkpixbuf-drawable.c: Properly cast pointers to avoid warnings
on BIGENDIAN machines.
* gdk-pixbuf/io-xpm.c:
(xpm_skip_whitespaces): Remove unused static function.
(xpm_skip_string): Dito.
(xpm_extract_color): Declare const variable const to avoid warnings.
* gtk/gtkclist.c: Remove unused variable declarations.
* gtk/gtkcolorsel.c: (gtk_color_selection_get_palette_size): Remove
unused static function and prototype.
(gtk_color_selection_get_palette_color): Dito.
(gtk_color_selection_unset_palette_color): Dito.
(palette_unset_color): Dito.
* gtk/gtkcontainer.c: Comment out variable definition and calculation
just used in commented-out g_print.
* gtk/gtkfixed.c: (gtk_fixed_map): Remove unused static function.
* gtk/gtkplug.c: #if 0'ed prototype for #if 0'ed code.
* gtk/gtksocket.c: Change type of mask to g_message to %ld for
a long.
Diff attached. Good to commit?
--
Servus,
Daniel
Index: gdk/gdkglobals.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkglobals.c,v
retrieving revision 1.25
diff -u -r1.25 gdkglobals.c
--- gdk/gdkglobals.c 2001/10/29 07:06:36 1.25
+++ gdk/gdkglobals.c 2001/11/13 22:20:43
@@ -38,5 +38,5 @@
GList *_gdk_queued_events = NULL;
GList *_gdk_queued_tail = NULL;
-GDKVAR GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
+GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
Index: gdk/gdkpixbuf-drawable.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkpixbuf-drawable.c,v
retrieving revision 1.27
diff -u -r1.27 gdkpixbuf-drawable.c
--- gdk/gdkpixbuf-drawable.c 2001/08/26 02:03:09 1.27
+++ gdk/gdkpixbuf-drawable.c 2001/11/13 22:20:45
@@ -665,7 +665,7 @@
for (yy = y1; yy < y2; yy++)
{
- s = srow;
+ (guint8 *) s = srow;
o = (guint32 *) orow;
for (xx = x1; xx < x2; xx ++)
{
@@ -827,7 +827,7 @@
for (yy = y1; yy < y2; yy++)
{
- s = srow;
+ (guint8 *) s = srow;
o = (guint16 *) orow;
xx = x1;
Index: gdk-pixbuf/io-xpm.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/io-xpm.c,v
retrieving revision 1.29
diff -u -r1.29 io-xpm.c
--- gdk-pixbuf/io-xpm.c 2001/09/21 21:39:42 1.29
+++ gdk-pixbuf/io-xpm.c 2001/11/13 22:20:53
@@ -1070,39 +1070,17 @@
return ret;
}
-static const gchar *
-xpm_skip_whitespaces (const gchar *buffer)
-{
- gint32 index = 0;
-
- while (buffer[index] != 0 && (buffer[index] == 0x20 || buffer[index] == 0x09))
- index++;
-
- return &buffer[index];
-}
-
-static const gchar *
-xpm_skip_string (const gchar *buffer)
-{
- gint32 index = 0;
-
- while (buffer[index] != 0 && buffer[index] != 0x20 && buffer[index] != 0x09)
- index++;
-
- return &buffer[index];
-}
-
static gchar *
xpm_extract_color (const gchar *buffer)
{
+ const gchar *p = &buffer[0];
gint new_key = 0;
gint key = 0;
gint current_key = 1;
gint space = 128;
gchar word[128], color[128], current_color[128];
- gchar *r, *p;
-
- p = &buffer[0];
+ gchar *r;
+
word[0] = '\0';
color[0] = '\0';
current_color[0] = '\0';
Index: gtk/gtkclist.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkclist.c,v
retrieving revision 1.208
diff -u -r1.208 gtkclist.c
--- gtk/gtkclist.c 2001/10/31 20:20:11 1.208
+++ gtk/gtkclist.c 2001/11/13 22:21:04
@@ -3788,9 +3788,6 @@
static void
real_select_all (GtkCList *clist)
{
- GList *list;
- gint i;
-
g_return_if_fail (GTK_IS_CLIST (clist));
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
Index: gtk/gtkcolorsel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcolorsel.c,v
retrieving revision 1.80
diff -u -r1.80 gtkcolorsel.c
--- gtk/gtkcolorsel.c 2001/11/10 01:30:30 1.80
+++ gtk/gtkcolorsel.c 2001/11/13 22:21:14
@@ -154,15 +154,9 @@
GValue *value,
GParamSpec *pspec);
-static gint gtk_color_selection_get_palette_size (GtkColorSelection *colorsel);
-static gboolean gtk_color_selection_get_palette_color (GtkColorSelection *colorsel,
- gint index,
- GdkColor *color);
static void gtk_color_selection_set_palette_color (GtkColorSelection *colorsel,
gint index,
GdkColor *color);
-static void gtk_color_selection_unset_palette_color (GtkColorSelection *colorsel,
- gint index);
static void default_change_palette_func (const GdkColor *colors,
gint n_colors);
@@ -928,15 +922,6 @@
return TRUE;
}
-static void
-palette_unset_color (GtkWidget *drawing_area)
-{
- if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (drawing_area), "color_set")) == 0)
- return;
-
- gtk_widget_reset_rc_styles (drawing_area);
- gtk_object_set_data (GTK_OBJECT (drawing_area), "color_set", GINT_TO_POINTER (0));
-}
static void
palette_drop_handle (GtkWidget *widget,
@@ -2413,85 +2398,6 @@
col[2] = SCALE (color->blue);
palette_set_color (priv->custom_palette[x][y], colorsel, col);
-}
-
-/**
- * gtk_color_selection_get_palette_color:
- * @colorsel: a #GtkColorSelection.
- * @index: the color index of the palette.
- * @color: a #GdkColor to fill in with the color value.
- *
- * Set @color to have the color found in the palette at @index. If
- * the palette is unset, it will leave the color unset.
- *
- * Return value: %TRUE if the palette located at @index has a color set. %FALSE
- * if it doesn't.
- **/
-static gboolean
-gtk_color_selection_get_palette_color (GtkColorSelection *colorsel,
- gint index,
- GdkColor *color)
-{
- ColorSelectionPrivate *priv;
- gint x, y;
- gdouble col[4];
-
- g_return_val_if_fail (GTK_IS_COLOR_SELECTION (colorsel), FALSE);
- g_return_val_if_fail (index >= 0 && index < GTK_CUSTOM_PALETTE_WIDTH*GTK_CUSTOM_PALETTE_HEIGHT, FALSE);
-
- priv = colorsel->private_data;
-
- x = index % GTK_CUSTOM_PALETTE_WIDTH;
- y = index / GTK_CUSTOM_PALETTE_WIDTH;
-
- if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (priv->custom_palette[x][y]), "color_set")) == 0)
- return FALSE;
-
- palette_get_color (priv->custom_palette[x][y], col);
-
- color->red = UNSCALE (col[0]);
- color->green = UNSCALE (col[1]);
- color->blue = UNSCALE (col[2]);
-
- return TRUE;
-}
-
-/**
- * gtk_color_selection_unset_palette_color:
- * @colorsel: a #GtkColorSelection.
- * @index: the color index in the palette.
- *
- * Changes the palette located @index to have no color set.
- **/
-static void
-gtk_color_selection_unset_palette_color (GtkColorSelection *colorsel,
- gint index)
-{
- ColorSelectionPrivate *priv;
- gint x, y;
-
- g_return_if_fail (GTK_IS_COLOR_SELECTION (colorsel));
- g_return_if_fail (index >= 0 && index < GTK_CUSTOM_PALETTE_WIDTH*GTK_CUSTOM_PALETTE_HEIGHT);
-
- x = index % GTK_CUSTOM_PALETTE_WIDTH;
- y = index / GTK_CUSTOM_PALETTE_WIDTH;
-
- priv = colorsel->private_data;
- palette_unset_color (priv->custom_palette[x][y]);
-}
-
-/**
- * gtk_color_selection_get_current_alpha:
- * @colorsel: a #GtkColorSelection.
- *
- * Returns the maximum number of palette colors.
- *
- * Return value: the maximum number of palette indexes.
- **/
-static gint
-gtk_color_selection_get_palette_size (GtkColorSelection *colorsel)
-{
- return GTK_CUSTOM_PALETTE_WIDTH * GTK_CUSTOM_PALETTE_HEIGHT;
}
Index: gtk/gtkcontainer.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcontainer.c,v
retrieving revision 1.93
diff -u -r1.93 gtkcontainer.c
--- gtk/gtkcontainer.c 2001/11/10 01:30:30 1.93
+++ gtk/gtkcontainer.c 2001/11/13 22:21:27
@@ -1000,9 +1000,10 @@
if (initialized)
{
+ /*
gdouble diff = ((current_time.tv_usec - last_time.tv_usec) / 1000. +
(current_time.tv_sec - last_time.tv_sec) * 1000.);
- /* g_print ("Frame time: %g msec\n", diff); */
+ g_print ("Frame time: %g msec\n", diff); */
}
else
initialized = TRUE;
Index: gtk/gtkfixed.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfixed.c,v
retrieving revision 1.28
diff -u -r1.28 gtkfixed.c
--- gtk/gtkfixed.c 2001/08/10 03:46:07 1.28
+++ gtk/gtkfixed.c 2001/11/13 22:21:48
@@ -304,30 +304,6 @@
}
static void
-gtk_fixed_map (GtkWidget *widget)
-{
- GtkFixed *fixed;
- GtkFixedChild *child;
- GList *children;
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
- fixed = GTK_FIXED (widget);
-
- children = fixed->children;
- while (children)
- {
- child = children->data;
- children = children->next;
-
- if (GTK_WIDGET_VISIBLE (child->widget) &&
- !GTK_WIDGET_MAPPED (child->widget))
- gtk_widget_map (child->widget);
- }
-
- gdk_window_show (widget->window);
-}
-
-static void
gtk_fixed_realize (GtkWidget *widget)
{
GdkWindowAttr attributes;
Index: gtk/gtkplug.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkplug.c,v
retrieving revision 1.36
diff -u -r1.36 gtkplug.c
--- gtk/gtkplug.c 2001/10/22 04:34:41 1.36
+++ gtk/gtkplug.c 2001/11/13 22:21:55
@@ -61,7 +61,9 @@
GdkEvent *event,
gpointer data);
+#if 0
static void gtk_plug_free_grabbed_keys (GHashTable *key_table);
+#endif
static void handle_modality_off (GtkPlug *plug);
static void send_xembed_message (GtkPlug *plug,
glong message,
Index: gtk/gtksocket.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtksocket.c,v
retrieving revision 1.35
diff -u -r1.35 gtksocket.c
--- gtk/gtksocket.c 2001/10/31 23:58:31 1.35
+++ gtk/gtksocket.c 2001/11/13 22:21:58
@@ -1071,7 +1071,7 @@
guint32 time)
{
GTK_NOTE(PLUGSOCKET,
- g_message ("GtkSocket: Sending XEMBED message of type %d", message));
+ g_message ("GtkSocket: Sending XEMBED message of type %ld", message));
if (socket->plug_window)
{
Index: gtk/gtktextiter.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextiter.c,v
retrieving revision 1.60
diff -u -r1.60 gtktextiter.c
--- gtk/gtktextiter.c 2001/11/10 22:06:37 1.60
+++ gtk/gtktextiter.c 2001/11/13 22:22:03
@@ -1813,50 +1813,6 @@
}
-/* The return value of this indicates WHETHER WE MOVED.
- * The return value of public functions indicates
- * (MOVEMENT OCCURRED && NEW ITER IS DEREFERENCEABLE)
- */
-static gboolean
-backward_line_leaving_caches_unmodified (GtkTextRealIter *real)
-{
- GtkTextLine *new_line;
-
- new_line = _gtk_text_line_previous (real->line);
-
- g_assert (new_line != real->line);
-
- if (new_line != NULL)
- {
- real->line = new_line;
-
- real->line_byte_offset = 0;
- real->line_char_offset = 0;
-
- real->segment_byte_offset = 0;
- real->segment_char_offset = 0;
-
- /* Find first segments in new line */
- real->any_segment = real->line->segments;
- real->segment = real->any_segment;
- while (real->segment->char_count == 0)
- real->segment = real->segment->next;
-
- return TRUE;
- }
- else
- {
- /* There is no way to move backward; we were already
- at the first line. */
-
- /* We leave real->line as-is */
-
- /* Note that we didn't clamp to the start of the first line. */
-
- return FALSE;
- }
-}
-
/* The return value indicates (MOVEMENT OCCURRED && NEW ITER IS
* DEREFERENCEABLE)
*/
Index: gtk/gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.169
diff -u -r1.169 gtktreeview.c
--- gtk/gtktreeview.c 2001/11/06 19:10:02 1.169
+++ gtk/gtktreeview.c 2001/11/13 22:22:25
@@ -3012,41 +3012,6 @@
return FALSE;
}
-/* Incremental Reflow */
-
-static void
-validate_visible_area (GtkTreeView *tree_view)
-{
-
-}
-
-static gboolean
-validate_rows_handler (GtkTreeView *tree_view)
-{
- g_assert (tree_view);
-
- g_return_val_if_fail (tree_view->priv->tree != NULL, TRUE);
-
- if (! GTK_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_RBNODE_DESCENDANTS_INVALID))
- return TRUE;
-
-
- return TRUE;
-}
-
-static gboolean
-presize_handler_callback (gpointer data)
-{
-
- return TRUE;
-}
-
-static void
-install_presize_handler (GtkTreeView *tree_view)
-{
-
-}
-
/* Drag-and-drop */
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]