Commit 395ccd36 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Miscellaneous minor fixes to remove ANSI C incompatibilities

Mon Mar  2 17:48:38 1998  Owen Taylor  <owt1@cornell.edu>

	Miscellaneous minor fixes to remove ANSI C incompatibilities

	* gdk/gdkregion.c gtk/gtkclist.c: fix // comments

	* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
	some arguments to ANSI functions

	* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
	  to void *

	* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)

	* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
	  be guint)

	* gtk/gtkstatusbar.c: trailing ';'

	* gtk/testgtk.c: GList where there should have been GSList

	* glib.h gutils.c : changed g_strcasecmp
	  to take gchar* not guchar*

	* testglib.c: Remove trailing ; after functions
parent 33622818
Mon Mar 2 17:48:38 1998 Owen Taylor <owt1@cornell.edu>
Miscellaneous minor fixes to remove ANSI C incompatibilities
* gdk/gdkregion.c gtk/gtkclist.c: fix // comments
* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
some arguments to ANSI functions
* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
to void *
* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)
* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
be guint)
* gtk/gtkstatusbar.c: trailing ';'
* gtk/testgtk.c: GList where there should have been GSList
Mon Mar 2 12:26:59 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL'
......
Mon Mar 2 17:48:38 1998 Owen Taylor <owt1@cornell.edu>
Miscellaneous minor fixes to remove ANSI C incompatibilities
* gdk/gdkregion.c gtk/gtkclist.c: fix // comments
* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
some arguments to ANSI functions
* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
to void *
* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)
* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
be guint)
* gtk/gtkstatusbar.c: trailing ';'
* gtk/testgtk.c: GList where there should have been GSList
Mon Mar 2 12:26:59 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL'
......
Mon Mar 2 17:48:38 1998 Owen Taylor <owt1@cornell.edu>
Miscellaneous minor fixes to remove ANSI C incompatibilities
* gdk/gdkregion.c gtk/gtkclist.c: fix // comments
* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
some arguments to ANSI functions
* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
to void *
* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)
* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
be guint)
* gtk/gtkstatusbar.c: trailing ';'
* gtk/testgtk.c: GList where there should have been GSList
Mon Mar 2 12:26:59 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL'
......
Mon Mar 2 17:48:38 1998 Owen Taylor <owt1@cornell.edu>
Miscellaneous minor fixes to remove ANSI C incompatibilities
* gdk/gdkregion.c gtk/gtkclist.c: fix // comments
* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
some arguments to ANSI functions
* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
to void *
* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)
* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
be guint)
* gtk/gtkstatusbar.c: trailing ';'
* gtk/testgtk.c: GList where there should have been GSList
Mon Mar 2 12:26:59 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL'
......
Mon Mar 2 17:48:38 1998 Owen Taylor <owt1@cornell.edu>
Miscellaneous minor fixes to remove ANSI C incompatibilities
* gdk/gdkregion.c gtk/gtkclist.c: fix // comments
* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
some arguments to ANSI functions
* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
to void *
* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)
* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
be guint)
* gtk/gtkstatusbar.c: trailing ';'
* gtk/testgtk.c: GList where there should have been GSList
Mon Mar 2 12:26:59 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL'
......
Mon Mar 2 17:48:38 1998 Owen Taylor <owt1@cornell.edu>
Miscellaneous minor fixes to remove ANSI C incompatibilities
* gdk/gdkregion.c gtk/gtkclist.c: fix // comments
* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
some arguments to ANSI functions
* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
to void *
* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)
* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
be guint)
* gtk/gtkstatusbar.c: trailing ';'
* gtk/testgtk.c: GList where there should have been GSList
Mon Mar 2 12:26:59 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL'
......
Mon Mar 2 17:48:38 1998 Owen Taylor <owt1@cornell.edu>
Miscellaneous minor fixes to remove ANSI C incompatibilities
* gdk/gdkregion.c gtk/gtkclist.c: fix // comments
* gdk/gdkdnd.c gdk/gdkinputcommon.h: change types of
some arguments to ANSI functions
* gtk/gtkcombo.c gtk/gtktree.c: fix casts of function pointers
to void *
* gtk/gtkmain.c: An actual bug! (in deprecated gtk_input_add_interp)
* gtk/gtknotebook.h: Bitfields must be gint or guint. (and should
be guint)
* gtk/gtkstatusbar.c: trailing ';'
* gtk/testgtk.c: GList where there should have been GSList
Mon Mar 2 12:26:59 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkentry.c: Changed 'entry != NULL' to 'editable != NULL'
......
......@@ -86,6 +86,7 @@ gdk_dnd_display_drag_cursor(gint x, gint y, gboolean drag_ok,
GdkWindow *mypix, *opix;
GdkPoint *myhotspot;
gint itmp;
guint masktmp;
Window wtmp;
if(x == -2 && y == -2) /* Hide the cursors */
......@@ -97,7 +98,7 @@ gdk_dnd_display_drag_cursor(gint x, gint y, gboolean drag_ok,
if(x == -1 && y == -1) /* We're supposed to find it out for ourselves */
XQueryPointer(gdk_display, gdk_root_window,
&wtmp, &wtmp, &x, &y, &itmp, &itmp, &itmp);
&wtmp, &wtmp, &x, &y, &itmp, &itmp, &masktmp);
if(drag_ok)
{
......
......@@ -72,9 +72,11 @@ gdk_input_get_root_relative_geometry(Display *dpy, Window w, int *x_ret, int *y_
{
Window root,parent;
Window *children;
int nchildren;
int x,y,width,height;
int xc,yc,widthc,heightc,border_widthc,depthc;
guint nchildren;
gint x,y;
guint width, height;
gint xc,yc;
guint widthc,heightc,border_widthc,depthc;
XQueryTree(dpy,w,&root,&parent,&children,&nchildren);
if (children) XFree(children);
......
......@@ -115,7 +115,7 @@ gdk_region_rect_in (GdkRegion *region,
case RectanglePart: return GDK_OVERLAP_RECTANGLE_PART;
}
return GDK_OVERLAP_RECTANGLE_OUT; // what else ?
return GDK_OVERLAP_RECTANGLE_OUT; /*what else ? */
}
void
......
......@@ -86,6 +86,7 @@ gdk_dnd_display_drag_cursor(gint x, gint y, gboolean drag_ok,
GdkWindow *mypix, *opix;
GdkPoint *myhotspot;
gint itmp;
guint masktmp;
Window wtmp;
if(x == -2 && y == -2) /* Hide the cursors */
......@@ -97,7 +98,7 @@ gdk_dnd_display_drag_cursor(gint x, gint y, gboolean drag_ok,
if(x == -1 && y == -1) /* We're supposed to find it out for ourselves */
XQueryPointer(gdk_display, gdk_root_window,
&wtmp, &wtmp, &x, &y, &itmp, &itmp, &itmp);
&wtmp, &wtmp, &x, &y, &itmp, &itmp, &masktmp);
if(drag_ok)
{
......
......@@ -72,9 +72,11 @@ gdk_input_get_root_relative_geometry(Display *dpy, Window w, int *x_ret, int *y_
{
Window root,parent;
Window *children;
int nchildren;
int x,y,width,height;
int xc,yc,widthc,heightc,border_widthc,depthc;
guint nchildren;
gint x,y;
guint width, height;
gint xc,yc;
guint widthc,heightc,border_widthc,depthc;
XQueryTree(dpy,w,&root,&parent,&children,&nchildren);
if (children) XFree(children);
......
......@@ -115,7 +115,7 @@ gdk_region_rect_in (GdkRegion *region,
case RectanglePart: return GDK_OVERLAP_RECTANGLE_PART;
}
return GDK_OVERLAP_RECTANGLE_OUT; // what else ?
return GDK_OVERLAP_RECTANGLE_OUT; /*what else ? */
}
void
......
Mon Mar 2 17:51:18 1998 Owen Taylor <owt1@cornell.edu>
* glib.h gutils.c : changed g_strcasecmp
to take gchar* not guchar*
* testglib.c: Remove trailing ; after functions
Sun Mar 1 19:04:40 1998 Owen Taylor <owt1@cornell.edu>
* glib.h gstring.c: Added g_string_insert[_c]()
......
......@@ -660,7 +660,7 @@ gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */
gdouble g_strtod (const gchar *nptr, gchar **endptr);
gchar* g_strerror (gint errnum);
gchar* g_strsignal (gint signum);
gint g_strcasecmp (const guchar *s1, const guchar *s2);
gint g_strcasecmp (const gchar *s1, const gchar *s2);
gint g_snprintf (gchar *str, gulong n, gchar const *fmt, ...);
......
......@@ -845,7 +845,7 @@ g_snprintf (gchar *str,
}
gint
g_strcasecmp (const guchar *s1, const guchar *s2)
g_strcasecmp (const gchar *s1, const gchar *s2)
{
#ifdef HAVE_STRCASECMP
return strcasecmp(s1, s2);
......@@ -854,12 +854,12 @@ g_strcasecmp (const guchar *s1, const guchar *s2)
while (*s1 && *s2)
{
c1 = tolower(*s1++); c2 = tolower(*s2++);
c1 = tolower((guchar)(*s1++)); c2 = tolower((guchar)(*s2++));
if (c1 != c2)
return (c1 - c2);
}
return ((gint) *s1 - (gint) *s2);
return (((gint)(guchar) *s1) - ((gint)(guchar) *s2));
#endif
}
......
......@@ -152,7 +152,7 @@ gtk_combo_find (GtkCombo * combo)
if (combo->case_sensitive)
string_compare = strcmp;
else
string_compare = (void*) g_strcasecmp;
string_compare = g_strcasecmp;
text = gtk_entry_get_text (GTK_ENTRY (combo->entry));
clist = GTK_LIST (combo->list)->children;
......
......@@ -1140,7 +1140,7 @@ gtk_input_add_interp (gint source,
gpointer data,
GtkDestroyNotify destroy)
{
return gdk_input_add_full (source, condition, NULL, callback, data);
return gtk_input_add_full (source, condition, NULL, callback, data, destroy);
}
void
......
......@@ -76,8 +76,8 @@ struct _GtkNotebookPage
GtkWidget *child;
GtkWidget *tab_label;
GtkWidget *menu_label;
gint8 default_menu : 1;
gint8 default_tab : 1;
guint default_menu : 1;
guint default_tab : 1;
GtkRequisition requisition;
GtkAllocation allocation;
};
......
......@@ -68,7 +68,7 @@ gtk_statusbar_get_type ()
}
return statusbar_type;
};
}
static void
gtk_statusbar_marshal_text_p (GtkObject *object,
......
......@@ -149,7 +149,8 @@ gtk_tree_class_init (GtkTreeClass *class)
widget_class->size_allocate = gtk_tree_size_allocate;
container_class->add = gtk_tree_add;
container_class->remove = (void *) gtk_tree_remove_item;
container_class->remove =
(void (*)(GtkContainer *, GtkWidget *)) gtk_tree_remove_item;
container_class->foreach = gtk_tree_foreach;
class->selection_changed = NULL;
......@@ -619,8 +620,8 @@ gtk_tree_realize (GtkWidget *widget)
}
void
gtk_tree_remove_item (GtkTree *container,
GtkWidget *widget)
gtk_tree_remove_item (GtkTree *container,
GtkWidget *widget)
{
GList *item_list;
......
......@@ -886,7 +886,7 @@ static void
statusbar_dump_stack (GtkWidget *button,
GtkStatusbar *statusbar)
{
GList *list;
GSList *list;
for (list = statusbar->messages; list; list = list->next)
{
......@@ -3251,6 +3251,15 @@ create_rulers ()
}
static void
text_toggle_editable (GtkWidget *checkbutton,
GtkWidget *text)
{
gtk_text_set_editable(GTK_TEXT(text),
GTK_TOGGLE_BUTTON(checkbutton)->active);
}
/*
* GtkText
*/
......@@ -3261,6 +3270,7 @@ create_text ()
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *button;
GtkWidget *editable_check;
GtkWidget *separator;
GtkWidget *table;
GtkWidget *hscrollbar;
......@@ -3364,6 +3374,13 @@ create_text ()
gtk_text_thaw (GTK_TEXT (text));
editable_check = gtk_check_button_new_with_label("Editable");
gtk_box_pack_start (GTK_BOX (box2), editable_check, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT(editable_check), "toggled",
GTK_SIGNAL_FUNC(text_toggle_editable), text);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(editable_check), TRUE);
gtk_widget_show (editable_check);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
gtk_widget_show (separator);
......
......@@ -886,7 +886,7 @@ static void
statusbar_dump_stack (GtkWidget *button,
GtkStatusbar *statusbar)
{
GList *list;
GSList *list;
for (list = statusbar->messages; list; list = list->next)
{
......@@ -3251,6 +3251,15 @@ create_rulers ()
}
static void
text_toggle_editable (GtkWidget *checkbutton,
GtkWidget *text)
{
gtk_text_set_editable(GTK_TEXT(text),
GTK_TOGGLE_BUTTON(checkbutton)->active);
}
/*
* GtkText
*/
......@@ -3261,6 +3270,7 @@ create_text ()
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *button;
GtkWidget *editable_check;
GtkWidget *separator;
GtkWidget *table;
GtkWidget *hscrollbar;
......@@ -3364,6 +3374,13 @@ create_text ()
gtk_text_thaw (GTK_TEXT (text));
editable_check = gtk_check_button_new_with_label("Editable");
gtk_box_pack_start (GTK_BOX (box2), editable_check, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT(editable_check), "toggled",
GTK_SIGNAL_FUNC(text_toggle_editable), text);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(editable_check), TRUE);
gtk_widget_show (editable_check);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
gtk_widget_show (separator);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment