Remove G_ENABLE_DEBUG around debug checks

It started out as busywork, but it does many separate things. If I could
start over, I'd take them apart into multiple commits:

1. Remove G_ENABLE_DEBUG around GDK_DEBUG_*() calls
   This is not needed at all, the calls themselves take care of it.

2. Remove G_ENABLE_DEBUG around profiling code
   This now enables profiling support in release builds.

3. Stop poking _gdk_debug_flags and use GDK_DEBUG_CHECK()
   This was old code that was never updated.

4. Make !G_ENABLE_DEBUG turn off GDK_DEBUG_CHECK()
   The code used to
     #define GDK_DEBUG_CHECK(...) false
     #define GDK_DEBUG(...)
   which would compile away all the code inside those macros. This
   means a lot of variable definitions and debug utility functions
   would suddenly no longer be used and cause compiler errors.
This commit is contained in:
Benjamin Otte 2023-11-04 20:00:26 +01:00
parent d55801c8ba
commit 310ab7b531
63 changed files with 9 additions and 359 deletions

View File

@ -209,13 +209,11 @@ _gdk_broadway_roundtrip_notify (GdkSurface *surface,
timings->complete = TRUE;
#ifdef G_ENABLE_DEBUG
if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
_gdk_frame_clock_debug_print_timings (clock, timings);
if (GDK_PROFILER_IS_RUNNING)
_gdk_frame_clock_add_timings_to_profiler (clock, timings);
#endif
}
}

View File

@ -369,14 +369,12 @@ portal_file_serializer (GdkContentSerializer *serializer)
GDK_DEBUG (DND, "file transfer portal: Adding %s", g_file_peek_path (file));
g_ptr_array_add (files, g_file_get_path (file));
}
#ifdef G_ENABLE_DEBUG
else if (GDK_DEBUG_CHECK (DND))
{
char *uri = g_file_get_uri (file);
gdk_debug_message ("file transfer portal: %s has no path, dropping\n", uri);
g_free (uri);
}
#endif
g_ptr_array_add (files, NULL);
}
@ -426,14 +424,12 @@ portal_finish (GObject *object,
return;
}
#ifdef G_ENABLE_DEBUG
if (GDK_DEBUG_CHECK (DND))
{
char *s = g_strjoinv (", ", files);
gdk_debug_message ("file transfer portal: Receiving files: %s", s);
g_free (s);
}
#endif
value = gdk_content_deserializer_get_value (deserializer);
if (G_VALUE_HOLDS (value, G_TYPE_FILE))

View File

@ -83,8 +83,6 @@ gdk_debug_message (const char *format, ...)
g_free (s);
}
#ifdef G_ENABLE_DEBUG
#define GDK_DISPLAY_DEBUG_CHECK(display,type) \
G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
@ -94,13 +92,6 @@ gdk_debug_message (const char *format, ...)
gdk_debug_message (__VA_ARGS__); \
} G_STMT_END
#else /* !G_ENABLE_DEBUG */
#define GDK_DISPLAY_DEBUG_CHECK(display,type) 0
#define GDK_DISPLAY_DEBUG(display,type,...)
#endif /* G_ENABLE_DEBUG */
#define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type)
#define GDK_DEBUG(type,...) GDK_DISPLAY_DEBUG (NULL,type,__VA_ARGS__)

View File

@ -1428,7 +1428,6 @@ gdk_display_get_gl_context (GdkDisplay *self)
}
#ifdef HAVE_EGL
#ifdef G_ENABLE_DEBUG
static int
strvcmp (gconstpointer p1,
gconstpointer p2)
@ -1485,7 +1484,6 @@ describe_egl_config (EGLDisplay egl_display,
return g_strdup_printf ("R%dG%dB%dA%d%s", red, green, blue, alpha, type == EGL_COLOR_COMPONENT_TYPE_FIXED_EXT ? "" : " float");
}
#endif
gpointer
gdk_display_get_egl_config (GdkDisplay *self)
@ -1786,7 +1784,6 @@ gdk_display_init_egl (GdkDisplay *self,
if (priv->egl_config_high_depth == NULL)
priv->egl_config_high_depth = priv->egl_config;
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (self, OPENGL))
{
char *ext = describe_extensions (priv->egl_display);
@ -1810,7 +1807,6 @@ gdk_display_init_egl (GdkDisplay *self,
g_free (std_cfg);
g_free (ext);
}
#endif
gdk_profiler_end_mark (start_time, "init EGL", NULL);

View File

@ -402,7 +402,6 @@ gdk_event_alloc (GdkEventType event_type,
GdkEvent *event = (GdkEvent *) g_type_create_instance (gdk_event_types[event_type]);
#ifdef G_ENABLE_DEBUG
if (GDK_DEBUG_CHECK (EVENTS))
{
char *str = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event_type);
@ -410,7 +409,6 @@ gdk_event_alloc (GdkEventType event_type,
g_type_name (gdk_event_types[event_type]), str);
g_free (str);
}
#endif
event->event_type = event_type;
event->surface = surface != NULL ? g_object_ref (surface) : NULL;

View File

@ -531,8 +531,6 @@ gdk_frame_clock_get_current_timings (GdkFrameClock *frame_clock)
return gdk_frame_clock_get_timings (frame_clock, priv->frame_counter);
}
#ifdef G_ENABLE_DEBUG
void
_gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
GdkFrameTimings *timings)
@ -579,7 +577,6 @@ _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
g_message ("%s", str->str);
g_string_free (str, TRUE);
}
#endif /* G_ENABLE_DEBUG */
#define DEFAULT_REFRESH_INTERVAL 16667 /* 16.7ms (1/60th second) */
#define MAX_HISTORY_AGE 150000 /* 150ms */

View File

@ -585,14 +585,12 @@ gdk_frame_clock_paint_idle (void *data)
if (!gdk_frame_clock_idle_is_frozen (clock_idle))
{
int iter;
#ifdef G_ENABLE_DEBUG
if (GDK_DEBUG_CHECK (FRAMES))
{
if (priv->phase != GDK_FRAME_CLOCK_PHASE_LAYOUT &&
(priv->requested & GDK_FRAME_CLOCK_PHASE_LAYOUT))
timings->layout_start_time = g_get_monotonic_time ();
}
#endif
priv->phase = GDK_FRAME_CLOCK_PHASE_LAYOUT;
/* We loop in the layout phase, because we don't want to progress
@ -616,14 +614,12 @@ gdk_frame_clock_paint_idle (void *data)
case GDK_FRAME_CLOCK_PHASE_PAINT:
if (!gdk_frame_clock_idle_is_frozen (clock_idle))
{
#ifdef G_ENABLE_DEBUG
if (GDK_DEBUG_CHECK (FRAMES))
{
if (priv->phase != GDK_FRAME_CLOCK_PHASE_PAINT &&
(priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT))
timings->paint_start_time = g_get_monotonic_time ();
}
#endif
priv->phase = GDK_FRAME_CLOCK_PHASE_PAINT;
if (priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT)
@ -643,13 +639,11 @@ gdk_frame_clock_paint_idle (void *data)
*/
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
}
#ifdef G_ENABLE_DEBUG
if (GDK_DEBUG_CHECK (FRAMES))
{
if (timings)
timings->frame_end_time = g_get_monotonic_time ();
}
#endif /* G_ENABLE_DEBUG */
G_GNUC_FALLTHROUGH;
case GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS:

View File

@ -95,11 +95,9 @@ struct _GdkFrameTimings
gint64 refresh_interval;
gint64 predicted_presentation_time;
#ifdef G_ENABLE_DEBUG
gint64 layout_start_time;
gint64 paint_start_time;
gint64 frame_end_time;
#endif /* G_ENABLE_DEBUG */
guint complete : 1;
guint slept_before : 1;

View File

@ -1563,7 +1563,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
epoxy_has_gl_extension ("GL_ARB_sync") ||
epoxy_has_gl_extension ("GL_APPLE_sync");
#ifdef G_ENABLE_DEBUG
{
int max_texture_size;
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_texture_size);
@ -1588,7 +1587,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->has_sync ? "yes" : "no",
priv->has_bgra ? "yes" : "no");
}
#endif
priv->extensions_checked = TRUE;
}

View File

@ -252,7 +252,6 @@ gdk_vulkan_strerror (VkResult result)
}
}
#ifdef G_ENABLE_DEBUG
static const char *
surface_present_mode_to_string (VkPresentModeKHR present_mode)
{
@ -275,7 +274,6 @@ surface_present_mode_to_string (VkPresentModeKHR present_mode)
return "(unknown)";
}
#endif
static const VkPresentModeKHR preferred_present_modes[] = {
VK_PRESENT_MODE_MAILBOX_KHR,

View File

@ -180,7 +180,6 @@ typedef enum {
POLLING_DESCRIPTORS,
} SelectThreadState;
#ifdef G_ENABLE_DEBUG
static const char *const state_names[] = {
"BEFORE_START",
"WAITING",
@ -188,7 +187,6 @@ static const char *const state_names[] = {
"POLLING_RESTART",
"POLLING_DESCRIPTORS"
};
#endif
static SelectThreadState select_thread_state = BEFORE_START;
@ -374,7 +372,6 @@ select_thread_start (void)
}
}
#ifdef G_ENABLE_DEBUG
static void
dump_poll_result (GPollFD *ufds,
guint nfds)
@ -400,7 +397,6 @@ dump_poll_result (GPollFD *ufds,
gdk_debug_message ("%s", s->str);
g_string_free (s, TRUE);
}
#endif
static gboolean
pollfds_equal (GPollFD *old_pollfds,
@ -468,13 +464,11 @@ select_thread_start_poll (GPollFD *ufds,
n_ready = old_poll_func (ufds, nfds, 0);
if (n_ready > 0 || timeout == 0)
{
#ifdef G_ENABLE_DEBUG
if ((_gdk_debug_flags & GDK_DEBUG_EVENTLOOP) && n_ready > 0)
if (GDK_DEBUG_CHECK (EVENTLOOP) && n_ready > 0)
{
gdk_debug_message ("EventLoop: Found ready file descriptors before waiting");
dump_poll_result (ufds, nfds);
}
#endif
return n_ready;
}
@ -612,13 +606,11 @@ select_thread_collect_poll (GPollFD *ufds, guint nfds)
}
}
#ifdef G_ENABLE_DEBUG
if (_gdk_debug_flags & GDK_DEBUG_EVENTLOOP)
if (GDK_DEBUG_CHECK (EVENTLOOP))
{
gdk_debug_message ("EventLoop: Found ready file descriptors after waiting");
dump_poll_result (ufds, nfds);
}
#endif
}
SELECT_THREAD_UNLOCK ();

View File

@ -225,14 +225,12 @@ gdk_wayland_clipboard_read_async (GdkClipboard *clipboard,
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_clipboard_read_async);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: read for %s", cb, s);
g_free (s);
}
#endif
mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
if (mime_type == NULL)
{
@ -322,14 +320,12 @@ gdk_wayland_clipboard_claim_remote (GdkWaylandClipboard *cb,
gdk_wayland_clipboard_discard_offer (cb);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: remote clipboard claim for %s", cb, s);
g_free (s);
}
#endif
cb->offer_formats = formats;
cb->offer = offer;

View File

@ -267,8 +267,6 @@ postpone_on_globals_closure (GdkWaylandDisplay *display_wayland,
g_list_append (display_wayland->on_has_globals_closures, closure);
}
#ifdef G_ENABLE_DEBUG
static const char *
get_format_name (uint32_t format,
char name[10])
@ -287,16 +285,13 @@ get_format_name (uint32_t format,
return name;
}
#endif
static void
wl_shm_format (void *data,
struct wl_shm *wl_shm,
uint32_t format)
{
#ifdef G_ENABLE_DEBUG
char buf[10];
#endif
GDK_DEBUG (MISC, "supported pixel format %s (0x%X)",
get_format_name (format, buf), (guint) format);
@ -312,13 +307,11 @@ server_decoration_manager_default_mode (void
uint32_t mode)
{
g_assert (mode <= ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER);
#ifdef G_ENABLE_DEBUG
const char *modes[] = {
[ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_NONE] = "none",
[ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT] = "client",
[ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER] = "server",
};
#endif
GdkWaylandDisplay *display_wayland = data;
GDK_DISPLAY_DEBUG (GDK_DISPLAY (data), MISC, "Compositor prefers decoration mode '%s'", modes[mode]);
display_wayland->server_decoration_mode = mode;
@ -2243,8 +2236,6 @@ gdk_wayland_display_get_setting (GdkDisplay *display,
return FALSE;
}
#ifdef G_ENABLE_DEBUG
static const char *
subpixel_to_string (int layout)
{
@ -2291,8 +2282,6 @@ transform_to_string (int transform)
return NULL;
}
#endif
static void
update_scale (GdkDisplay *display)
{

View File

@ -340,14 +340,12 @@ gdk_wayland_drag_create_data_source (GdkDrag *drag)
mimetypes = gdk_content_formats_get_mime_types (formats, &n_mimetypes);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_drag_get_display (drag), EVENTS))
{
char *s = g_strjoinv (" ", (char **)mimetypes);
gdk_debug_message ("create data source, mime types=%s", s);
g_free (s);
}
#endif
wl_data_source_offer (drag_wayland->data_source, GDK_WAYLAND_LOCAL_DND_MIME_TYPE);
for (i = 0; i < n_mimetypes; i++)

View File

@ -191,14 +191,12 @@ gdk_wayland_drop_read_async (GdkDrop *drop,
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_drop_read_async);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_drop_get_display (drop), DND))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: read for %s", drop, s);
g_free (s);
}
#endif
mime_type = gdk_content_formats_match_mime_type (formats,
gdk_drop_get_formats (drop));
if (mime_type == NULL)

View File

@ -495,7 +495,6 @@ static void
print_modifiers (GdkDisplay *display,
struct xkb_keymap *keymap)
{
#ifdef G_ENABLE_DEBUG
int i, j;
uint32_t real;
struct xkb_state *state;
@ -538,7 +537,6 @@ print_modifiers (GdkDisplay *display,
g_string_free (str, TRUE);
xkb_state_unref (state);
#endif
}
void

View File

@ -107,14 +107,12 @@ gdk_wayland_primary_claim_remote (GdkWaylandPrimary *cb,
gdk_wayland_primary_discard_offer (cb);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (GDK_CLIPBOARD (cb)), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: remote primary claim for %s", cb, s);
g_free (s);
}
#endif
cb->offer_formats = formats;
cb->offer = offer;
@ -270,14 +268,12 @@ gdk_wayland_primary_claim (GdkClipboard *clipboard,
{
GdkWaylandPrimary *cb = GDK_WAYLAND_PRIMARY (clipboard);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (clipboard), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: claim primary (%s) for %s", cb, local ? "local" : "remote", s);
g_free (s);
}
#endif
if (local)
{
GdkWaylandDisplay *wdisplay = GDK_WAYLAND_DISPLAY (gdk_clipboard_get_display (clipboard));
@ -328,14 +324,12 @@ gdk_wayland_primary_read_async (GdkClipboard *clipboard,
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_primary_read_async);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (gdk_clipboard_get_display (clipboard), CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%p: read for %s", cb, s);
g_free (s);
}
#endif
mime_type = gdk_content_formats_match_mime_type (formats, cb->offer_formats);
if (mime_type == NULL)
{

View File

@ -877,8 +877,6 @@ pointer_handle_button (void *data,
gdk_wayland_seat_flush_frame_event (seat);
}
#ifdef G_ENABLE_DEBUG
static const char *
get_axis_name (uint32_t axis)
{
@ -893,8 +891,6 @@ get_axis_name (uint32_t axis)
}
}
#endif
static void
pointer_handle_axis (void *data,
struct wl_pointer *pointer,
@ -943,8 +939,6 @@ pointer_handle_frame (void *data,
gdk_wayland_seat_flush_frame_event (seat);
}
#ifdef G_ENABLE_DEBUG
static const char *
get_axis_source_name (enum wl_pointer_axis_source source)
{
@ -963,8 +957,6 @@ get_axis_source_name (enum wl_pointer_axis_source source)
}
}
#endif
static void
pointer_handle_axis_source (void *data,
struct wl_pointer *pointer,
@ -1090,7 +1082,6 @@ get_active_layout (GdkKeymap *keymap)
return -1;
}
#ifdef G_ENABLE_DEBUG
static const char *
get_active_layout_name (GdkKeymap *keymap)
{
@ -1100,7 +1091,6 @@ get_active_layout_name (GdkKeymap *keymap)
return xkb_keymap_layout_get_name (xkb_keymap, get_active_layout (keymap));
}
#endif
static void
keyboard_handle_keymap (void *data,
@ -1126,7 +1116,6 @@ keyboard_handle_keymap (void *data,
_gdk_wayland_keymap_update_from_fd (seat->keymap, format, fd, size);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (seat->keymap->display, INPUT))
{
GString *s = g_string_new ("");
@ -1143,7 +1132,6 @@ keyboard_handle_keymap (void *data,
gdk_debug_message ("layouts: %s", s->str);
g_string_free (s, TRUE);
}
#endif
g_signal_emit_by_name (seat->keymap, "keys-changed");
g_signal_emit_by_name (seat->keymap, "state-changed");
@ -3435,9 +3423,7 @@ static void
tablet_pad_group_handle_done (void *data,
struct zwp_tablet_pad_group_v2 *wp_tablet_pad_group)
{
#ifdef G_ENABLE_DEBUG
GdkWaylandTabletPadGroupData *group = data;
#endif
GDK_SEAT_DEBUG (group->pad->seat, EVENTS,
"tablet pad group handle done, pad group = %p",

View File

@ -193,7 +193,7 @@ get_egl_window_size (GdkSurface *surface,
GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_FRACTIONAL)
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_FRACTIONAL))
{
GDK_DISPLAY_DEBUG (display, OPENGL, "Using fractional scale %g for EGL window", gdk_fractional_scale_to_double (&impl->scale));
@ -308,10 +308,8 @@ frame_callback (void *data,
timings->complete = TRUE;
#ifdef G_ENABLE_DEBUG
if ((_gdk_debug_flags & GDK_DEBUG_FRAMES) != 0)
_gdk_frame_clock_debug_print_timings (clock, timings);
#endif
if (GDK_PROFILER_IS_RUNNING)
_gdk_frame_clock_add_timings_to_profiler (clock, timings);

View File

@ -1228,8 +1228,7 @@ inner_clipboard_window_procedure (HWND hwnd,
GDK_NOTE (DND, g_print (" drawclipboard owner: %p; opener %p ", hwnd_owner, hwnd_opener));
#ifdef G_ENABLE_DEBUG
if (_gdk_debug_flags & GDK_DEBUG_DND)
if (GDK_DEBUG_CHECK (DND))
{
/* FIXME: grab and print clipboard formats without opening the clipboard
if (clipboard_thread_data->clipboard_opened_for != INVALID_HANDLE_VALUE ||
@ -1249,7 +1248,6 @@ inner_clipboard_window_procedure (HWND hwnd,
}
*/
}
#endif
GDK_NOTE (DND, g_print (" \n"));

View File

@ -714,8 +714,6 @@ build_pointer_event_state (MSG *msg)
return state;
}
#ifdef G_ENABLE_DEBUG
static void
print_event_state (guint state)
{
@ -860,8 +858,6 @@ decode_key_lparam (LPARAM lParam)
return buf;
}
#endif
static void
fixup_event (GdkEvent *event)
{
@ -2936,7 +2932,6 @@ gdk_event_translate (MSG *msg,
break;
case WM_WINDOWPOSCHANGING:
#ifdef G_ENABLE_DEBUG
{
char buf[256];
GDK_NOTE (EVENTS, (windowpos = (WINDOWPOS *) msg->lParam,
@ -2951,7 +2946,6 @@ gdk_event_translate (MSG *msg,
windowpos->cx, windowpos->cy, windowpos->x, windowpos->y,
GetNextWindow (msg->hwnd, GW_HWNDPREV))));
}
#endif
if (GDK_SURFACE_IS_MAPPED (window))
{
@ -2986,7 +2980,6 @@ gdk_event_translate (MSG *msg,
case WM_WINDOWPOSCHANGED:
windowpos = (WINDOWPOS *) msg->lParam;
#ifdef G_ENABLE_DEBUG
{
char buf[256];
GDK_NOTE (EVENTS, g_print (" %s %s %dx%d@%+d%+d",
@ -2999,7 +2992,6 @@ gdk_event_translate (MSG *msg,
buf))))),
windowpos->cx, windowpos->cy, windowpos->x, windowpos->y));
}
#endif
impl = GDK_WIN32_SURFACE (window);

View File

@ -339,7 +339,6 @@ gdk_win32_display_init_wgl (GdkDisplay *display,
return NULL;
}
#if G_ENABLE_DEBUG
{
int major, minor;
gdk_gl_context_get_version (context, &major, &minor);
@ -357,7 +356,6 @@ gdk_win32_display_init_wgl (GdkDisplay *display,
display_win32->hasWglEXTSwapControl ? "yes" : "no",
display_win32->hasWglOMLSyncControl ? "yes" : "no"));
}
#endif
wglMakeCurrent (NULL, NULL);

View File

@ -125,8 +125,6 @@ _gdk_other_api_failed (const char *where,
}
#ifdef G_ENABLE_DEBUG
/*
* Like g_strdup_printf, but to a static buffer. Return value does not
* have to be g_free()d. The buffer is of bounded size and reused
@ -796,5 +794,3 @@ _gdk_win32_rect_to_string (const RECT *rect)
(rect->right - rect->left), (rect->bottom - rect->top),
rect->left, rect->top);
}
#endif /* G_ENABLE_DEBUG */

View File

@ -31,20 +31,12 @@
/* Old debug macros */
#ifdef G_ENABLE_DEBUG
#define GDK_NOTE(type,action) \
G_STMT_START { \
if (GDK_DEBUG_CHECK (type)) \
{ action; }; \
} G_STMT_END
#else
#define GDK_NOTE(type,action)
#endif
/* According to
* http://blog.airesoft.co.uk/2009/11/wm_messages/
* this is the actual internal name MS uses for this undocumented message.
@ -102,7 +94,6 @@ gboolean _gdk_modal_blocked (GdkSurface *window);
gboolean gdk_win32_ensure_com (void);
gboolean gdk_win32_ensure_ole (void);
#ifdef G_ENABLE_DEBUG
void _gdk_win32_print_dc (HDC hdc);
char *_gdk_win32_surface_state_to_string (GdkToplevelState state);
@ -117,7 +108,6 @@ char *_gdk_win32_cf_to_string (UINT format);
char *_gdk_win32_rect_to_string (const RECT *rect);
void _gdk_win32_print_event (GdkEvent *event);
#endif
void _gdk_win32_api_failed (const char *where,
const char *api);

View File

@ -65,7 +65,6 @@ print_atoms (GdkX11Clipboard *cb,
const Atom *atoms,
gsize n_atoms)
{
#ifdef G_ENABLE_DEBUG
GdkDisplay *display = gdk_clipboard_get_display (GDK_CLIPBOARD (cb));
if (GDK_DISPLAY_DEBUG_CHECK (display, CLIPBOARD))
@ -82,7 +81,6 @@ print_atoms (GdkX11Clipboard *cb,
gdk_debug_message ("%s", str->str);
g_string_free (str, TRUE);
}
#endif
}
static void
@ -330,14 +328,12 @@ gdk_x11_clipboard_request_targets_finish (GObject *source_object,
formats = gdk_x11_clipboard_formats_from_atoms (display,
g_bytes_get_data (bytes, NULL),
g_bytes_get_size (bytes) / sizeof (Atom));
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, CLIPBOARD))
{
char *s = gdk_content_formats_to_string (formats);
gdk_debug_message ("%s: got formats: %s", cb->selection, s);
g_free (s);
}
#endif
/* union with previously loaded formats */
formats = gdk_content_formats_union (formats, gdk_clipboard_get_formats (GDK_CLIPBOARD (cb)));
@ -481,20 +477,16 @@ gdk_x11_clipboard_xevent (GdkDisplay *display,
case SelectionRequest:
{
#ifdef G_ENABLE_DEBUG
const char *target, *property;
#endif
if (xevent->xselectionrequest.selection != cb->xselection)
return FALSE;
#ifdef G_ENABLE_DEBUG
target = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.target);
if (xevent->xselectionrequest.property == None)
property = target;
else
property = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.property);
#endif
if (!gdk_clipboard_is_local (GDK_CLIPBOARD (cb)))
{

View File

@ -39,7 +39,6 @@
#include <string.h>
#ifdef G_ENABLE_DEBUG
static const char notify_modes[][19] = {
"NotifyNormal",
"NotifyGrab",
@ -57,7 +56,6 @@ static const char notify_details[][23] = {
"NotifyPointerRoot",
"NotifyDetailNone"
};
#endif
#define HAS_FOCUS(toplevel) \
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
@ -226,7 +224,6 @@ translate_valuator_class (GdkDisplay *display,
}
_gdk_device_add_axis (device, use, min, max, resolution);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, INPUT))
{
const char *label;
@ -238,7 +235,6 @@ translate_valuator_class (GdkDisplay *display,
gdk_debug_message ("\n\taxis: %s %s", label, use == GDK_AXIS_IGNORE ? "(ignored)" : "(used)");
}
#endif
}
static void
@ -521,7 +517,6 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
break;
}
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, INPUT))
{
const char *type_names[] = { "logical", "physical", "floating" };
@ -533,7 +528,6 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
dev->use == XIMasterPointer,
num_touches);
}
#endif
if (dev->use != XIMasterKeyboard &&
dev->use != XIMasterPointer)
@ -1919,7 +1913,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
GdkTouchpadGesturePhase phase;
double x, y;
#ifdef G_ENABLE_DEBUG
const char *event_name = "";
switch (xev->evtype)
{
@ -1935,7 +1928,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
default:
break;
}
#endif
GDK_DEBUG (EVENTS, "pinch gesture %s:\twindow %ld\n\tfinger_count: %u%s",
event_name,
@ -1979,7 +1971,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
GdkTouchpadGesturePhase phase;
double x, y;
#ifdef G_ENABLE_DEBUG
const char *event_name = "";
switch (xev->evtype)
{
@ -1995,7 +1986,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
default:
break;
}
#endif
GDK_DEBUG (EVENTS, "swipe gesture %s:\twindow %ld\n\tfinger_count: %u%s",
event_name,

View File

@ -745,7 +745,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
break;
case VisibilityNotify:
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, EVENTS))
switch (xevent->xvisibility.state)
{
@ -764,7 +763,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
default:
break;
}
#endif /* G_ENABLE_DEBUG */
/* not handled */
break;
@ -1229,13 +1227,11 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
timings->refresh_interval = refresh_interval;
timings->complete = TRUE;
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, FRAMES))
_gdk_frame_clock_debug_print_timings (clock, timings);
if (GDK_PROFILER_IS_RUNNING)
_gdk_frame_clock_add_timings_to_profiler (clock, timings);
#endif /* G_ENABLE_DEBUG */
}
}
}

