Skip to content

Commit

Permalink
Fix many sparse warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Clasen committed Oct 28, 2004
1 parent dbba410 commit d5f9215
Show file tree
Hide file tree
Showing 53 changed files with 1,673 additions and 1,197 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2004-10-28 Matthias Clasen <[email protected]>

* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)

* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect
from the remove-widget signal after removing the signal.

Expand Down
2 changes: 2 additions & 0 deletions ChangeLog.pre-2-10
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2004-10-28 Matthias Clasen <[email protected]>

* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)

* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect
from the remove-widget signal after removing the signal.

Expand Down
2 changes: 2 additions & 0 deletions ChangeLog.pre-2-6
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2004-10-28 Matthias Clasen <[email protected]>

* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)

* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect
from the remove-widget signal after removing the signal.

Expand Down
2 changes: 2 additions & 0 deletions ChangeLog.pre-2-8
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2004-10-28 Matthias Clasen <[email protected]>

* *: Clean up many sparse warnings. (#156698, Kjartan Maraas)

* gtk/gtktreeview.c (gtk_tree_view_remove_widget): Disconnect
from the remove-widget signal after removing the signal.

Expand Down
10 changes: 5 additions & 5 deletions contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlibrgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ xlib_rgb_init_with_depth (Display *display, Screen *screen, int prefDepth)

image_info->stage_buf = NULL;

image_info->own_gc = 0;
image_info->own_gc = NULL;

image_info->red_shift = 0;
image_info->red_prec = 0;
Expand Down Expand Up @@ -908,7 +908,7 @@ xlib_rgb_init_with_depth (Display *display, Screen *screen, int prefDepth)
image_info->x_visual_info->visual,
1,
XYBitmap,
0, 0, IMAGE_WIDTH, IMAGE_HEIGHT,
0, NULL, IMAGE_WIDTH, IMAGE_HEIGHT,
8,
0);
static_image[i]->data = malloc(IMAGE_WIDTH * IMAGE_HEIGHT >> 3);
Expand All @@ -920,7 +920,7 @@ xlib_rgb_init_with_depth (Display *display, Screen *screen, int prefDepth)
image_info->x_visual_info->visual,
(unsigned int)image_info->x_visual_info->depth,
ZPixmap,
0, 0,
0, NULL,
IMAGE_WIDTH,
IMAGE_HEIGHT,
32, 0);
Expand Down Expand Up @@ -3651,7 +3651,7 @@ xlib_rgb_get_visual (void)
if (image_info)
return image_info->x_visual_info->visual;
else
return 0;
return NULL;
}

