metacity r3606 - in trunk: . src/core src/tools src/ui
- From: tthurman svn gnome org
- To: svn-commits-list gnome org
- Subject: metacity r3606 - in trunk: . src/core src/tools src/ui
- Date: Wed, 27 Feb 2008 04:39:10 +0000 (GMT)
Author: tthurman
Date: Wed Feb 27 04:39:10 2008
New Revision: 3606
URL: http://svn.gnome.org/viewvc/metacity?rev=3606&view=rev
Log:
2008-02-27 Thomas Thurman <tthurman gnome org>
Lots of tiny fixes to make sure we compile with
"gcc -ansi -Werror".
Modified:
trunk/ChangeLog
trunk/src/core/boxes.c
trunk/src/core/compositor.c
trunk/src/core/constraints.c
trunk/src/core/delete.c
trunk/src/core/keybindings.c
trunk/src/core/main.c
trunk/src/core/place.c
trunk/src/core/testboxes.c
trunk/src/core/util.c
trunk/src/core/window-props.c
trunk/src/core/window.c
trunk/src/tools/metacity-mag.c
trunk/src/ui/preview-widget.c
Modified: trunk/src/core/boxes.c
==============================================================================
--- trunk/src/core/boxes.c (original)
+++ trunk/src/core/boxes.c Wed Feb 27 04:39:10 2008
@@ -29,7 +29,6 @@
#include "boxes.h"
#include "util.h"
#include <X11/Xutil.h> /* Just for the definition of the various gravities */
-#include <stdio.h> /* For snprintf */
char*
meta_rectangle_to_string (const MetaRectangle *rect,
@@ -61,7 +60,7 @@
char *cur = output;
if (region == NULL)
- snprintf (output, 10, "(EMPTY)");
+ g_snprintf (output, 10, "(EMPTY)");
while (tmp)
{
@@ -114,7 +113,7 @@
GList *tmp = edge_list;
if (edge_list == NULL)
- snprintf (output, 10, "(EMPTY)");
+ g_snprintf (output, 10, "(EMPTY)");
while (tmp)
{
Modified: trunk/src/core/compositor.c
==============================================================================
--- trunk/src/core/compositor.c (original)
+++ trunk/src/core/compositor.c Wed Feb 27 04:39:10 2008
@@ -21,6 +21,9 @@
* 02111-1307, USA.
*/
+#define _GNU_SOURCE
+#define _XOPEN_SOURCE 500 /* for usleep() */
+
#include <config.h>
#include <stdlib.h>
@@ -1310,7 +1313,7 @@
MetaDisplay *display = screen->display;
MetaCompScreen *info = screen->compositor_data;
-// dump_xserver_region ("add_damage", display, damage);
+ /* dump_xserver_region ("add_damage", display, damage); */
if (info->all_damage)
{
Modified: trunk/src/core/constraints.c
==============================================================================
--- trunk/src/core/constraints.c (original)
+++ trunk/src/core/constraints.c Wed Feb 27 04:39:10 2008
@@ -91,7 +91,7 @@
typedef enum
{
- PRIORITY_MINIMUM = 0, // Dummy value used for loop start = min(all priorities)
+ PRIORITY_MINIMUM = 0, /* Dummy value used for loop start = min(all priorities) */
PRIORITY_ASPECT_RATIO = 0,
PRIORITY_ENTIRELY_VISIBLE_ON_SINGLE_XINERAMA = 0,
PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA = 1,
@@ -101,7 +101,7 @@
PRIORITY_SIZE_HINTS_LIMITS = 3,
PRIORITY_TITLEBAR_VISIBLE = 4,
PRIORITY_PARTIALLY_VISIBLE_ON_WORKAREA = 4,
- PRIORITY_MAXIMUM = 4 // Dummy value used for loop end = max(all priorities)
+ PRIORITY_MAXIMUM = 4 /* Dummy value used for loop end = max(all priorities) */
} ConstraintPriority;
typedef enum
Modified: trunk/src/core/delete.c
==============================================================================
--- trunk/src/core/delete.c (original)
+++ trunk/src/core/delete.c Wed Feb 27 04:39:10 2008
@@ -22,6 +22,9 @@
* 02111-1307, USA.
*/
+#define _GNU_SOURCE
+#define _SVID_SOURCE /* for gethostname() */
+
#include <config.h>
#include "util.h"
#include "window.h"
Modified: trunk/src/core/keybindings.c
==============================================================================
--- trunk/src/core/keybindings.c (original)
+++ trunk/src/core/keybindings.c Wed Feb 27 04:39:10 2008
@@ -23,6 +23,9 @@
* 02111-1307, USA.
*/
+#define _GNU_SOURCE
+#define _SVID_SOURCE /* for putenv() */
+
#include <config.h>
#include "keybindings.h"
#include "workspace.h"
Modified: trunk/src/core/main.c
==============================================================================
--- trunk/src/core/main.c (original)
+++ trunk/src/core/main.c Wed Feb 27 04:39:10 2008
@@ -40,6 +40,9 @@
* to investigate, read main(), meta_display_open(), and event_callback().
*/
+#define _GNU_SOURCE
+#define _SVID_SOURCE /* for putenv() and some signal-related functions */
+
#include <config.h>
#include "main.h"
#include "util.h"
@@ -331,7 +334,7 @@
NULL, G_LOG_DOMAIN, "Gtk", "Gdk", "GLib",
"Pango", "GLib-GObject", "GThread"
};
- gint i;
+ guint i;
if (setlocale (LC_ALL, "") == NULL)
meta_warning ("Locale not understood by C library, internationalization will not work\n");
Modified: trunk/src/core/place.c
==============================================================================
--- trunk/src/core/place.c (original)
+++ trunk/src/core/place.c Wed Feb 27 04:39:10 2008
@@ -41,6 +41,7 @@
META_BOTTOM
} MetaWindowDirection;
+#if 0 /* never used -- remove if nobody wants it */
static gint
northwestcmp (gconstpointer a, gconstpointer b)
{
@@ -86,7 +87,9 @@
else
return 0;
}
-
+#endif /* 0 -- never used */
+
+#if 0 /* never used -- remove if nobody wants it */
static void
find_next_cascade (MetaWindow *window,
MetaFrameGeometry *fgeom,
@@ -234,6 +237,7 @@
*new_y = cascade_y + fgeom->top_height;
}
}
+#endif /* 0 -- never used */
static void
find_most_freespace (MetaWindow *window,
Modified: trunk/src/core/testboxes.c
==============================================================================
--- trunk/src/core/testboxes.c (original)
+++ trunk/src/core/testboxes.c Wed Feb 27 04:39:10 2008
@@ -625,15 +625,15 @@
/*************************************************************/
region = get_screen_region (3);
tmp = NULL;
- tmp = g_list_prepend (tmp, new_meta_rect ( 380, 675, 420, 525)); // 220500
- tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 300, 1180)); // 354000
- tmp = g_list_prepend (tmp, new_meta_rect ( 380, 20, 320, 1180)); // 377600
- tmp = g_list_prepend (tmp, new_meta_rect ( 0, 675, 800, 475)); // 380000
- tmp = g_list_prepend (tmp, new_meta_rect (1200, 20, 400, 1180)); // 472000
- tmp = g_list_prepend (tmp, new_meta_rect ( 0, 675, 1600, 425)); // 680000
- tmp = g_list_prepend (tmp, new_meta_rect ( 900, 20, 700, 1080)); // 756000
- tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 700, 1130)); // 791000
- tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 1600, 505)); // 808000
+ tmp = g_list_prepend (tmp, new_meta_rect ( 380, 675, 420, 525)); /* 220500 */
+ tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 300, 1180)); /* 354000 */
+ tmp = g_list_prepend (tmp, new_meta_rect ( 380, 20, 320, 1180)); /* 377600 */
+ tmp = g_list_prepend (tmp, new_meta_rect ( 0, 675, 800, 475)); /* 380000 */
+ tmp = g_list_prepend (tmp, new_meta_rect (1200, 20, 400, 1180)); /* 472000 */
+ tmp = g_list_prepend (tmp, new_meta_rect ( 0, 675, 1600, 425)); /* 680000 */
+ tmp = g_list_prepend (tmp, new_meta_rect ( 900, 20, 700, 1080)); /* 756000 */
+ tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 700, 1130)); /* 791000 */
+ tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 1600, 505)); /* 808000 */
#if 0
printf ("Got to here...\n");
char region_list[(RECT_LENGTH+2) * g_list_length (region)];
Modified: trunk/src/core/util.c
==============================================================================
--- trunk/src/core/util.c (original)
+++ trunk/src/core/util.c Wed Feb 27 04:39:10 2008
@@ -22,6 +22,9 @@
* 02111-1307, USA.
*/
+#define _GNU_SOURCE
+#define _POSIX_C_SOURCE /* for fdopen() */
+
#include <config.h>
#include "util.h"
#include "main.h"
Modified: trunk/src/core/window-props.c
==============================================================================
--- trunk/src/core/window-props.c (original)
+++ trunk/src/core/window-props.c Wed Feb 27 04:39:10 2008
@@ -22,6 +22,9 @@
* 02111-1307, USA.
*/
+#define _GNU_SOURCE
+#define _SVID_SOURCE /* for gethostname() */
+
#include <config.h>
#include "window-props.h"
#include "errors.h"
Modified: trunk/src/core/window.c
==============================================================================
--- trunk/src/core/window.c (original)
+++ trunk/src/core/window.c Wed Feb 27 04:39:10 2008
@@ -627,17 +627,20 @@
parent = meta_display_lookup_x_window (window->display,
window->xtransient_for);
- // First, maybe the app was launched with startup notification using an
- // obsolete version of the spec; use that timestamp if it exists.
+ /* First, maybe the app was launched with startup notification using an
+ * obsolete version of the spec; use that timestamp if it exists.
+ */
if (window->initial_timestamp_set)
- // NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
- // being recorded as a fallback for potential transients
+ /* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
+ * being recorded as a fallback for potential transients
+ */
window->net_wm_user_time = window->initial_timestamp;
else if (parent != NULL)
meta_window_set_user_time(window, parent->net_wm_user_time);
else
- // NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
- // being recorded as a fallback for potential transients
+ /* NOTE: Do NOT toggle net_wm_user_time_set to true; this is just
+ * being recorded as a fallback for potential transients
+ */
window->net_wm_user_time =
meta_display_get_current_time_roundtrip (window->display);
}
@@ -5085,10 +5088,10 @@
meta_window_move_resize_request(window,
value_mask,
gravity,
- event->xclient.data.l[1], // x
- event->xclient.data.l[2], // y
- event->xclient.data.l[3], // width
- event->xclient.data.l[4]); // height
+ event->xclient.data.l[1], /* x */
+ event->xclient.data.l[2], /* y */
+ event->xclient.data.l[3], /* width */
+ event->xclient.data.l[4]); /* height */
}
else if (event->xclient.message_type ==
display->atom_net_active_window)
@@ -5892,7 +5895,7 @@
strut_end = struts[4+(i*2)+1];
temp = g_new (MetaStrut, 1);
- temp->side = 1 << i; // See MetaDirection def. Matches nicely, eh?
+ temp->side = 1 << i; /* See MetaDirection def. Matches nicely, eh? */
temp->rect = window->screen->rect;
switch (temp->side)
{
Modified: trunk/src/tools/metacity-mag.c
==============================================================================
--- trunk/src/tools/metacity-mag.c (original)
+++ trunk/src/tools/metacity-mag.c Wed Feb 27 04:39:10 2008
@@ -19,6 +19,9 @@
* 02111-1307, USA.
*/
+#define _GNU_SOURCE
+#define _XOPEN_SOURCE 600 /* C99 -- for rint() */
+
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
Modified: trunk/src/ui/preview-widget.c
==============================================================================
--- trunk/src/ui/preview-widget.c (original)
+++ trunk/src/ui/preview-widget.c Wed Feb 27 04:39:10 2008
@@ -21,6 +21,10 @@
* 02111-1307, USA.
*/
+#define _GNU_SOURCE
+#define _XOPEN_SOURCE 600 /* for the maths routines over floats */
+
+#include <math.h>
#include "preview-widget.h"
static void meta_preview_class_init (MetaPreviewClass *klass);
@@ -470,7 +474,7 @@
MetaFrameLayout *fgeom;
MetaFrameStyle *frame_style;
- g_return_if_fail (META_IS_PREVIEW (preview));
+ g_return_val_if_fail (META_IS_PREVIEW (preview), NULL);
flags = (META_PREVIEW (preview)->flags);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]