View File

@ -1658,20 +1658,16 @@ gdk_x11_drag_xevent (GdkDisplay *display,
case SelectionRequest:
{
GdkContentFormats *formats;
#ifdef G_ENABLE_DEBUG
const char *target, *property;
#endif
if (xevent->xselectionrequest.selection != xselection)
return FALSE;
#ifdef G_ENABLE_DEBUG
target = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.target);
if (xevent->xselectionrequest.property == None)
property = target;
else
property = gdk_x11_get_xatom_name_for_display (display, xevent->xselectionrequest.property);
#endif
if (xevent->xselectionrequest.requestor == None)
{

View File

@ -293,7 +293,6 @@ gdk_x11_drop_finalize (GObject *object)
/* Utility functions */
#ifdef G_ENABLE_DEBUG
static void
print_target_list (GdkContentFormats *formats)
{
@ -301,7 +300,6 @@ print_target_list (GdkContentFormats *formats)
g_message ("DND formats: %s", name);
g_free (name);
}
#endif /* G_ENABLE_DEBUG */
/*************************************************************
***************************** XDND **************************
@ -411,7 +409,6 @@ gdk_x11_drop_read_actions (GdkDrop *drop)
drop_x11->xdnd_have_actions = TRUE;
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, DND))
{
GString *action_str = g_string_new (NULL);
@ -428,7 +425,6 @@ gdk_x11_drop_read_actions (GdkDrop *drop)
g_message("Xdnd actions = %s", action_str->str);
g_string_free (action_str, TRUE);
}
#endif /* G_ENABLE_DEBUG */
}
if (data)
@ -555,10 +551,8 @@ xdnd_enter_filter (GdkSurface *surface,
content_formats = gdk_content_formats_new ((const char **) formats->pdata, formats->len);
g_ptr_array_unref (formats);
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, DND))
print_target_list (content_formats);
#endif /* G_ENABLE_DEBUG */
drag = gdk_x11_drag_find (display, source_window, GDK_SURFACE_XID (surface));

View File

@ -176,9 +176,7 @@ gdk_x11_selection_input_stream_read (GInputStream *input_stream,
GError **error)
{
GdkX11SelectionInputStream *stream = GDK_X11_SELECTION_INPUT_STREAM (input_stream);
#ifdef G_ENABLE_DEBUG
GdkX11SelectionInputStreamPrivate *priv = gdk_x11_selection_input_stream_get_instance_private (stream);
#endif
gssize written;
GDK_DISPLAY_DEBUG (priv->display, SELECTION,

View File

@ -653,7 +653,6 @@ print_atoms (GdkDisplay *display,
const Atom *atoms,
gsize n_atoms)
{
#ifdef G_ENABLE_DEBUG
if (GDK_DISPLAY_DEBUG_CHECK (display, CLIPBOARD))
{
GString *str;
@ -666,7 +665,6 @@ print_atoms (GdkDisplay *display,
gdk_debug_message ("%s", str->str);
g_string_free (str, TRUE);
}
#endif
}
static void

View File

@ -1060,10 +1060,8 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
gsk_gl_command_queue_make_current (self);
#ifdef G_ENABLE_DEBUG
gsk_gl_profiler_begin_gpu_region (self->gl_profiler);
gsk_profiler_timer_begin (self->profiler, self->metrics.cpu_time);
#endif
glEnable (GL_DEPTH_TEST);
glDepthFunc (GL_LEQUAL);
@ -1289,7 +1287,6 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
gdk_profiler_set_int_counter (self->metrics.n_uploads, self->n_uploads);
gdk_profiler_set_int_counter (self->metrics.queue_depth, self->batches.len);
#ifdef G_ENABLE_DEBUG
{
gint64 start_time G_GNUC_UNUSED = gsk_profiler_timer_get_start (self->profiler, self->metrics.cpu_time);
gint64 cpu_time = gsk_profiler_timer_end (self->profiler, self->metrics.cpu_time);
@ -1301,7 +1298,6 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
gsk_profiler_push_samples (self->profiler);
}
#endif
}
void
@ -1716,7 +1712,6 @@ void
gsk_gl_command_queue_set_profiler (GskGLCommandQueue *self,
GskProfiler *profiler)
{
#ifdef G_ENABLE_DEBUG
g_assert (GSK_IS_GL_COMMAND_QUEUE (self));
g_assert (GSK_IS_PROFILER (profiler));
@ -1735,5 +1730,4 @@ gsk_gl_command_queue_set_profiler (GskGLCommandQueue *self,
self->metrics.n_programs = gdk_profiler_define_int_counter ("programs", "Number of program changes");
self->metrics.queue_depth = gdk_profiler_define_int_counter ("gl-queue-depth", "Depth of GL command batches");
}
#endif
}

View File

@ -135,10 +135,8 @@ gsk_gl_renderer_realize (GskRenderer *renderer,
}
}
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (GSK_RENDERER (self), SHADERS))
debug_shaders = TRUE;
#endif
if (!(driver = gsk_gl_driver_for_display (display, debug_shaders, error)))
goto failure;
@ -307,10 +305,8 @@ gsk_gl_renderer_render (GskRenderer *renderer,
gsk_gl_driver_begin_frame (self->driver, self->command_queue);
job = gsk_gl_render_job_new (self->driver, &viewport, scale, render_region, 0, clear_framebuffer);
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (GSK_RENDERER (self), FALLBACK))
gsk_gl_render_job_set_debug_fallback (job, TRUE);
#endif
gsk_gl_render_job_render (job, root);
gsk_gl_driver_end_frame (self->driver);
gsk_gl_render_job_free (job);
@ -395,10 +391,8 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
{
gsk_gl_driver_begin_frame (self->driver, self->command_queue);
job = gsk_gl_render_job_new (self->driver, viewport, 1, NULL, render_target->framebuffer_id, TRUE);
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (GSK_RENDERER (self), FALLBACK))
gsk_gl_render_job_set_debug_fallback (job, TRUE);
#endif
gsk_gl_render_job_render_flipped (job, root);
texture_id = gsk_gl_driver_release_render_target (self->driver, render_target, FALSE);
texture = gsk_gl_driver_create_gdk_texture (self->driver, texture_id, gdk_format);

View File