/**
Expand All @@ -3668,7 +3668,7 @@ xlib_rgb_get_visual_info (void)
if (image_info)
return image_info->x_visual_info;
else
return 0;
return NULL;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion demos/gtk-demo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ parse_chars (gchar *text,

/* While not as cool as c-mode, this will do as a quick attempt at highlighting */
static void
fontify ()
fontify (void)
{
GtkTextIter start_iter, next_iter, tmp_iter;
gint state;
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

2004-10-26 Matthias Clasen <[email protected]>

* gtk/gtk-sections.txt: Additions.

* gdk-pixbuf/tmpl/scaling.sgml: Document GdkPixbufRotation.

* gtk/gtk-update-icon-cache.1: Regenerated.
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/gtk/gtk-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ gtk_about_dialog_get_translator_credits
gtk_about_dialog_set_translator_credits
gtk_about_dialog_get_logo
gtk_about_dialog_set_logo
gtk_about_dialog_get_logo_icon_name
gtk_about_dialog_set_logo_icon_name
GtkAboutDialogActivateLinkFunc
gtk_about_dialog_set_email_hook
gtk_about_dialog_set_url_hook
Expand Down Expand Up @@ -5113,6 +5115,8 @@ gtk_drag_source_unset
gtk_drag_source_set_target_list
gtk_drag_source_get_target_list
gtk_drag_source_add_text_targets
gtk_drag_source_add_image_targets
gtk_drag_source_add_uri_targets
</SECTION>


Expand Down
10 changes: 5 additions & 5 deletions gdk-pixbuf/gdk-pixbuf-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static GSList *file_formats = NULL;
static void gdk_pixbuf_io_init ();

static GSList *
get_file_formats ()
get_file_formats (void)
{
if (file_formats == NULL)
gdk_pixbuf_io_init ();
Expand Down Expand Up @@ -236,7 +236,7 @@ gdk_pixbuf_get_module_file (void)
}

static void
gdk_pixbuf_io_init ()
gdk_pixbuf_io_init (void)
{
GIOChannel *channel;
gchar *line_buf;
Expand Down Expand Up @@ -334,7 +334,7 @@ gdk_pixbuf_io_init ()
module->info->mime_types =
g_realloc (module->info->mime_types, (n + 1) * sizeof (gchar*));
module->info->mime_types[n - 1] = g_strdup (tmp_buf->str);
module->info->mime_types[n] = 0;
module->info->mime_types[n] = NULL;
n++;
}
}
Expand All @@ -347,7 +347,7 @@ gdk_pixbuf_io_init ()
module->info->extensions =
g_realloc (module->info->extensions, (n + 1) * sizeof (gchar*));
module->info->extensions[n - 1] = g_strdup (tmp_buf->str);
module->info->extensions[n] = 0;
module->info->extensions[n] = NULL;
n++;
}
}
Expand Down Expand Up @@ -1952,7 +1952,7 @@ gdk_pixbuf_format_set_disabled (GdkPixbufFormat *format,
gchar*
gdk_pixbuf_format_get_license (GdkPixbufFormat *format)
{
g_return_val_if_fail (format != NULL, FALSE);
g_return_val_if_fail (format != NULL, NULL);

return g_strdup (format->license);
}
Expand Down
6 changes: 3 additions & 3 deletions gdk/gdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ gdk_exit (gint errorcode)
}

void
gdk_threads_enter ()
gdk_threads_enter (void)
{
GDK_THREADS_ENTER ();
}

void
gdk_threads_leave ()
gdk_threads_leave (void)
{
GDK_THREADS_LEAVE ();
}
Expand Down Expand Up @@ -389,7 +389,7 @@ gdk_threads_impl_unlock (void)
* GTK+; to be safe, call it before gtk_init().
**/
void
gdk_threads_init ()
gdk_threads_init (void)
{
if (!g_thread_supported ())
g_error ("g_thread_init() must be called before gdk_threads_init()");
Expand Down
2 changes: 1 addition & 1 deletion gdk/gdkevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ _gdk_event_button_generate (GdkDisplay *display,
display->button_click_time[1] = 0;
display->button_click_time[0] = 0;
display->button_window[1] = NULL;
display->button_window[0] = 0;
display->button_window[0] = NULL;
display->button_number[1] = -1;
display->button_number[0] = -1;
display->button_x[0] = display->button_x[1] = 0;
Expand Down
2 changes: 1 addition & 1 deletion gdk/x11/gdkdisplay-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ broadcast_xmessage (GdkDisplay *display,
0,
CopyFromParent,
CopyFromParent,
CopyFromParent,
(Visual *)CopyFromParent,
CWOverrideRedirect | CWEventMask,
&attrs);
}
Expand Down
2 changes: 1 addition & 1 deletion gdk/x11/gdkdnd-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ motif_find_drag_window (GdkDisplay *display,
XCreateWindow (persistant_xdisplay,
RootWindow (persistant_xdisplay, 0),
-100, -100, 10, 10, 0, 0,
InputOnly, CopyFromParent,
InputOnly, (Visual *)CopyFromParent,
(CWOverrideRedirect | CWEventMask), &attr);

GDK_NOTE (DND,
Expand Down
2 changes: 1 addition & 1 deletion gdk/x11/gdkdrawable-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static GdkDrawable * get_impl_drawable (GdkDrawable *drawable)
else
{
g_warning (G_STRLOC " drawable is not a pixmap or window");
return None;
return (GdkDrawable *)None;
}
return impl;
}
Expand Down
2 changes: 1 addition & 1 deletion gdk/x11/gdkim-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ gdk_set_locale (void)
}

static GdkDisplay *
find_a_display ()
find_a_display (void)
{
GdkDisplay *display = gdk_display_get_default ();

Expand Down
10 changes: 5 additions & 5 deletions gdk/x11/gdkimage-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint width, gint height)
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
private->ximage = XCreateImage (GDK_SCREEN_XDISPLAY (private->screen),
xvisual, 1, XYBitmap,
0, 0, width, height, 8, 0);
0, NULL, width, height, 8, 0);
}

