summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@src.gnome.org>1999-01-01 23:36:32 +0000
committerJeff Garzik <jgarzik@src.gnome.org>1999-01-01 23:36:32 +0000
commit7433badf8e0810c870281eeb9a758face2fbfb71 (patch)
tree20ff66c4db0d7b1cf0fd9520e941f47a51e1276a /gdk
parent385108e0dee634a08ed6de5703c43e2aaafd80df (diff)
downloadgtk+-7433badf8e0810c870281eeb9a758face2fbfb71.tar.gz
Check for features.h.
* configure.in, config.h.in: Check for features.h. * gdk/gdkevents.c (gdk_event_put, gdk_events_queue): Fixed bug in linked list append logic by replacing hand-coded logic with a call to g_list_append. Bug found by tml. * gdk/gdkimage.c: 'gcc -ansi -pedantic' on GNU/Linux spews warnings and errors in sys/ipc.h, including one specific admonishment to use _SVID_SOURCE or _XOPEN_SOURCE. Manually defined the latter, and included features.h if present to obtain the necessary side-effects. * gtk/gtkclist.c, gtk/gtkeditable.c: Eliminates comma-after-final-element warnings. * gtk/gtkfontsel.c (gtk_font_selection_init): Fixed bug where an intl string was declared as _("x") in local var initializer.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkevents.c25
-rw-r--r--gdk/gdkimage.c13
-rw-r--r--gdk/x11/gdkevents-x11.c25
-rw-r--r--gdk/x11/gdkimage-x11.c13
4 files changed, 36 insertions, 40 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 9ea15d52bb..ecffbae84e 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -474,24 +474,17 @@ void
gdk_event_put (GdkEvent *event)
{
GdkEvent *new_event;
- GList *tmp_list;
g_return_if_fail (event != NULL);
new_event = gdk_event_copy (event);
- tmp_list = g_list_alloc();
- tmp_list->prev = putback_tail;
- tmp_list->next = NULL;
- tmp_list->data = new_event;
+ putback_tail = g_list_append(putback_tail, new_event);
if (!putback_events)
- {
- putback_events = tmp_list;
- putback_tail = tmp_list;
- }
+ putback_events = putback_tail;
else
- putback_tail->next = tmp_list;
+ putback_tail = putback_tail->next;
}
/*
@@ -1877,18 +1870,12 @@ gdk_events_queue (void)
if (gdk_event_translate (event, &xevent))
{
- GList *tmp_list = g_list_alloc();
- tmp_list->prev = queued_tail;
- tmp_list->next = NULL;
- tmp_list->data = event;
+ queued_tail = g_list_append(queued_tail, event);
if (!queued_events)
- {
- queued_events = tmp_list;
- queued_tail = queued_events;
- }
+ queued_events = queued_tail;
else
- queued_tail->next = tmp_list;
+ queued_tail = queued_tail->next;
}
else
gdk_event_free (event);
diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c
index 5d48182d93..81bfb7648f 100644
--- a/gdk/gdkimage.c
+++ b/gdk/gdkimage.c
@@ -16,7 +16,18 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-#include "config.h"
+#include <config.h>
+
+/* gcc -ansi -pedantic on GNU/Linux causes warnings and errors
+ * unless this is defined:
+ * warning: #warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
+ */
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 1
+#endif
+#ifdef HAVE_FEATURES_H
+# include <features.h>
+#endif
#include <stdlib.h>
#include <sys/types.h>
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index 9ea15d52bb..ecffbae84e 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -474,24 +474,17 @@ void
gdk_event_put (GdkEvent *event)
{
GdkEvent *new_event;
- GList *tmp_list;
g_return_if_fail (event != NULL);
new_event = gdk_event_copy (event);
- tmp_list = g_list_alloc();
- tmp_list->prev = putback_tail;
- tmp_list->next = NULL;
- tmp_list->data = new_event;
+ putback_tail = g_list_append(putback_tail, new_event);
if (!putback_events)
- {
- putback_events = tmp_list;
- putback_tail = tmp_list;
- }
+ putback_events = putback_tail;
else
- putback_tail->next = tmp_list;
+ putback_tail = putback_tail->next;
}
/*
@@ -1877,18 +1870,12 @@ gdk_events_queue (void)
if (gdk_event_translate (event, &xevent))
{
- GList *tmp_list = g_list_alloc();
- tmp_list->prev = queued_tail;
- tmp_list->next = NULL;
- tmp_list->data = event;
+ queued_tail = g_list_append(queued_tail, event);
if (!queued_events)
- {
- queued_events = tmp_list;
- queued_tail = queued_events;
- }
+ queued_events = queued_tail;
else
- queued_tail->next = tmp_list;
+ queued_tail = queued_tail->next;
}
else
gdk_event_free (event);
diff --git a/gdk/x11/gdkimage-x11.c b/gdk/x11/gdkimage-x11.c
index 5d48182d93..81bfb7648f 100644
--- a/gdk/x11/gdkimage-x11.c
+++ b/gdk/x11/gdkimage-x11.c
@@ -16,7 +16,18 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-#include "config.h"
+#include <config.h>
+
+/* gcc -ansi -pedantic on GNU/Linux causes warnings and errors
+ * unless this is defined:
+ * warning: #warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
+ */
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 1
+#endif
+#ifdef HAVE_FEATURES_H
+# include <features.h>
+#endif
#include <stdlib.h>
#include <sys/types.h>