@ -1226,7 +1226,6 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
cairo_fill (cr);
cairo_restore (cr);
#ifdef G_ENABLE_DEBUG
if (job->debug_fallback)
{
cairo_move_to (cr, 0, 0);
@ -1242,7 +1241,6 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
cairo_set_source_rgba (cr, 1, 0, 0, 1);
cairo_stroke (cr);
}
#endif
cairo_destroy (cr);
/* Create texture to upload */

View File

@ -140,7 +140,6 @@ gsk_gl_texture_library_real_compact (GskGLTextureLibrary *self,
g_clear_pointer (&removed, g_ptr_array_unref);
}
#ifdef G_ENABLE_DEBUG
if (GSK_DEBUG_CHECK (GLYPH_CACHE))
{
static gint64 last_message;
@ -153,7 +152,6 @@ gsk_gl_texture_library_real_compact (GskGLTextureLibrary *self,
self->atlases->len);
}
}
#endif
return ret;
}

View File

@ -27,12 +27,10 @@
#include "gskrendernodeprivate.h"
#include "gdk/gdktextureprivate.h"
#ifdef G_ENABLE_DEBUG
typedef struct {
GQuark cpu_time;
GQuark gpu_time;
} ProfileTimers;
#endif
struct _GskCairoRenderer
{
@ -40,9 +38,7 @@ struct _GskCairoRenderer
GdkCairoContext *cairo_context;
#ifdef G_ENABLE_DEBUG
ProfileTimers profile_timers;
#endif
};
struct _GskCairoRendererClass
@ -78,25 +74,19 @@ gsk_cairo_renderer_do_render (GskRenderer *renderer,
cairo_t *cr,
GskRenderNode *root)
{
#ifdef G_ENABLE_DEBUG
GskCairoRenderer *self = GSK_CAIRO_RENDERER (renderer);
GskProfiler *profiler;
gint64 cpu_time;
#endif
#ifdef G_ENABLE_DEBUG
profiler = gsk_renderer_get_profiler (renderer);
gsk_profiler_timer_begin (profiler, self->profile_timers.cpu_time);
#endif
gsk_render_node_draw (root, cr);
#ifdef G_ENABLE_DEBUG
cpu_time = gsk_profiler_timer_end (profiler, self->profile_timers.cpu_time);
gsk_profiler_timer_set (profiler, self->profile_timers.cpu_time, cpu_time);
gsk_profiler_push_samples (profiler);
#endif
}
static GdkTexture *
@ -173,7 +163,6 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
g_return_if_fail (cr != NULL);
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (renderer, GEOMETRY))
{
GdkSurface *surface = gsk_renderer_get_surface (renderer);
@ -187,7 +176,6 @@ gsk_cairo_renderer_render (GskRenderer *renderer,
cairo_stroke (cr);
cairo_restore (cr);
}
#endif
gsk_cairo_renderer_do_render (renderer, cr, root);
@ -210,11 +198,9 @@ gsk_cairo_renderer_class_init (GskCairoRendererClass *klass)
static void
gsk_cairo_renderer_init (GskCairoRenderer *self)
{
#ifdef G_ENABLE_DEBUG
GskProfiler *profiler = gsk_renderer_get_profiler (GSK_RENDERER (self));
self->profile_timers.cpu_time = gsk_profiler_add_timer (profiler, "cpu-time", "CPU time", FALSE, TRUE);
#endif
}
/**

View File

@ -29,8 +29,6 @@ void gsk_set_debug_flags (GskDebugFlags flags);
gboolean gsk_check_debug_flags (GskDebugFlags flags);
#ifdef G_ENABLE_DEBUG
#define GSK_DEBUG_CHECK(type) G_UNLIKELY (gsk_check_debug_flags (GSK_DEBUG_ ## type))
#define GSK_RENDERER_DEBUG_CHECK(renderer,type) \
G_UNLIKELY ((gsk_renderer_get_debug_flags (renderer) & GSK_DEBUG_ ## type) != 0)
@ -47,14 +45,5 @@ gboolean gsk_check_debug_flags (GskDebugFlags flags);
gdk_debug_message (__VA_ARGS__); \
} G_STMT_END
#else
#define GSK_DEBUG_CHECK(type) 0
#define GSK_RENDERER_DEBUG_CHECK(renderer,type) 0
#define GSK_RENDERER_DEBUG(display,type,...)
#define GSK_DEBUG(type,...)
#endif
G_END_DECLS

View File

@ -162,7 +162,6 @@ uniform_type_from_glsl (const char *str)
return GSK_GL_UNIFORM_TYPE_NONE;
}
#ifdef G_ENABLE_DEBUG
static const char *
uniform_type_name (GskGLUniformType type)
{
@ -195,7 +194,6 @@ uniform_type_name (GskGLUniformType type)
return NULL;
}
}
#endif
static int
uniform_type_size (GskGLUniformType type)
@ -399,7 +397,6 @@ gsk_gl_shader_constructed (GObject *object)
shader->n_textures = max_texture_seen;
#ifdef G_ENABLE_DEBUG
if (GSK_DEBUG_CHECK(SHADERS))
{
GString *s;
@ -417,7 +414,6 @@ gsk_gl_shader_constructed (GObject *object)
s->str);
g_string_free (s, TRUE);
}
#endif
}
#define SPACE_RE "[ \\t]+" // Don't use \s, we don't want to match newlines

View File

@ -377,7 +377,6 @@ gsk_renderer_render_texture (GskRenderer *renderer,
texture = GSK_RENDERER_GET_CLASS (renderer)->render_texture (renderer, root, viewport);
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER))
{
GString *buf = g_string_new ("*** Texture stats ***\n\n");
@ -392,7 +391,6 @@ gsk_renderer_render_texture (GskRenderer *renderer,
g_string_free (buf, TRUE);
}
#endif
g_clear_pointer (&priv->root_node, gsk_render_node_unref);
@ -459,7 +457,6 @@ gsk_renderer_render (GskRenderer *renderer,
GSK_RENDERER_GET_CLASS (renderer)->render (renderer, root, clip);
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (renderer, RENDERER))
{
GString *buf = g_string_new ("*** Frame stats ***\n\n");
@ -474,7 +471,6 @@ gsk_renderer_render (GskRenderer *renderer,
g_string_free (buf, TRUE);
}
#endif
g_clear_pointer (&priv->prev_node, gsk_render_node_unref);
cairo_region_destroy (clip);

View File

@ -392,7 +392,6 @@ gsk_render_node_draw (GskRenderNode *node,
GSK_RENDER_NODE_GET_CLASS (node)->draw (node, cr);
#ifdef G_ENABLE_DEBUG
if (GSK_DEBUG_CHECK (GEOMETRY))
{
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
@ -402,7 +401,6 @@ gsk_render_node_draw (GskRenderNode *node,
cairo_set_source_rgba (cr, 0, 0, 0, 0.5);
cairo_stroke (cr);
}
#endif
cairo_restore (cr);

View File

@ -1455,7 +1455,6 @@ gtk_at_spi_context_realize (GtkATContext *context)
if (self->connection == NULL)
return;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (A11Y))
{
GtkAccessible *accessible = gtk_at_context_get_accessible (context);
@ -1467,7 +1466,6 @@ gtk_at_spi_context_realize (GtkATContext *context)
role_name);
g_free (role_name);
}
#endif
gtk_at_spi_root_queue_register (self->root, self, register_object);
}

View File

@ -37,12 +37,10 @@ static inline void fixup_validation (GtkTreeRBTree *tree,
GtkTreeRBNode *node);
static inline void fixup_total_count (GtkTreeRBTree *tree,
GtkTreeRBNode *node);
#ifdef G_ENABLE_DEBUG
static void gtk_tree_rbtree_test (const char *where,
GtkTreeRBTree *tree);
static void gtk_tree_rbtree_debug_spew (GtkTreeRBTree *tree,
GString *s);
#endif
static const GtkTreeRBNode nil =
{
@ -77,7 +75,6 @@ gtk_tree_rbnode_new (GtkTreeRBTree *tree,
static void
gtk_tree_rbnode_free (GtkTreeRBNode *node)
{
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
{
node->left = (gpointer) 0xdeadbeef;
@ -88,7 +85,6 @@ gtk_tree_rbnode_free (GtkTreeRBNode *node)
node->count = 56789;
node->flags = 0;
}
#endif
g_slice_free (GtkTreeRBNode, node);
}
@ -398,12 +394,10 @@ gtk_rbnode_adjust (GtkTreeRBTree *tree,
void
gtk_tree_rbtree_remove (GtkTreeRBTree *tree)
{
#ifdef G_ENABLE_DEBUG
GtkTreeRBTree *tmp_tree;
if (GTK_DEBUG_CHECK (TREE))
gtk_tree_rbtree_test (G_STRLOC, tree);
#endif
/* ugly hack to make fixup_validation work in the first iteration of the
* loop below */
@ -415,16 +409,12 @@ gtk_tree_rbtree_remove (GtkTreeRBTree *tree)
-(int) tree->root->total_count,
-tree->root->offset);
#ifdef G_ENABLE_DEBUG
tmp_tree = tree->parent_tree;
#endif
gtk_tree_rbtree_free (tree);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
gtk_tree_rbtree_test (G_STRLOC, tmp_tree);
#endif
}
@ -437,7 +427,6 @@ gtk_tree_rbtree_insert_after (GtkTreeRBTree *tree,
GtkTreeRBNode *node;
gboolean right = TRUE;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
{
GString *s;
@ -449,7 +438,6 @@ gtk_tree_rbtree_insert_after (GtkTreeRBTree *tree,
g_string_free (s, TRUE);
gtk_tree_rbtree_test (G_STRLOC, tree);
}
#endif
if (current != NULL && !gtk_tree_rbtree_is_nil (current->right))
{
@ -487,7 +475,6 @@ gtk_tree_rbtree_insert_after (GtkTreeRBTree *tree,
gtk_tree_rbtree_insert_fixup (tree, node);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
{
GString *s;
@ -498,7 +485,6 @@ gtk_tree_rbtree_insert_after (GtkTreeRBTree *tree,
g_string_free (s, TRUE);
gtk_tree_rbtree_test (G_STRLOC, tree);
}
#endif
return node;
}
@ -512,7 +498,6 @@ gtk_tree_rbtree_insert_before (GtkTreeRBTree *tree,
GtkTreeRBNode *node;
gboolean left = TRUE;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
{
GString *s;
@ -524,7 +509,6 @@ gtk_tree_rbtree_insert_before (GtkTreeRBTree *tree,
g_string_free (s, TRUE);
gtk_tree_rbtree_test (G_STRLOC, tree);
}
#endif
if (current != NULL && !gtk_tree_rbtree_is_nil (current->left))
{
@ -563,7 +547,6 @@ gtk_tree_rbtree_insert_before (GtkTreeRBTree *tree,
gtk_tree_rbtree_insert_fixup (tree, node);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
{
GString *s;
@ -574,7 +557,6 @@ gtk_tree_rbtree_insert_before (GtkTreeRBTree *tree,
g_string_free (s, TRUE);
gtk_tree_rbtree_test (G_STRLOC, tree);
}
#endif
return node;
}
@ -613,10 +595,8 @@ gtk_tree_rbtree_node_set_height (GtkTreeRBTree *tree,
gtk_rbnode_adjust (tree, node, 0, 0, diff);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
gtk_tree_rbtree_test (G_STRLOC, tree);
#endif
}
void
@ -1138,7 +1118,6 @@ gtk_tree_rbtree_remove_node (GtkTreeRBTree *tree,
g_return_if_fail (node != NULL);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
{
GString *s;
@ -1150,17 +1129,14 @@ gtk_tree_rbtree_remove_node (GtkTreeRBTree *tree,
g_string_free (s, TRUE);
gtk_tree_rbtree_test (G_STRLOC, tree);
}
#endif
/* make sure we're deleting a node that's actually in the tree */
for (x = node; !gtk_tree_rbtree_is_nil (x->parent); x = x->parent)
;
g_return_if_fail (x == tree->root);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
gtk_tree_rbtree_test (G_STRLOC, tree);
#endif
if (gtk_tree_rbtree_is_nil (node->left) ||
gtk_tree_rbtree_is_nil (node->right))
@ -1253,7 +1229,6 @@ gtk_tree_rbtree_remove_node (GtkTreeRBTree *tree,
gtk_tree_rbnode_free (node);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TREE))
{
GString *s;
@ -1264,7 +1239,6 @@ gtk_tree_rbtree_remove_node (GtkTreeRBTree *tree,
g_string_free (s, TRUE);
gtk_tree_rbtree_test (G_STRLOC, tree);
}
#endif
}
GtkTreeRBNode *
@ -1506,7 +1480,7 @@ void fixup_total_count (GtkTreeRBTree *tree,
node->left->total_count + node->right->total_count;
}
#ifdef G_ENABLE_DEBUG
#ifndef G_DISABLE_ASSERT
static guint
get_total_count (GtkTreeRBNode *node)
{
@ -1563,6 +1537,7 @@ _count_nodes (GtkTreeRBTree *tree,
g_error ("Tree failed");
return res;
}
#endif /* G_DISABLE_ASSERT */
static void
gtk_tree_rbtree_test_height (GtkTreeRBTree *tree,
@ -1744,4 +1719,3 @@ gtk_tree_rbtree_debug_spew (GtkTreeRBTree *tree,
else
gtk_tree_rbtree_debug_spew_helper (tree, tree->root, s, 0);
}
#endif /* G_ENABLE_DEBUG */

View File

@ -195,7 +195,6 @@ static void gtk_tree_store_move (GtkTreeStore *
gboolean before);
#ifdef G_ENABLE_DEBUG
static void validate_gnode (GNode *node);
static inline void
@ -207,9 +206,6 @@ validate_tree (GtkTreeStore *tree_store)
validate_gnode (G_NODE (tree_store->priv->root));
}
}
#else
#define validate_tree(store)
#endif
G_DEFINE_TYPE_WITH_CODE (GtkTreeStore, gtk_tree_store, G_TYPE_OBJECT,
G_ADD_PRIVATE (GtkTreeStore)
@ -3413,7 +3409,6 @@ gtk_tree_store_has_default_sort_func (GtkTreeSortable *sortable)
return (tree_store->priv->default_sort_func != NULL);
}
#ifdef G_ENABLE_DEBUG
static void
validate_gnode (GNode* node)
{
@ -3429,7 +3424,6 @@ validate_gnode (GNode* node)
iter = iter->next;
}
}
#endif
/* GtkBuildable custom tag implementation
*

View File

@ -416,7 +416,6 @@ gtk_action_helper_set_action_name (GtkActionHelper *helper,
if (g_strcmp0 (action_name, helper->action_name) == 0)
return;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (ACTIONS))
{
if (action_name == NULL || !strchr (action_name, '.'))
@ -424,7 +423,6 @@ gtk_action_helper_set_action_name (GtkActionHelper *helper,
"it is unlikely to work",
"actionhelper", action_name);
}
#endif
/* Start by recording the current state of our properties so we know
* what notify signals we will need to send.

View File

@ -462,7 +462,6 @@ gtk_builder_finalize (GObject *object)
g_free (priv->filename);
g_free (priv->resource_prefix);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (BUILDER_OBJECTS))
{
GHashTableIter iter;
@ -476,7 +475,6 @@ gtk_builder_finalize (GObject *object)
G_OBJECT_TYPE_NAME (value), (const char *)key);
}
}
#endif
g_hash_table_destroy (priv->objects);
if (priv->signals)
@ -988,14 +986,12 @@ _gtk_builder_construct (GtkBuilder *builder,
const GValue *value = object_properties_get_value (&parameters, i);
iface->set_buildable_property (buildable, builder, name, value);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (BUILDER))
{
char *str = g_strdup_value_contents (value);
g_message ("set %s: %s = %s", info->id, name, str);
g_free (str);
}
#endif
}
}
else
@ -1004,7 +1000,6 @@ _gtk_builder_construct (GtkBuilder *builder,
parameters.names->len,
(const char **) parameters.names->pdata,
(GValue *) parameters.values->data);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (BUILDER))
{
for (i = 0; i < parameters.names->len; i++)
@ -1016,7 +1011,6 @@ _gtk_builder_construct (GtkBuilder *builder,
g_free (str);
}
}
#endif
}
}
@ -1072,14 +1066,12 @@ _gtk_builder_apply_properties (GtkBuilder *builder,
const char *name = object_properties_get_name (&parameters, i);
const GValue *value = object_properties_get_value (&parameters, i);
iface->set_buildable_property (buildable, builder, name, value);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (BUILDER))
{
char *str = g_strdup_value_contents (value);
g_message ("set %s: %s = %s", info->id, name, str);
g_free (str);
}
#endif
}
}
else
@ -1088,7 +1080,6 @@ _gtk_builder_apply_properties (GtkBuilder *builder,
parameters.names->len,
(const char **) parameters.names->pdata,
(GValue *) parameters.values->data);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (BUILDER))
{
for (i = 0; i < parameters.names->len; i++)
@ -1100,7 +1091,6 @@ _gtk_builder_apply_properties (GtkBuilder *builder,
g_free (str);
}
}
#endif
}
}

View File

@ -1763,7 +1763,6 @@ start_element (GtkBuildableParseContext *context,
{
ParserData *data = (ParserData*)user_data;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (BUILDER))
{
GString *tags = g_string_new ("");
@ -1779,7 +1778,6 @@ start_element (GtkBuildableParseContext *context,
g_message ("<%s%s>", element_name, tags->str);
g_string_free (tags, TRUE);
}
#endif
if (!data->last_element && strcmp (element_name, "interface") != 0)
{

View File

@ -1099,7 +1099,6 @@ gtk_constraint_layout_allocate (GtkLayoutManager *manager,
child_baseline);
}
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (LAYOUT))
{
GHashTableIter iter;
@ -1121,7 +1120,6 @@ gtk_constraint_layout_allocate (GtkLayoutManager *manager,
gtk_constraint_variable_get_value (var_height));
}
}
#endif
/* The allocation stay constraints are not needed any more */
gtk_constraint_solver_remove_constraint (solver, stay_w);

View File

@ -728,23 +728,18 @@ gtk_constraint_solver_optimize (GtkConstraintSolver *self,
{
GtkConstraintVariable *entry = NULL, *exit = NULL;
GtkConstraintExpression *z_row = g_hash_table_lookup (self->rows, z);
#ifdef G_ENABLE_DEBUG
gint64 start_time = g_get_monotonic_time ();
#endif
g_assert (z_row != NULL);
self->optimize_count += 1;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (CONSTRAINTS))
{
char *str = gtk_constraint_variable_to_string (z);
g_message ("optimize: %s", str);
g_free (str);
}
#endif
while (TRUE)
{
@ -801,7 +796,6 @@ gtk_constraint_solver_optimize (GtkConstraintSolver *self,
break;
}
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (CONSTRAINTS))
{
char *entry_s = gtk_constraint_variable_to_string (entry);
@ -810,7 +804,6 @@ gtk_constraint_solver_optimize (GtkConstraintSolver *self,
g_free (entry_s);
g_free (exit_s);
}
#endif
gtk_constraint_solver_pivot (self, entry, exit);
}
@ -1004,9 +997,7 @@ static void
gtk_constraint_solver_dual_optimize (GtkConstraintSolver *self)
{
GtkConstraintExpression *z_row = g_hash_table_lookup (self->rows, self->objective);
#ifdef G_ENABLE_DEBUG
gint64 start_time = g_get_monotonic_time ();
#endif
/* We iterate until we don't have any more infeasible rows; the pivot()
* at the end of the loop iteration may add or remove infeasible rows
@ -1262,14 +1253,12 @@ gtk_constraint_solver_add_with_artificial_variable (GtkConstraintSolver *self,
gtk_constraint_solver_remove_column (self, av);
gtk_constraint_solver_remove_row (self, az, TRUE);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (CONSTRAINTS))
{
char *str = gtk_constraint_expression_to_string (expression);
g_message ("Unable to satisfy a required constraint (add): %s", str);
g_free (str);
}
#endif
return;
}
@ -1313,7 +1302,6 @@ gtk_constraint_solver_add_constraint_internal (GtkConstraintSolver *self,
&eminus,
&prev_constant);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (CONSTRAINTS))
{
char *expr_s = gtk_constraint_expression_to_string (expr);
@ -1322,7 +1310,6 @@ gtk_constraint_solver_add_constraint_internal (GtkConstraintSolver *self,
g_free (ref_s);
g_free (expr_s);
}
#endif
if (constraint->is_stay)
{
@ -1494,9 +1481,7 @@ gtk_constraint_solver_create_variable (GtkConstraintSolver *self,
void
gtk_constraint_solver_resolve (GtkConstraintSolver *solver)
{
#ifdef G_ENABLE_DEBUG
gint64 start_time = g_get_monotonic_time ();
#endif
g_return_if_fail (GTK_IS_CONSTRAINT_SOLVER (solver));
@ -1626,14 +1611,12 @@ gtk_constraint_solver_add_stay_variable (GtkConstraintSolver *self,
NULL,
self);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (CONSTRAINTS))
{
char *str = gtk_constraint_expression_to_string (res->expression);
g_message ("Adding stay variable: %s", str);
g_free (str);
}
#endif
gtk_constraint_solver_add_constraint_internal (self, res);

View File

@ -86,10 +86,8 @@ may_be_stored_in_cache (GtkCssStyle *style)
*
* We achieve that by disallowing any inserts into caches here.
*/
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (NO_CSS_CACHE))
return FALSE;
#endif
if (!GTK_IS_CSS_STATIC_STYLE (style))
return FALSE;

View File

@ -82,16 +82,8 @@ typedef enum {
GTK_DEBUG_INVERT_TEXT_DIR = 1 << 19,
} GtkDebugFlags;
#ifdef G_ENABLE_DEBUG
#define GTK_DEBUG_CHECK(type) G_UNLIKELY (gtk_get_debug_flags () & GTK_DEBUG_##type)
#else /* !G_ENABLE_DEBUG */
#define GTK_DEBUG_CHECK(type) 0
#endif /* G_ENABLE_DEBUG */
GDK_AVAILABLE_IN_ALL
GtkDebugFlags gtk_get_debug_flags (void);
GDK_AVAILABLE_IN_ALL

View File

@ -108,7 +108,6 @@ gtk_icon_cache_new_for_path (const char *path)
if (!map)
goto done;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (ICONTHEME))
{
CacheInfo info;
@ -126,7 +125,6 @@ gtk_icon_cache_new_for_path (const char *path)
goto done;
}
}
#endif
GTK_DEBUG (ICONTHEME, "found icon cache for %s", path);

View File

@ -20,8 +20,6 @@
#include <glib.h>
#include <gdk-pixbuf/gdk-pixdata.h>
#if defined(G_ENABLE_DEBUG) || defined(BUILD_TOOLS)
#define VERBOSE(x)
#define check(name,condition) \
@ -401,5 +399,3 @@ gtk_icon_cache_validate (CacheInfo *info)
return TRUE;
}
#endif

View File

@ -130,7 +130,6 @@ struct _GtkStringSet {
int used_in_chunk;
};
#ifdef G_ENABLE_DEBUG
static void
dump_string_set (GtkStringSet *set)
{
@ -153,7 +152,6 @@ dump_string_set (GtkStringSet *set)
g_print ("%s\n", string);
}
}
#endif
static void
gtk_string_set_init (GtkStringSet *set)
@ -2019,7 +2017,6 @@ load_themes (GtkIconTheme *self)
self->last_stat_time = g_get_monotonic_time ();
#ifdef G_ENABLE_DEBUG
if (GTK_DISPLAY_DEBUG_CHECK (self->display, ICONTHEME))
{
GList *l;
@ -2036,7 +2033,6 @@ load_themes (GtkIconTheme *self)
dump_string_set (&self->icons);
}
#endif
}
static gboolean
@ -2155,13 +2151,11 @@ real_choose_icon (GtkIconTheme *self,
key.flags = flags;
/* This is used in the icontheme unit test */
#ifdef G_ENABLE_DEBUG
if (GTK_DISPLAY_DEBUG_CHECK (self->display, ICONTHEME))
{
for (i = 0; icon_names[i]; i++)
gdk_debug_message ("\tlookup name: %s", icon_names[i]);
}
#endif
icon = icon_cache_lookup (self, &key);
if (icon)
@ -2266,14 +2260,12 @@ real_choose_icon (GtkIconTheme *self,
/* Fall back to missing icon */
if (icon == NULL)
{
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (ICONFALLBACK))
{
char *s = g_strjoinv (", ", (char **)icon_names);
gdk_debug_message ("No icon found in %s (or fallbacks) for: %s", self->current_theme, s);
g_free (s);
}
#endif
icon = icon_paintable_new ("image-missing", size, scale);
icon->filename = g_strdup (IMAGE_MISSING_RESOURCE_PATH);
icon->is_resource = TRUE;

View File

@ -562,14 +562,12 @@ _gtk_menu_tracker_item_new (GtkActionObservable *observable,
action_name = strrchr (self->action_and_target, '|') + 1;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (ACTIONS))
{
if (!strchr (action_name, '.'))
gdk_debug_message ("menutracker: action name %s doesn't look like 'app.' or 'win.'; "
"it is unlikely to work", action_name);
}
#endif
state = NULL;

View File

@ -132,8 +132,6 @@ gboolean gtk_get_any_display_debug_flag_set (void);
GBytes *get_emoji_data (void);
#ifdef G_ENABLE_DEBUG
#define GTK_DISPLAY_DEBUG_CHECK(display,type) \
(gtk_get_any_display_debug_flag_set () && \
G_UNLIKELY (gtk_get_display_debug_flags (display) & GTK_DEBUG_##type))
@ -150,14 +148,6 @@ GBytes *get_emoji_data (void);
gdk_debug_message (__VA_ARGS__); \
} G_STMT_END
#else
#define GTK_DISPLAY_DEBUG_CHECK(display,type) 0
#define GTK_DISPLAY_DEBUG(display,type,...)
#define GTK_DEBUG(type,...)
#endif /* G_ENABLE_DEBUG */
char * _gtk_elide_underscores (const char *original);
void setlocale_initialization (void);

View File

@ -161,14 +161,12 @@ gtk_shortcut_action_activate (GtkShortcutAction *self,
g_return_val_if_fail (GTK_IS_SHORTCUT_ACTION (self), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (KEYBINDINGS))
{
char *act = gtk_shortcut_action_to_string (self);
gdk_debug_message ("Shortcut action activate on %s: %s", G_OBJECT_TYPE_NAME (widget), act);
g_free (act);
}
#endif
return GTK_SHORTCUT_ACTION_GET_CLASS (self)->activate (self, flags, widget, args);
}

View File

@ -407,7 +407,6 @@ gtk_shortcut_controller_run_controllers (GtkEventController *controller,
data->widget = widget;
}
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (KEYBINDINGS))
{
g_message ("Found %u shortcuts triggered %s by %s %u %u",
@ -417,7 +416,6 @@ gtk_shortcut_controller_run_controllers (GtkEventController *controller,
gdk_key_event_get_keyval (event),
gdk_event_get_modifier_state (event));
}
#endif
if (!shortcuts)
return retval;

View File

@ -426,7 +426,6 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
g_assert (min_size <= nat_size);
#ifdef G_ENABLE_DEBUG
if (GTK_DISPLAY_DEBUG_CHECK (_gtk_widget_get_display (widget), SIZE_REQUEST))
{
GString *s;
@ -448,7 +447,6 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
g_printerr ("%s", s->str);
g_string_free (s, TRUE);
}
#endif
}
/**

View File

@ -741,10 +741,8 @@ _gtk_text_btree_delete (GtkTextIter *start,
tree = _gtk_text_iter_get_btree (start);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
/* Broadcast the need for redisplay before we break the iterators */
DV (g_print ("invalidating due to deleting some text (%s)\n", G_STRLOC));
@ -1065,10 +1063,8 @@ _gtk_text_btree_delete (GtkTextIter *start,
chars_changed (tree);
segments_changed (tree);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
/* Re-initialize our iterators */
_gtk_text_btree_get_iter_at_line (tree, start, start_line, start_byte_offset);
@ -1350,10 +1346,8 @@ find_line_by_y (GtkTextBTree *tree, BTreeView *view,
{
int current_y = 0;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
if (node->level == 0)
{
@ -2002,10 +1996,8 @@ _gtk_text_btree_tag (const GtkTextIter *start_orig,
queue_tag_redisplay (tree, tag, &start, &end);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
}
@ -2742,10 +2734,8 @@ real_set_mark (GtkTextBTree *tree,
iter = *where;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_iter_check (&iter);
#endif
if (mark != NULL)
{
@ -2801,10 +2791,8 @@ real_set_mark (GtkTextBTree *tree,
mark);
}
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_iter_check (&iter);
#endif
/* Link mark into new location */
gtk_text_btree_link_segment (mark, &iter);
@ -2818,13 +2806,11 @@ real_set_mark (GtkTextBTree *tree,
redisplay_mark_if_visible (mark);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
{
_gtk_text_iter_check (&iter);
_gtk_text_btree_check (tree);
}
#endif
return mark;
}
@ -4338,10 +4324,8 @@ _gtk_text_line_next_could_contain_tag (GtkTextLine *line,
g_return_val_if_fail (line != NULL, NULL);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
if (tag == NULL)
{
@ -4503,10 +4487,8 @@ _gtk_text_line_previous_could_contain_tag (GtkTextLine *line,
g_return_val_if_fail (line != NULL, NULL);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
if (tag == NULL)
{
@ -5288,10 +5270,8 @@ _gtk_text_btree_validate (GtkTextBTree *tree,
if (new_height)
*new_height = state.new_height;
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
return TRUE;
}
@ -5985,10 +5965,8 @@ post_insert_fixup (GtkTextBTree *tree,
gtk_text_btree_rebalance (tree, node);
}
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
}
static GtkTextTagInfo*
@ -6517,10 +6495,8 @@ gtk_text_btree_link_segment (GtkTextLineSegment *seg,
cleanup_line (line);
segments_changed (tree);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_btree_check (tree);
#endif
}
static void
@ -6614,7 +6590,6 @@ _gtk_toggle_segment_check_func (GtkTextLineSegment *segPtr,
/*
* Debug
*/
#ifdef G_ENABLE_DEBUG
static void
gtk_text_btree_node_view_check_consistency (GtkTextBTree *tree,
GtkTextBTreeNode *node,
@ -7061,7 +7036,6 @@ _gtk_text_btree_check (GtkTextBTree *tree)
seg->body.chars);
}
}
#endif /* G_ENABLE_DEBUG */
void _gtk_text_btree_spew_line (GtkTextBTree* tree, GtkTextLine* line);
void _gtk_text_btree_spew_segment (GtkTextBTree* tree, GtkTextLineSegment* seg);

View File

@ -368,16 +368,12 @@ is_segment_start (GtkTextRealIter *real)
return real->segment_byte_offset == 0 || real->segment_char_offset == 0;
}
#ifdef G_ENABLE_DEBUG
static void
check_invariants (const GtkTextIter *iter)
{
if (GTK_DEBUG_CHECK (TEXT))
_gtk_text_iter_check (iter);
}
#else
#define check_invariants(x)
#endif
/**
* gtk_text_iter_get_buffer:

View File

@ -4101,14 +4101,12 @@ gtk_widget_allocate (GtkWidget *widget,
}
/* Size allocation is god... after consulting god, no further requests or allocations are needed */
#ifdef G_ENABLE_DEBUG
if (GTK_DISPLAY_DEBUG_CHECK (_gtk_widget_get_display (widget), GEOMETRY) &&
gtk_widget_get_resize_needed (widget))
{
g_warning ("%s %p or a child called gtk_widget_queue_resize() during size_allocate().",
gtk_widget_get_name (widget), widget);
}
#endif
gtk_widget_ensure_resize (widget);
priv->alloc_needed = FALSE;
@ -4580,7 +4578,6 @@ gtk_widget_run_controllers (GtkWidget *widget,
is_gesture = GTK_IS_GESTURE (controller);
this_handled = gtk_event_controller_handle_event (controller, event, target, x, y);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (KEYBINDINGS))
{
GdkEventType type = gdk_event_get_event_type (event);
@ -4594,7 +4591,6 @@ gtk_widget_run_controllers (GtkWidget *widget,
gtk_event_controller_get_name (controller));
}
}
#endif
handled |= this_handled;

View File

@ -523,11 +523,8 @@ gtk_print_job_get_surface (GtkPrintJob *job,
fchmod (fd, S_IRUSR | S_IWUSR);
#ifdef G_ENABLE_DEBUG
/* If we are debugging printing don't delete the tmp files */
if (GTK_DEBUG_CHECK (PRINTING)) ;
else
#endif /* G_ENABLE_DEBUG */
if (!GTK_DEBUG_CHECK (PRINTING))
g_unlink (filename);
g_free (filename);

View File

@ -4144,13 +4144,9 @@ cups_request_ppd (GtkPrinter *printer)
&ppd_filename,
&error);
#ifdef G_ENABLE_DEBUG
/* If we are debugging printing don't delete the tmp files */
if (!(gtk_get_debug_flags () & GTK_DEBUG_PRINTING))
if (!GTK_DEBUG_CHECK (PRINTING))
unlink (ppd_filename);
#else
unlink (ppd_filename);
#endif /* G_ENABLE_DEBUG */
if (error != NULL)
{