private->ximage->data = data;
Expand Down Expand Up @@ -318,7 +318,7 @@ _gdk_image_new_for_depth (GdkScreen *screen,
}

x_shm_info->readOnly = False;
x_shm_info->shmaddr = shmat (x_shm_info->shmid, 0, 0);
x_shm_info->shmaddr = shmat (x_shm_info->shmid, NULL, 0);
private->ximage->data = x_shm_info->shmaddr;

if (x_shm_info->shmaddr == (char*) -1)
Expand Down Expand Up @@ -350,7 +350,7 @@ _gdk_image_new_for_depth (GdkScreen *screen,
* we die in XShmAttach. In theory, a signal handler
* could be set up.
*/
shmctl (x_shm_info->shmid, IPC_RMID, 0);
shmctl (x_shm_info->shmid, IPC_RMID, NULL);

if (image)
image_list = g_list_prepend (image_list, image);
Expand All @@ -361,7 +361,7 @@ _gdk_image_new_for_depth (GdkScreen *screen,
break;
case GDK_IMAGE_NORMAL:
private->ximage = XCreateImage (screen_x11->xdisplay, xvisual, depth,
ZPixmap, 0, 0, width, height, 32, 0);
ZPixmap, 0, NULL, width, height, 32, 0);

/* Use malloc, not g_malloc here, because X will call free()
* on this data
Expand Down Expand Up @@ -402,7 +402,7 @@ _gdk_image_new_for_depth (GdkScreen *screen,
if (x_shm_info->shmaddr != (char *)-1)
shmdt (x_shm_info->shmaddr);
if (x_shm_info->shmid != -1)
shmctl (x_shm_info->shmid, IPC_RMID, 0);
shmctl (x_shm_info->shmid, IPC_RMID, NULL);

g_free (x_shm_info);
private->x_shm_info = NULL;
Expand Down
4 changes: 2 additions & 2 deletions gdk/x11/gdkmain-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ _gdk_region_get_xrectangles (GdkRegion *region,
* gdk_x11_grab_server()/gdk_x11_ungrab_server() calls can be nested.
**/
void
gdk_x11_grab_server ()
gdk_x11_grab_server (void)
{
gdk_x11_display_grab (gdk_display_get_default ());
}
Expand All @@ -748,7 +748,7 @@ gdk_x11_grab_server ()
* gdk_x11_grab_server().
**/
void
gdk_x11_ungrab_server ()
gdk_x11_ungrab_server (void)
{
gdk_x11_display_ungrab (gdk_display_get_default ());
}
Expand Down
2 changes: 1 addition & 1 deletion gdk/x11/gdkscreen-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static gpointer parent_class = NULL;
static guint signals[LAST_SIGNAL] = { 0 };

GType
_gdk_screen_x11_get_type ()
_gdk_screen_x11_get_type (void)
{
static GType object_type = 0;

Expand Down
10 changes: 5 additions & 5 deletions gdk/x11/gdkwindow-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -2262,7 +2262,7 @@ gdk_window_set_modal_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (modal, window,
gdk_atom_intern ("_NET_WM_STATE_MODAL", FALSE),
0);
NULL);
}

/**
Expand Down Expand Up @@ -2298,7 +2298,7 @@ gdk_window_set_skip_taskbar_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_taskbar, window,
gdk_atom_intern ("_NET_WM_STATE_SKIP_TASKBAR", FALSE),
0);
NULL);
}

/**
Expand Down Expand Up @@ -2335,7 +2335,7 @@ gdk_window_set_skip_pager_hint (GdkWindow *window,
if (GDK_WINDOW_IS_MAPPED (window))
gdk_wmspec_change_state (skips_pager, window,
gdk_atom_intern ("_NET_WM_STATE_SKIP_PAGER", FALSE),
0);
NULL);
}

/**
Expand Down Expand Up @@ -4064,7 +4064,7 @@ gdk_window_stick (GdkWindow *window)
/* Request stick during viewport scroll */
gdk_wmspec_change_state (TRUE, window,
gdk_atom_intern ("_NET_WM_STATE_STICKY", FALSE),
0);
NULL);

/* Request desktop 0xFFFFFFFF */
xev.xclient.type = ClientMessage;
Expand Down Expand Up @@ -4124,7 +4124,7 @@ gdk_window_unstick (GdkWindow *window)
/* Request unstick from viewport */
gdk_wmspec_change_state (FALSE, window,
gdk_atom_intern ("_NET_WM_STATE_STICKY", FALSE),
0);
NULL);

/* Get current desktop, then set it; this is a race, but not
* one that matters much in practice.
Expand Down
4 changes: 2 additions & 2 deletions gtk/gtkaboutdialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ gtk_about_dialog_get_property (GObject *object,
case PROP_LOGO_ICON_NAME:
if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_ICON_NAME)
{
gchar *icon_name;
const gchar *icon_name;

gtk_image_get_icon_name (GTK_IMAGE (priv->logo_image), &icon_name, NULL);
g_value_set_string (value, icon_name);
Expand Down Expand Up @@ -1333,7 +1333,7 @@ G_CONST_RETURN gchar *
gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about)
{
GtkAboutDialogPrivate *priv;
gchar *icon_name = NULL;
const gchar *icon_name;

g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);

Expand Down
2 changes: 1 addition & 1 deletion gtk/gtkcurve.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ gtk_curve_init (GtkCurve *curve)
curve->grab_point = -1;

curve->num_points = 0;
curve->point = 0;
curve->point = NULL;

curve->num_ctlpoints = 0;
curve->ctlpoint = NULL;
Expand Down
2 changes: 1 addition & 1 deletion gtk/gtkdnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static struct {
const guchar *mask;
GdkCursor *cursor;
} drag_cursors[] = {
{ GDK_ACTION_DEFAULT, 0 },
{ GDK_ACTION_DEFAULT, NULL },
{ GDK_ACTION_ASK, action_ask_bits, action_ask_mask_bits, NULL },
{ GDK_ACTION_COPY, action_copy_bits, action_copy_mask_bits, NULL },
{ GDK_ACTION_MOVE, action_move_bits, action_move_mask_bits, NULL },
Expand Down
4 changes: 2 additions & 2 deletions gtk/gtkfontsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
}

GtkWidget *
gtk_font_selection_new ()
gtk_font_selection_new (void)
{
GtkFontSelection *fontsel;

Expand Down Expand Up @@ -644,7 +644,7 @@ set_cursor_to_iter (GtkTreeView *view,
GtkTreeModel *model = gtk_tree_view_get_model (view);
GtkTreePath *path = gtk_tree_model_get_path (model, iter);

gtk_tree_view_set_cursor (view, path, 0, FALSE);
gtk_tree_view_set_cursor (view, path, NULL, FALSE);

gtk_tree_path_free (path);
}
Expand Down
Loading

0 comments on commit d5f9215

Please sign in to comment.