Commit 90408c46 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

changed reversed_[12] to reserved_[12] in gtk_*_get_type functions.

Sat Jul  4 13:16:24 1998  Tim Janik  <timj@gtk.org>

        * gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
        functions.

        * gdk/gdkwindow.c:
        * gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
        to XFree() calls.
parent c2eb7c28
Sat Jul 4 13:16:24 1998 Tim Janik <timj@gtk.org>
* gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
functions.
* gdk/gdkwindow.c:
* gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
to XFree() calls.
1998-07-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since
......
Sat Jul 4 13:16:24 1998 Tim Janik <timj@gtk.org>
* gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
functions.
* gdk/gdkwindow.c:
* gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
to XFree() calls.
1998-07-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since
......
Sat Jul 4 13:16:24 1998 Tim Janik <timj@gtk.org>
* gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
functions.
* gdk/gdkwindow.c:
* gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
to XFree() calls.
1998-07-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since
......
Sat Jul 4 13:16:24 1998 Tim Janik <timj@gtk.org>
* gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
functions.
* gdk/gdkwindow.c:
* gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
to XFree() calls.
1998-07-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since
......
Sat Jul 4 13:16:24 1998 Tim Janik <timj@gtk.org>
* gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
functions.
* gdk/gdkwindow.c:
* gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
to XFree() calls.
1998-07-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since
......
Sat Jul 4 13:16:24 1998 Tim Janik <timj@gtk.org>
* gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
functions.
* gdk/gdkwindow.c:
* gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
to XFree() calls.
1998-07-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since
......
Sat Jul 4 13:16:24 1998 Tim Janik <timj@gtk.org>
* gtk/*.c: changed reversed_[12] to reserved_[12] in gtk_*_get_type
functions.
* gdk/gdkwindow.c:
* gdk/gdkvisual.c: check for some pointer values to be != NULL, prior
to XFree() calls.
1998-07-03 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkfeatures.h.in: Added GDK_HAVE_FULL_CROSSING_EVENT, since
......
......@@ -147,7 +147,7 @@ gdk_input_motion_events (GdkWindow *window,
coords[i].ytilt = 0.0;
}
XFree(xcoords);
XFree (xcoords);
return coords;
}
......
......@@ -46,12 +46,16 @@ gdk_atom_name (GdkAtom atom)
if (gdk_error_code == -1)
{
if (t)
XFree (t);
return NULL;
}
else
{
name = g_strdup (t);
XFree (t);
if (t)
XFree (t);
return name;
}
......@@ -95,6 +99,7 @@ gdk_property_get (GdkWindow *window,
xwindow = gdk_root_window;
}
ret_data = NULL;
XGetWindowProperty (xdisplay, xwindow, property,
offset, (length + 3) / 4, pdelete,
type, &ret_prop_type, &ret_format,
......@@ -113,6 +118,7 @@ gdk_property_get (GdkWindow *window,
if (ret_prop_type != type)
{
gchar *rn, *pn;
XFree (ret_data);
rn = gdk_atom_name(ret_prop_type);
pn = gdk_atom_name(type);
......
......@@ -109,6 +109,7 @@ gdk_selection_property_get (GdkWindow *requestor,
if (private->destroyed)
return 0;
t = NULL;
XGetWindowProperty (private->xdisplay, private->xwindow,
gdk_selection_property, 0, 0, False,
AnyPropertyType, &prop_type, &prop_format,
......@@ -125,7 +126,11 @@ gdk_selection_property_get (GdkWindow *requestor,
return 0;
}
XFree (t);
if (t)
{
t = NULL;
XFree (t);
}
/* Add on an extra byte to handle null termination. X guarantees
that t will be 1 longer than nbytes and null terminated */
......@@ -144,7 +149,8 @@ gdk_selection_property_get (GdkWindow *requestor,
{
*data = g_new (guchar, length);
memcpy (*data, t, length);
XFree (t);
if (t)
XFree (t);
return length-1;
}
else
......@@ -205,6 +211,8 @@ gdk_text_property_to_text_list (GdkAtom encoding, gint format,
void
gdk_free_text_list (gchar **list)
{
g_return_if_fail (list != NULL);
XFreeStringList (list);
}
......
......@@ -163,7 +163,8 @@ gdk_visual_init (void)
}
}
XFree (visual_list);
if (visual_list)
XFree (visual_list);
for (i = 0; i < nvisuals; i++)
{
......
......@@ -476,7 +476,8 @@ gdk_window_foreign_new (guint32 anid)
/* FIXME: This is pretty expensive. Maybe the caller should supply
* the parent */
XQueryTree (gdk_display, anid, &root, &parent, &children, &nchildren);
XFree (children);
if (children)
XFree (children);
private->parent = gdk_xid_table_lookup (parent);
parent_private = (GdkWindowPrivate *)private->parent;
......@@ -1449,7 +1450,8 @@ gdk_window_get_children (GdkWindow *window)
children = g_list_prepend (children, child);
}
XFree (xchildren);
if (xchildren)
XFree (xchildren);
}
return children;
......@@ -1525,17 +1527,20 @@ gdk_window_add_colormap_windows (GdkWindow *window)
if (window_private->destroyed)
return;
old_windows = NULL;
if (!XGetWMColormapWindows (toplevel_private->xdisplay,
toplevel_private->xwindow,
&old_windows, &count))
{
old_windows = NULL;
count = 0;
}
for (i = 0; i < count; i++)
if (old_windows[i] == window_private->xwindow)
return;
{
XFree (old_windows);
return;
}
new_windows = g_new (Window, count + 1);
......@@ -1949,7 +1954,8 @@ gdk_window_set_icon_name (GdkWindow *window,
XSetWMIconName (window_private->xdisplay, window_private->xwindow,
&property);
XFree(property.value);
if (property.value)
XFree (property.value);
}
void
......
......@@ -267,8 +267,9 @@ gxi_find_root_child(Display *dpy, Window w)
do
{
w = parent;
XQueryTree(dpy,w,&root,&parent,&children,&nchildren);
if (children) XFree(children);
XQueryTree (dpy, w, &root, &parent, &children, &nchildren);
if (children)
XFree (children);
}
while (parent != root);
......
......@@ -147,7 +147,7 @@ gdk_input_motion_events (GdkWindow *window,
coords[i].ytilt = 0.0;
}
XFree(xcoords);
XFree (xcoords);
return coords;
}
......
......@@ -46,12 +46,16 @@ gdk_atom_name (GdkAtom atom)
if (gdk_error_code == -1)
{
if (t)
XFree (t);
return NULL;
}
else
{
name = g_strdup (t);
XFree (t);
if (t)
XFree (t);
return name;
}
......@@ -95,6 +99,7 @@ gdk_property_get (GdkWindow *window,
xwindow = gdk_root_window;
}
ret_data = NULL;
XGetWindowProperty (xdisplay, xwindow, property,
offset, (length + 3) / 4, pdelete,
type, &ret_prop_type, &ret_format,
......@@ -113,6 +118,7 @@ gdk_property_get (GdkWindow *window,
if (ret_prop_type != type)
{
gchar *rn, *pn;
XFree (ret_data);
rn = gdk_atom_name(ret_prop_type);
pn = gdk_atom_name(type);
......
......@@ -109,6 +109,7 @@ gdk_selection_property_get (GdkWindow *requestor,
if (private->destroyed)
return 0;
t = NULL;
XGetWindowProperty (private->xdisplay, private->xwindow,
gdk_selection_property, 0, 0, False,
AnyPropertyType, &prop_type, &prop_format,
......@@ -125,7 +126,11 @@ gdk_selection_property_get (GdkWindow *requestor,
return 0;
}
XFree (t);
if (t)
{
t = NULL;
XFree (t);
}
/* Add on an extra byte to handle null termination. X guarantees
that t will be 1 longer than nbytes and null terminated */
......@@ -144,7 +149,8 @@ gdk_selection_property_get (GdkWindow *requestor,
{
*data = g_new (guchar, length);
memcpy (*data, t, length);
XFree (t);
if (t)
XFree (t);
return length-1;
}
else
......@@ -205,6 +211,8 @@ gdk_text_property_to_text_list (GdkAtom encoding, gint format,
void
gdk_free_text_list (gchar **list)
{
g_return_if_fail (list != NULL);
XFreeStringList (list);
}
......
......@@ -163,7 +163,8 @@ gdk_visual_init (void)
}
}
XFree (visual_list);
if (visual_list)
XFree (visual_list);
for (i = 0; i < nvisuals; i++)
{
......
......@@ -476,7 +476,8 @@ gdk_window_foreign_new (guint32 anid)
/* FIXME: This is pretty expensive. Maybe the caller should supply
* the parent */
XQueryTree (gdk_display, anid, &root, &parent, &children, &nchildren);
XFree (children);
if (children)
XFree (children);
private->parent = gdk_xid_table_lookup (parent);
parent_private = (GdkWindowPrivate *)private->parent;
......@@ -1449,7 +1450,8 @@ gdk_window_get_children (GdkWindow *window)
children = g_list_prepend (children, child);
}
XFree (xchildren);
if (xchildren)
XFree (xchildren);
}
return children;
......@@ -1525,17 +1527,20 @@ gdk_window_add_colormap_windows (GdkWindow *window)
if (window_private->destroyed)
return;
old_windows = NULL;
if (!XGetWMColormapWindows (toplevel_private->xdisplay,
toplevel_private->xwindow,
&old_windows, &count))
{
old_windows = NULL;
count = 0;
}
for (i = 0; i < count; i++)
if (old_windows[i] == window_private->xwindow)
return;
{
XFree (old_windows);
return;
}
new_windows = g_new (Window, count + 1);
......@@ -1949,7 +1954,8 @@ gdk_window_set_icon_name (GdkWindow *window,
XSetWMIconName (window_private->xdisplay, window_private->xwindow,
&property);
XFree(property.value);
if (property.value)
XFree (property.value);
}
void
......
......@@ -267,8 +267,9 @@ gxi_find_root_child(Display *dpy, Window w)
do
{
w = parent;
XQueryTree(dpy,w,&root,&parent,&children,&nchildren);
if (children) XFree(children);
XQueryTree (dpy, w, &root, &parent, &children, &nchildren);
if (children)
XFree (children);
}
while (parent != root);
......
......@@ -64,8 +64,8 @@ gtk_accel_label_get_type (void)
sizeof (GtkAccelLabelClass),
(GtkClassInitFunc) gtk_accel_label_class_init,
(GtkObjectInitFunc) gtk_accel_label_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -48,8 +48,8 @@ gtk_adjustment_get_type (void)
sizeof (GtkAdjustmentClass),
(GtkClassInitFunc) gtk_adjustment_class_init,
(GtkObjectInitFunc) gtk_adjustment_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -57,8 +57,8 @@ gtk_alignment_get_type (void)
sizeof (GtkAlignmentClass),
(GtkClassInitFunc) gtk_alignment_class_init,
(GtkObjectInitFunc) gtk_alignment_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -54,8 +54,8 @@ gtk_arrow_get_type (void)
sizeof (GtkArrowClass),
(GtkClassInitFunc) gtk_arrow_class_init,
(GtkObjectInitFunc) gtk_arrow_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -51,8 +51,8 @@ gtk_aspect_frame_get_type (void)
sizeof (GtkAspectFrameClass),
(GtkClassInitFunc) gtk_aspect_frame_class_init,
(GtkObjectInitFunc) gtk_aspect_frame_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -43,8 +43,8 @@ gtk_button_box_get_type (void)
sizeof (GtkButtonBoxClass),
(GtkClassInitFunc) gtk_button_box_class_init,
(GtkObjectInitFunc) gtk_button_box_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -54,8 +54,8 @@ gtk_bin_get_type (void)
sizeof (GtkBinClass),
(GtkClassInitFunc) gtk_bin_class_init,
(GtkObjectInitFunc) gtk_bin_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -82,8 +82,8 @@ gtk_box_get_type (void)
sizeof (GtkBoxClass),
(GtkClassInitFunc) gtk_box_class_init,
(GtkObjectInitFunc) gtk_box_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -111,8 +111,8 @@ gtk_button_get_type (void)
sizeof (GtkButtonClass),
(GtkClassInitFunc) gtk_button_class_init,
(GtkObjectInitFunc) gtk_button_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -60,8 +60,8 @@ gtk_check_button_get_type (void)
sizeof (GtkCheckButtonClass),
(GtkClassInitFunc) gtk_check_button_class_init,
(GtkObjectInitFunc) gtk_check_button_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -61,8 +61,8 @@ gtk_check_menu_item_get_type (void)
sizeof (GtkCheckMenuItemClass),
(GtkClassInitFunc) gtk_check_menu_item_class_init,
(GtkObjectInitFunc) gtk_check_menu_item_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -294,8 +294,8 @@ gtk_clist_get_type (void)
sizeof (GtkCListClass),
(GtkClassInitFunc) gtk_clist_class_init,
(GtkObjectInitFunc) gtk_clist_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -207,8 +207,8 @@ gtk_color_selection_get_type (void)
sizeof (GtkColorSelectionClass),
(GtkClassInitFunc) gtk_color_selection_class_init,
(GtkObjectInitFunc) gtk_color_selection_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......@@ -1445,8 +1445,8 @@ gtk_color_selection_dialog_get_type (void)
sizeof (GtkColorSelectionDialogClass),
(GtkClassInitFunc) gtk_color_selection_dialog_class_init,
(GtkObjectInitFunc) gtk_color_selection_dialog_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -703,8 +703,8 @@ gtk_combo_get_type (void)
sizeof (GtkComboClass),
(GtkClassInitFunc) gtk_combo_class_init,
(GtkObjectInitFunc) gtk_combo_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
combo_type = gtk_type_unique (gtk_hbox_get_type (), &combo_info);
......
......@@ -148,8 +148,8 @@ gtk_container_get_type (void)
sizeof (GtkContainerClass),
(GtkClassInitFunc) gtk_container_class_init,
(GtkObjectInitFunc) gtk_container_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) gtk_container_base_class_init,
};
......
......@@ -211,8 +211,8 @@ gtk_ctree_get_type (void)
sizeof (GtkCTreeClass),
(GtkClassInitFunc) gtk_ctree_class_init,
(GtkObjectInitFunc) gtk_ctree_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -65,8 +65,8 @@ gtk_curve_get_type (void)
sizeof (GtkCurveClass),
(GtkClassInitFunc) gtk_curve_class_init,
(GtkObjectInitFunc) gtk_curve_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -46,8 +46,8 @@ gtk_data_get_type (void)
sizeof (GtkDataClass),
(GtkClassInitFunc) gtk_data_class_init,
(GtkObjectInitFunc) NULL,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -41,8 +41,8 @@ gtk_dialog_get_type (void)
sizeof (GtkDialogClass),
(GtkClassInitFunc) gtk_dialog_class_init,
(GtkObjectInitFunc) gtk_dialog_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -41,8 +41,8 @@ gtk_drawing_area_get_type (void)
sizeof (GtkDrawingAreaClass),
(GtkClassInitFunc) gtk_drawing_area_class_init,
(GtkObjectInitFunc) gtk_drawing_area_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -121,8 +121,8 @@ gtk_editable_get_type (void)
sizeof (GtkEditableClass),
(GtkClassInitFunc) gtk_editable_class_init,
(GtkObjectInitFunc) gtk_editable_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -214,8 +214,8 @@ gtk_entry_get_type (void)
sizeof (GtkEntryClass),
(GtkClassInitFunc) gtk_entry_class_init,
(GtkObjectInitFunc) gtk_entry_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -47,8 +47,8 @@ gtk_event_box_get_type (void)
sizeof (GtkEventBoxClass),
(GtkClassInitFunc) gtk_event_box_class_init,
(GtkObjectInitFunc) gtk_event_box_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -331,8 +331,8 @@ gtk_file_selection_get_type (void)
sizeof (GtkFileSelectionClass),
(GtkClassInitFunc) gtk_file_selection_class_init,
(GtkObjectInitFunc) gtk_file_selection_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -61,8 +61,8 @@ gtk_fixed_get_type (void)
sizeof (GtkFixedClass),
(GtkClassInitFunc) gtk_fixed_class_init,
(GtkObjectInitFunc) gtk_fixed_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
......
......@@ -399,8 +399,8 @@ gtk_font_selection_get_type()
sizeof(GtkFontSelectionClass),
(GtkClassInitFunc) gtk_font_selection_class_init,
(GtkObjectInitFunc) gtk_font_selection_init,
/* reversed_1 */ NULL,
/* reversed_2 */ NULL,
/* reserved_1 */