JR
Federico Mena Quintero wrote:
On Mon, 2005-10-17 at 17:37 +0100, John Rice wrote:
So what is the best way to help the maintainers fix this throughout
the stack?
grep is a good start ;)
Kjartan Maraas was going through several of the core modules to look for
places where g_return*() is used inside static functions. We need more
people who will do the grunt work of finding those places.
On an unrelated note, do you have any dtrace tidbits to share with us?
Got some nice global profiles of the desktop, perhaps? :)
Federico
_______________________________________________
Performance-list mailing list
Performance-list gnome org
http://mail.gnome.org/mailman/listinfo/performance-list
? vte-0.11.14.tar.gz
? vte-0.11.15.tar.gz
? warningfixes.patch
? warnings
? doc/reference/vte-overrides.txt
? doc/reference/tmpl/internals.sgml
? gnome-pty-helper/.in
? src/vteapp
Index: src/ring.c
===================================================================
RCS file: /cvs/gnome/vte/src/ring.c,v
retrieving revision 1.19
diff -u -p -r1.19 ring.c
--- src/ring.c 24 Apr 2003 02:50:54 -0000 1.19
+++ src/ring.c 30 Oct 2005 13:19:25 -0000
@@ -29,7 +29,7 @@ static void
_vte_ring_validate(VteRing * ring)
{
long i, max;
- g_return_if_fail(ring != NULL);
+ g_assert(ring != NULL);
g_assert(ring->length <= ring->max);
max = ring->delta + ring->length;
for (i = ring->delta; i < max; i++) {
Index: src/vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.425
diff -u -p -r1.425 vte.c
--- src/vte.c 10 Aug 2005 13:29:12 -0000 1.425
+++ src/vte.c 30 Oct 2005 13:19:26 -0000
@@ -575,7 +575,7 @@ vte_unichar_strlen(gunichar *c)
static void
vte_terminal_set_default_attributes(VteTerminal *terminal)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
terminal->pvt->screen->defaults.c = ' ';
terminal->pvt->screen->defaults.columns = 1;
terminal->pvt->screen->defaults.fragment = 0;
@@ -606,7 +606,7 @@ vte_invalidate_cells(VteTerminal *termin
GdkRectangle rect;
GtkWidget *widget;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
widget = GTK_WIDGET(terminal);
if (!GTK_WIDGET_REALIZED(widget)) {
return;
@@ -662,7 +662,7 @@ vte_invalidate_all(VteTerminal *terminal
GtkWidget *widget;
int width, height;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (!GTK_IS_WIDGET(terminal)) {
return;
}
@@ -716,7 +716,7 @@ vte_terminal_find_charcell(VteTerminal *
VteRowData *rowdata;
struct vte_charcell *ret = NULL;
VteScreen *screen;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+ g_assert(VTE_IS_TERMINAL(terminal));
screen = terminal->pvt->screen;
if (_vte_ring_contains(screen->row_data, row)) {
rowdata = _vte_ring_index(screen->row_data, VteRowData *, row);
@@ -739,7 +739,7 @@ vte_terminal_preedit_width(VteTerminal *
gssize ret = 0;
const char *preedit = NULL;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), 0);
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->im_preedit != NULL) {
preedit = terminal->pvt->im_preedit;
@@ -766,7 +766,7 @@ vte_terminal_preedit_length(VteTerminal
int i = 0;
const char *preedit = NULL;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), 0);
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->im_preedit != NULL) {
preedit = terminal->pvt->im_preedit;
@@ -866,7 +866,7 @@ vte_invalidate_cursor_periodic(gpointer
GtkSettings *settings;
gint blink_cycle = 1000;
- g_return_val_if_fail(VTE_IS_TERMINAL(data), FALSE);
+ g_assert(VTE_IS_TERMINAL(data));
widget = GTK_WIDGET(data);
if (!GTK_WIDGET_REALIZED(widget)) {
return TRUE;
@@ -1253,7 +1253,7 @@ vte_terminal_emit_text_scrolled(VteTermi
static void
vte_terminal_deselect_all(VteTerminal *terminal)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->has_selection) {
terminal->pvt->has_selection = FALSE;
#ifdef VTE_DEBUG
@@ -1270,7 +1270,7 @@ vte_terminal_deselect_all(VteTerminal *t
static void
vte_terminal_set_tabstop(VteTerminal *terminal, int column)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->tabstops != NULL) {
/* Just set a non-NULL pointer for this column number. */
g_hash_table_insert(terminal->pvt->tabstops,
@@ -1283,7 +1283,7 @@ vte_terminal_set_tabstop(VteTerminal *te
static void
vte_terminal_clear_tabstop(VteTerminal *terminal, int column)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->tabstops != NULL) {
/* Remove a tab stop from the hash table. */
g_hash_table_remove(terminal->pvt->tabstops,
@@ -1296,7 +1296,7 @@ static gboolean
vte_terminal_get_tabstop(VteTerminal *terminal, int column)
{
gpointer hash;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+ g_assert(VTE_IS_TERMINAL(terminal), FALSE);
if (terminal->pvt->tabstops != NULL) {
hash = g_hash_table_lookup(terminal->pvt->tabstops,
GINT_TO_POINTER(2 * column + 1));
@@ -1311,7 +1311,7 @@ static void
vte_terminal_set_default_tabstops(VteTerminal *terminal)
{
int i, width;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->tabstops != NULL) {
g_hash_table_destroy(terminal->pvt->tabstops);
}
@@ -1332,7 +1332,7 @@ vte_terminal_set_default_tabstops(VteTer
static void
vte_terminal_match_contents_clear(VteTerminal *terminal)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->match_contents != NULL) {
g_free(terminal->pvt->match_contents);
terminal->pvt->match_contents = NULL;;
@@ -1354,7 +1354,7 @@ static void
vte_terminal_match_contents_refresh(VteTerminal *terminal)
{
GArray *array;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
vte_terminal_match_contents_clear(terminal);
array = g_array_new(FALSE, TRUE, sizeof(struct _VteCharAttributes));
terminal->pvt->match_contents = vte_terminal_get_text(terminal,
@@ -1440,14 +1440,14 @@ vte_terminal_cursor_new(VteTerminal *ter
GdkDisplay *display;
GdkCursor *cursor;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+ g_assert(VTE_IS_TERMINAL(terminal));
display = gtk_widget_get_display(GTK_WIDGET(terminal));
cursor = gdk_cursor_new_for_display(display, cursor_type);
#else
GdkCursor *cursor;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+ g_assert(VTE_IS_TERMINAL(terminal));
cursor = gdk_cursor_new(cursor_type);
#endif
@@ -1586,7 +1586,7 @@ vte_terminal_match_check_internal(VteTer
if (end != NULL) {
*end = 0;
}
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->match_contents == NULL) {
vte_terminal_match_contents_refresh(terminal);
}
@@ -1818,8 +1818,8 @@ vte_terminal_adjust_adjustments(VteTermi
long delta;
long rows;
- g_return_if_fail(terminal->pvt->screen != NULL);
- g_return_if_fail(terminal->pvt->screen->row_data != NULL);
+ g_assert(terminal->pvt->screen != NULL);
+ g_assert(terminal->pvt->screen->row_data != NULL);
/* Adjust the vertical, uh, adjustment. */
changed = FALSE;
@@ -1966,7 +1966,7 @@ static void
vte_terminal_scroll_pages(VteTerminal *terminal, gint pages)
{
glong destination;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_IO)) {
fprintf(stderr, "Scrolling %d pages.\n", pages);
@@ -1992,7 +1992,7 @@ static void
vte_terminal_maybe_scroll_to_top(VteTerminal *terminal)
{
long delta;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (floor(gtk_adjustment_get_value(terminal->adjustment)) !=
_vte_ring_delta(terminal->pvt->screen->row_data)) {
delta = _vte_ring_delta(terminal->pvt->screen->row_data);
@@ -2004,7 +2004,7 @@ static void
vte_terminal_maybe_scroll_to_bottom(VteTerminal *terminal)
{
glong delta;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if ((terminal->pvt->screen->scroll_delta !=
terminal->pvt->screen->insert_delta)) {
delta = terminal->pvt->screen->insert_delta;
@@ -2298,7 +2298,7 @@ vte_terminal_beep(VteTerminal *terminal)
#if GTK_CHECK_VERSION(2,2,0)
GdkDisplay *display;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
display = gtk_widget_get_display(GTK_WIDGET(terminal));
gdk_display_beep(display);
#else
@@ -6442,9 +6442,9 @@ vte_terminal_set_color_internal(VteTermi
{
GtkWidget *widget;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
- g_return_if_fail(entry >= 0);
- g_return_if_fail(entry < G_N_ELEMENTS(terminal->pvt->palette));
+ g_assert(VTE_IS_TERMINAL(terminal));
+ g_assert(entry >= 0);
+ g_assert(entry < G_N_ELEMENTS(terminal->pvt->palette));
/* Save the requested color. */
terminal->pvt->palette[entry].red = proposed->red;
@@ -6471,9 +6471,9 @@ vte_terminal_generate_bold(const struct
GdkColor *bold)
{
double fy, fcb, fcr, by, bcb, bcr, r, g, b;
- g_return_if_fail(foreground != NULL);
- g_return_if_fail(background != NULL);
- g_return_if_fail(bold != NULL);
+ g_assert(foreground != NULL);
+ g_assert(background != NULL);
+ g_assert(bold != NULL);
fy = 0.2990 * foreground->red +
0.5870 * foreground->green +
0.1140 * foreground->blue;
@@ -7065,8 +7065,8 @@ vte_terminal_handle_sequence(GtkWidget *
struct vte_cursor_position position;
gboolean ret;
- g_return_val_if_fail(widget != NULL, FALSE);
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
screen = terminal->pvt->screen;
@@ -7109,7 +7109,7 @@ vte_terminal_catch_child_exited(VteReape
VteTerminal *data)
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(data));
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
if (pid == terminal->pvt->pty_pid) {
/* Disconnect from the reaper. */
@@ -7398,7 +7398,7 @@ vte_terminal_eof(GIOChannel *channel, gp
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(data));
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
/* Close the connections to the child -- note that the source channel
@@ -7436,7 +7436,7 @@ vte_terminal_eof(GIOChannel *channel, gp
static void
vte_terminal_im_reset(VteTerminal *terminal)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (GTK_WIDGET_REALIZED(GTK_WIDGET(terminal))) {
gtk_im_context_reset(terminal->pvt->im_context);
if (terminal->pvt->im_preedit != NULL) {
@@ -7532,8 +7532,8 @@ vte_terminal_process_incoming(VteTermina
gboolean leftovers, modified, bottom, inserted, again;
GArray *unichars;
- g_return_val_if_fail(GTK_IS_WIDGET(terminal), FALSE);
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+ g_assert(GTK_IS_WIDGET(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
widget = GTK_WIDGET(terminal);
bottom = (terminal->pvt->screen->insert_delta ==
@@ -7854,7 +7854,7 @@ vte_terminal_io_read(GIOChannel *channel
int bcount, fd;
gboolean eof, leave_open = TRUE;
- g_return_val_if_fail(VTE_IS_TERMINAL(data), TRUE);
+ g_assert(VTE_IS_TERMINAL(data));
widget = GTK_WIDGET(data);
terminal = VTE_TERMINAL(data);
@@ -7962,7 +7962,7 @@ vte_terminal_io_write(GIOChannel *channe
int fd;
gboolean leave_open;
- g_return_val_if_fail(VTE_IS_TERMINAL(data), FALSE);
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
fd = g_io_channel_unix_get_fd(channel);
@@ -8007,7 +8007,7 @@ vte_terminal_send(VteTerminal *terminal,
VteConv *conv;
long crcount, cooked_length, i;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
g_assert(strcmp(encoding, "UTF-8") == 0);
conv = NULL;
@@ -8143,7 +8143,7 @@ static void
vte_terminal_feed_child_using_modes(VteTerminal *terminal,
const char *data, glong length)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (length == ((gssize)-1)) {
length = strlen(data);
}
@@ -8160,8 +8160,8 @@ vte_terminal_im_commit(GtkIMContext *im_
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(data));
- g_return_if_fail(GTK_IS_IM_CONTEXT(im_context));
+ g_assert(VTE_IS_TERMINAL(data));
+ g_assert(GTK_IS_IM_CONTEXT(im_context));
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_EVENTS)) {
fprintf(stderr, "Input method committed `%s'.\n", text);
@@ -8182,9 +8182,9 @@ vte_terminal_im_preedit_start(GtkIMConte
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(data));
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
- g_return_if_fail(GTK_IS_IM_CONTEXT(im_context));
+ g_assert(GTK_IS_IM_CONTEXT(im_context));
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_EVENTS)) {
@@ -8200,9 +8200,9 @@ vte_terminal_im_preedit_end(GtkIMContext
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(data));
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
- g_return_if_fail(GTK_IS_IM_CONTEXT(im_context));
+ g_assert(GTK_IS_IM_CONTEXT(im_context));
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_EVENTS)) {
@@ -8221,9 +8221,9 @@ vte_terminal_im_preedit_changed(GtkIMCon
VteTerminal *terminal;
gint cursor;
- g_return_if_fail(VTE_IS_TERMINAL(data));
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
- g_return_if_fail(GTK_IS_IM_CONTEXT(im_context));
+ g_assert(GTK_IS_IM_CONTEXT(im_context));
gtk_im_context_get_preedit_string(im_context, &str, &attrs, &cursor);
#ifdef VTE_DEBUG
@@ -8264,9 +8264,9 @@ vte_terminal_configure_toplevel(GtkWidge
fprintf(stderr, "Top level parent configured.\n");
}
#endif
- g_return_val_if_fail(GTK_IS_WIDGET(widget), FALSE);
- g_return_val_if_fail(GTK_WIDGET_TOPLEVEL(widget), FALSE);
- g_return_val_if_fail(VTE_IS_TERMINAL(data), FALSE);
+ g_assert(GTK_IS_WIDGET(widget));
+ g_assert(GTK_WIDGET_TOPLEVEL(widget));
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
if (terminal->pvt->bg_transparent) {
@@ -8293,7 +8293,7 @@ vte_terminal_hierarchy_changed(GtkWidget
}
#endif
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
if (GTK_IS_WIDGET(old_toplevel)) {
@@ -8315,7 +8315,7 @@ static void
vte_terminal_style_changed(GtkWidget *widget, GtkStyle *style, gpointer data)
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(VTE_IS_TERMINAL(widget));
if (!GTK_WIDGET_REALIZED(widget)) {
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_MISC)) {
@@ -8359,8 +8359,8 @@ vte_terminal_key_press(GtkWidget *widget
GdkModifierType modifiers;
GtkWidgetClass *widget_class;
- g_return_val_if_fail(widget != NULL, TRUE);
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), TRUE);
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
/* First, check if GtkWidget's behavior already does something with
@@ -8773,7 +8773,7 @@ vte_uniform_class(VteTerminal *terminal,
struct vte_charcell *pcell = NULL;
long col;
gboolean word_char;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+ g_assert(VTE_IS_TERMINAL(terminal));
if ((pcell = vte_terminal_find_charcell(terminal, scol, row)) != NULL) {
word_char = vte_terminal_is_word_char(terminal, pcell->c);
for (col = scol + 1; col <= ecol; col++) {
@@ -8797,7 +8797,7 @@ vte_line_is_wrappable(VteTerminal *termi
{
VteRowData *rowdata;
VteScreen *screen;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+ g_assert(VTE_IS_TERMINAL(terminal));
screen = terminal->pvt->screen;
if (_vte_ring_contains(screen->row_data, row)) {
rowdata = _vte_ring_index(screen->row_data, VteRowData *, row);
@@ -8899,7 +8899,7 @@ vte_terminal_paste_cb(GtkClipboard *clip
VteTerminal *terminal;
gchar *paste, *p;
long length;
- g_return_if_fail(VTE_IS_TERMINAL(data));
+ g_assert(VTE_IS_TERMINAL(data));
terminal = VTE_TERMINAL(data);
if (text != NULL) {
#ifdef VTE_DEBUG
@@ -8939,7 +8939,7 @@ vte_terminal_send_mouse_button_internal(
unsigned char cb = 0, cx = 0, cy = 0;
char buf[LINE_MAX];
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
/* Encode the button information in cb. */
switch (button) {
@@ -9037,7 +9037,7 @@ vte_terminal_maybe_send_mouse_drag(VteTe
unsigned char cb = 0, cx = 0, cy = 0;
char buf[LINE_MAX];
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
/* First determine if we even want to send notification. */
switch (event->type) {
@@ -9221,7 +9221,7 @@ static void
vte_terminal_clear_cb(GtkClipboard *clipboard, gpointer owner)
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(owner));
+ g_assert(VTE_IS_TERMINAL(owner));
terminal = VTE_TERMINAL(owner);
if (terminal->pvt->has_selection) {
#ifdef VTE_DEBUG
@@ -9239,7 +9239,7 @@ vte_terminal_copy_cb(GtkClipboard *clipb
guint info, gpointer owner)
{
VteTerminal *terminal;
- g_return_if_fail(VTE_IS_TERMINAL(owner));
+ g_assert(VTE_IS_TERMINAL(owner));
terminal = VTE_TERMINAL(owner);
if (terminal->pvt->selection != NULL) {
#ifdef VTE_DEBUG
@@ -9321,8 +9321,8 @@ vte_terminal_get_text_range_maybe_wrappe
struct _VteCharAttributes attr;
struct vte_palette_entry fore, back, *palette;
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
- g_return_val_if_fail(is_selected != NULL, NULL);
+ g_assert(VTE_IS_TERMINAL(terminal));
+ g_assert(is_selected != NULL);
screen = terminal->pvt->screen;
string = g_string_new("");
@@ -9623,7 +9623,7 @@ vte_terminal_copy(VteTerminal *terminal,
{"STRING", 0, 0},
};
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
clipboard = vte_terminal_clipboard_get(terminal, board);
/* Chuck old selected text and retrieve the newly-selected text. */
@@ -9661,7 +9661,7 @@ static void
vte_terminal_paste(VteTerminal *terminal, GdkAtom board)
{
GtkClipboard *clipboard;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
clipboard = vte_terminal_clipboard_get(terminal, board);
if (clipboard != NULL) {
#ifdef VTE_DEBUG
@@ -10210,7 +10210,7 @@ vte_terminal_motion_notify(GtkWidget *wi
GdkModifierType modifiers;
gboolean event_mode;
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
event_mode = terminal->pvt->mouse_send_xy_on_click ||
@@ -10306,7 +10306,7 @@ vte_terminal_button_press(GtkWidget *wid
gboolean start_selecting = FALSE, extend_selecting = FALSE;
long cellx, celly;
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
height = terminal->char_height;
width = terminal->char_width;
@@ -10491,7 +10491,7 @@ vte_terminal_button_release(GtkWidget *w
gboolean handled = FALSE;
gboolean event_mode;
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
vte_terminal_set_pointer_visible(terminal, TRUE);
@@ -10575,8 +10575,8 @@ vte_terminal_focus_in(GtkWidget *widget,
{
VteTerminal *terminal;
GdkModifierType modifiers;
- g_return_val_if_fail(GTK_IS_WIDGET(widget), FALSE);
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(GTK_IS_WIDGET(widget));
+ g_assert(VTE_IS_TERMINAL(widget));
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_EVENTS)) {
fprintf(stderr, "Focus in.\n");
@@ -10606,8 +10606,8 @@ vte_terminal_focus_out(GtkWidget *widget
{
VteTerminal *terminal;
GdkModifierType modifiers;
- g_return_val_if_fail(GTK_WIDGET(widget), FALSE);
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(GTK_WIDGET(widget));
+ g_assert(VTE_IS_TERMINAL(widget));
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_EVENTS)) {
fprintf(stderr, "Focus out.\n");
@@ -10632,8 +10632,8 @@ static gint
vte_terminal_visibility_notify(GtkWidget *widget, GdkEventVisibility *event)
{
VteTerminal *terminal;
- g_return_val_if_fail(GTK_WIDGET(widget), FALSE);
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(GTK_WIDGET(widget));
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
terminal->pvt->visibility_state = event->state;
if (terminal->pvt->visibility_state == GDK_VISIBILITY_UNOBSCURED)
@@ -10848,7 +10848,7 @@ static void
vte_terminal_refresh_size(VteTerminal *terminal)
{
int rows, columns;
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (terminal->pvt->pty_master != -1) {
/* Use an ioctl to read the size of the terminal. */
if (_vte_pty_get_size(terminal->pvt->pty_master, &columns, &rows) != 0) {
@@ -10910,7 +10910,7 @@ vte_terminal_handle_scroll(VteTerminal *
VteScreen *screen;
/* Sanity checks. */
- g_return_if_fail(GTK_IS_WIDGET(terminal));
+ g_assert(GTK_IS_WIDGET(terminal));
widget = GTK_WIDGET(terminal);
screen = terminal->pvt->screen;
if (GTK_WIDGET_REALIZED(widget) == FALSE) {
@@ -10951,7 +10951,7 @@ static void
vte_terminal_set_scroll_adjustment(VteTerminal *terminal,
GtkAdjustment *adjustment)
{
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
if (adjustment != NULL) {
/* Add a reference to the new adjustment object. */
g_object_ref(adjustment);
@@ -11246,7 +11246,7 @@ vte_terminal_disconnect_xft_settings(Vte
static void
_vte_terminal_codeset_changed_cb(struct _vte_iso2022_state *state, gpointer p)
{
- g_return_if_fail(VTE_IS_TERMINAL(p));
+ g_assert(VTE_IS_TERMINAL(p));
vte_terminal_set_encoding(VTE_TERMINAL(p),
_vte_iso2022_state_get_codeset(state));
}
@@ -11270,7 +11270,7 @@ vte_terminal_init(VteTerminal *terminal,
}
#endif
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL(terminal));
widget = GTK_WIDGET(terminal);
GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);
@@ -11546,8 +11546,8 @@ vte_terminal_size_request(GtkWidget *wid
}
#endif
- g_return_if_fail(widget != NULL);
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
if (terminal->pvt->pty_master != -1) {
@@ -11589,8 +11589,8 @@ vte_terminal_size_allocate(GtkWidget *wi
}
#endif
- g_return_if_fail(widget != NULL);
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
@@ -11677,8 +11677,8 @@ vte_terminal_show(GtkWidget *widget)
}
#endif
- g_return_if_fail(widget != NULL);
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
widget_class = g_type_class_peek(GTK_TYPE_WIDGET);
@@ -11712,8 +11712,8 @@ vte_terminal_unrealize(GtkWidget *widget
}
#endif
- g_return_if_fail(widget != NULL);
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
/* Clean up our draw structure. */
@@ -11810,7 +11810,7 @@ vte_terminal_finalize(GObject *object)
}
#endif
- g_return_if_fail(VTE_IS_TERMINAL(object));
+ g_assert(VTE_IS_TERMINAL(object));
terminal = VTE_TERMINAL(object);
object_class = G_OBJECT_GET_CLASS(G_OBJECT(object));
widget_class = g_type_class_peek(GTK_TYPE_WIDGET);
@@ -12053,8 +12053,8 @@ vte_terminal_realize(GtkWidget *widget)
}
#endif
- g_return_if_fail(widget != NULL);
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
/* Create the draw structure if we don't already have one. */
@@ -13222,7 +13222,7 @@ vte_terminal_draw_cells(VteTerminal *ter
GdkColor color = {0,};
struct vte_palette_entry *fg, *bg, *defbg;
- g_return_if_fail(n > 0);
+ g_assert(n > 0);
x = items[0].x;
y = items[0].y;
@@ -13799,9 +13799,9 @@ vte_terminal_paint(GtkWidget *widget, Gd
#endif
/* Make a few sanity checks. */
- g_return_if_fail(widget != NULL);
- g_return_if_fail(VTE_IS_TERMINAL(widget));
- g_return_if_fail(area != NULL);
+ g_assert(widget != NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
+ g_assert(area != NULL);
terminal = VTE_TERMINAL(widget);
/* Get going. */
@@ -14070,7 +14070,7 @@ vte_terminal_paint(GtkWidget *widget, Gd
static gint
vte_terminal_expose(GtkWidget *widget, GdkEventExpose *event)
{
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), 0);
+ g_assert(VTE_IS_TERMINAL(widget));
if (event->window == widget->window) {
if (GTK_WIDGET_REALIZED(widget) &&
GTK_WIDGET_VISIBLE(widget) &&
@@ -14093,7 +14093,7 @@ vte_terminal_scroll(GtkWidget *widget, G
GdkModifierType modifiers;
int button;
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
/* Read the modifiers. */
@@ -14182,7 +14182,7 @@ vte_terminal_get_accessible(GtkWidget *w
VteTerminal *terminal;
static gboolean first_time = TRUE;
- g_return_val_if_fail(VTE_IS_TERMINAL(widget), NULL);
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
if (first_time) {
@@ -14877,7 +14877,7 @@ vte_terminal_background_update(gpointer
GdkColor bgcolor;
double saturation;
- g_return_val_if_fail(VTE_IS_TERMINAL(data), TRUE);
+ g_assert(VTE_IS_TERMINAL(data));
widget = GTK_WIDGET(data);
terminal = VTE_TERMINAL(data);
Index: src/vteaccess.c
===================================================================
RCS file: /cvs/gnome/vte/src/vteaccess.c,v
retrieving revision 1.45
diff -u -p -r1.45 vteaccess.c
--- src/vteaccess.c 10 Aug 2005 13:29:12 -0000 1.45
+++ src/vteaccess.c 30 Oct 2005 13:19:27 -0000
@@ -84,7 +84,7 @@ vte_terminal_accessible_new_private_data
static void
vte_terminal_accessible_free_private_data(VteTerminalAccessiblePrivate *priv)
{
- g_return_if_fail(priv != NULL);
+ g_assert(priv != NULL);
if (priv->snapshot_text != NULL) {
g_string_free(priv->snapshot_text, TRUE);
priv->snapshot_text = NULL;
@@ -257,12 +257,12 @@ vte_terminal_accessible_update_private_d
long row, i, offset, caret;
long ccol, crow;
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
/* Retrieve the private data structure. It must already exist. */
priv = g_object_get_data(G_OBJECT(text),
VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA);
- g_return_if_fail(priv != NULL);
+ g_assert(priv != NULL);
/* If nothing's changed, just return immediately. */
if ((priv->snapshot_contents_invalid == FALSE) &&
@@ -456,16 +456,16 @@ vte_terminal_accessible_text_modified(Vt
char *old, *current;
glong offset, olen, clen;
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
priv = g_object_get_data(G_OBJECT(data),
VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA);
- g_return_if_fail(priv != NULL);
+ g_assert(priv != NULL);
priv->snapshot_contents_invalid = TRUE;
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(data),
&old, &olen);
- g_return_if_fail(old != NULL);
+ g_assert(old != NULL);
current = priv->snapshot_text->str;
clen = priv->snapshot_text->len;
@@ -525,12 +525,12 @@ vte_terminal_accessible_text_scrolled(Vt
struct _VteCharAttributes attr;
long i, len, delta;
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
- g_return_if_fail(howmuch != 0);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(howmuch != 0);
priv = g_object_get_data(G_OBJECT(data),
VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA);
- g_return_if_fail(priv != NULL);
+ g_assert(priv != NULL);
if (((howmuch < 0) && (howmuch <= -terminal->row_count)) ||
((howmuch > 0) && (howmuch >= terminal->row_count))) {
@@ -652,11 +652,11 @@ vte_terminal_accessible_invalidate_curso
{
VteTerminalAccessiblePrivate *priv;
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
priv = g_object_get_data(G_OBJECT(data),
VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA);
- g_return_if_fail(priv != NULL);
+ g_assert(priv != NULL);
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_MISC)) {
@@ -672,8 +672,8 @@ vte_terminal_accessible_invalidate_curso
static void
vte_terminal_accessible_title_changed(VteTerminal *terminal, gpointer data)
{
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(VTE_IS_TERMINAL(terminal));
atk_object_set_description(ATK_OBJECT(data), terminal->window_title);
}
@@ -682,8 +682,8 @@ static void
vte_terminal_accessible_focus_in(VteTerminal *terminal, GdkEventFocus *event,
gpointer data)
{
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(VTE_IS_TERMINAL(terminal));
g_signal_emit_by_name(data, "focus-event", TRUE);
atk_object_notify_state_change(ATK_OBJECT(data),
ATK_STATE_FOCUSED, TRUE);
@@ -694,8 +694,8 @@ static void
vte_terminal_accessible_focus_out(VteTerminal *terminal, GdkEventFocus *event,
gpointer data)
{
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(VTE_IS_TERMINAL(terminal));
g_signal_emit_by_name(data, "focus-event", FALSE);
atk_object_notify_state_change(ATK_OBJECT(data),
ATK_STATE_FOCUSED, FALSE);
@@ -709,8 +709,8 @@ vte_terminal_accessible_visibility_notif
{
GtkWidget *widget;
gboolean visible;
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(VTE_IS_TERMINAL(terminal));
visible = event->state != GDK_VISIBILITY_FULLY_OBSCURED;
/* The VISIBLE state indicates that this widget is "visible". */
atk_object_notify_state_change(ATK_OBJECT(data),
@@ -738,8 +738,8 @@ static void
vte_terminal_accessible_selection_changed (VteTerminal *terminal,
gpointer data)
{
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(data));
- g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(data));
+ g_assert(VTE_IS_TERMINAL(terminal));
g_signal_emit_by_name (data, "text_selection_changed");
}
@@ -849,7 +849,7 @@ vte_terminal_accessible_finalize(GObject
}
#endif
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(object));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(object));
accessible = GTK_ACCESSIBLE(object);
gobject_class = g_type_class_peek_parent(VTE_TERMINAL_ACCESSIBLE_GET_CLASS(object));
@@ -922,8 +922,7 @@ vte_terminal_accessible_get_text(AtkText
int start, end;
gchar *ret;
- g_return_val_if_fail((start_offset >= 0) && (end_offset >= -1),
- g_strdup(""));
+ g_assert((start_offset >= 0) && (end_offset >= -1));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
@@ -937,7 +936,7 @@ vte_terminal_accessible_get_text(AtkText
priv->snapshot_characters->len);
}
#endif
- g_return_val_if_fail(ATK_IS_TEXT(text), g_strdup(""));
+ g_assert(ATK_IS_TEXT(text));
/* If the requested area is after all of the text, just return an
* empty string. */
@@ -999,14 +998,13 @@ vte_terminal_accessible_get_text_somewhe
offset, priv->snapshot_attributes->len);
}
#endif
- g_return_val_if_fail(priv->snapshot_text != NULL, g_strdup(""));
- g_return_val_if_fail(priv->snapshot_characters != NULL, g_strdup(""));
+ g_assert(priv->snapshot_text != NULL);
+ g_assert(priv->snapshot_characters != NULL);
if (offset == priv->snapshot_characters->len) {
return g_strdup("");
}
- g_return_val_if_fail(offset < priv->snapshot_characters->len,
- g_strdup(""));
- g_return_val_if_fail(offset >= 0, g_strdup(""));
+ g_assert(offset < priv->snapshot_characters->len);
+ g_assert(offset >= 0);
switch (boundary_type) {
case ATK_TEXT_BOUNDARY_CHAR:
@@ -1148,7 +1146,7 @@ vte_terminal_accessible_get_text_before_
gint *start_offset,
gint *end_offset)
{
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
return vte_terminal_accessible_get_text_somewhere(text,
@@ -1165,7 +1163,7 @@ vte_terminal_accessible_get_text_after_o
gint *start_offset,
gint *end_offset)
{
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
return vte_terminal_accessible_get_text_somewhere(text,
@@ -1182,7 +1180,7 @@ vte_terminal_accessible_get_text_at_offs
gint *start_offset,
gint *end_offset)
{
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
return vte_terminal_accessible_get_text_somewhere(text,
@@ -1207,7 +1205,7 @@ vte_terminal_accessible_get_character_at
priv = g_object_get_data(G_OBJECT(text),
VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA);
- g_return_val_if_fail(offset < priv->snapshot_characters->len, 0);
+ g_assert(offset < priv->snapshot_characters->len);
mapped = g_array_index(priv->snapshot_characters, int, offset);
@@ -1330,7 +1328,7 @@ vte_terminal_accessible_get_character_ex
glong char_width, char_height;
gint base_x, base_y;
- g_return_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text));
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
@@ -1374,7 +1372,7 @@ vte_terminal_accessible_get_offset_at_po
glong char_width, char_height;
gint base_x, base_y;
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), -1);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
@@ -1398,7 +1396,7 @@ vte_terminal_accessible_get_n_selections
GtkWidget *widget;
VteTerminal *terminal;
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), -1);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
@@ -1407,7 +1405,7 @@ vte_terminal_accessible_get_n_selections
/* State is defunct */
return -1;
}
- g_return_val_if_fail (VTE_IS_TERMINAL (widget), -1);
+ g_assert(VTE_IS_TERMINAL (widget));
terminal = VTE_TERMINAL (widget);
return (vte_terminal_get_has_selection (terminal)) ? 1 : 0;
}
@@ -1421,7 +1419,7 @@ vte_terminal_accessible_get_selection(At
VteTerminalAccessiblePrivate *priv;
long start_x, start_y, end_x, end_y;
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), NULL);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
widget = GTK_ACCESSIBLE(text)->widget;
@@ -1429,7 +1427,7 @@ vte_terminal_accessible_get_selection(At
/* State is defunct */
return NULL;
}
- g_return_val_if_fail (VTE_IS_TERMINAL (widget), NULL);
+ g_assert(VTE_IS_TERMINAL (widget));
terminal = VTE_TERMINAL (widget);
if (!vte_terminal_get_has_selection (terminal)) {
return NULL;
@@ -1456,7 +1454,7 @@ vte_terminal_accessible_add_selection(At
VteTerminalAccessiblePrivate *priv;
gint start_x, start_y, end_x, end_y;
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
widget = GTK_ACCESSIBLE(text)->widget;
@@ -1464,9 +1462,9 @@ vte_terminal_accessible_add_selection(At
/* State is defunct */
return FALSE;
}
- g_return_val_if_fail (VTE_IS_TERMINAL (widget), FALSE);
+ g_assert(VTE_IS_TERMINAL (widget));
terminal = VTE_TERMINAL (widget);
- g_return_val_if_fail (!vte_terminal_get_has_selection (terminal), FALSE);
+ g_assert(!vte_terminal_get_has_selection (terminal));
priv = g_object_get_data(G_OBJECT(text),
VTE_TERMINAL_ACCESSIBLE_PRIVATE_DATA);
xy_from_offset (priv, start_offset, &start_x, &start_y);
@@ -1482,7 +1480,7 @@ vte_terminal_accessible_remove_selection
GtkWidget *widget;
VteTerminal *terminal;
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
widget = GTK_ACCESSIBLE(text)->widget;
@@ -1490,7 +1488,7 @@ vte_terminal_accessible_remove_selection
/* State is defunct */
return FALSE;
}
- g_return_val_if_fail (VTE_IS_TERMINAL (widget), FALSE);
+ g_assert(VTE_IS_TERMINAL (widget));
terminal = VTE_TERMINAL (widget);
if (selection_number == 0 && vte_terminal_get_has_selection (terminal)) {
_vte_terminal_remove_selection (terminal);
@@ -1507,7 +1505,7 @@ vte_terminal_accessible_set_selection(At
GtkWidget *widget;
VteTerminal *terminal;
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
widget = GTK_ACCESSIBLE(text)->widget;
@@ -1515,7 +1513,7 @@ vte_terminal_accessible_set_selection(At
/* State is defunct */
return FALSE;
}
- g_return_val_if_fail (VTE_IS_TERMINAL (widget), FALSE);
+ g_assert(VTE_IS_TERMINAL (widget));
terminal = VTE_TERMINAL (widget);
if (selection_number != 0) {
return FALSE;
@@ -1530,7 +1528,7 @@ vte_terminal_accessible_set_selection(At
static gboolean
vte_terminal_accessible_set_caret_offset(AtkText *text, gint offset)
{
- g_return_val_if_fail(VTE_IS_TERMINAL_ACCESSIBLE(text), FALSE);
+ g_assert(VTE_IS_TERMINAL_ACCESSIBLE(text));
vte_terminal_accessible_update_private_data_if_needed(ATK_OBJECT(text),
NULL, NULL);
/* Whoa, very not allowed. */
@@ -1541,7 +1539,7 @@ static void
vte_terminal_accessible_text_init(gpointer iface, gpointer data)
{
AtkTextIface *text;
- g_return_if_fail(G_TYPE_FROM_INTERFACE(iface) == ATK_TYPE_TEXT);
+ g_assert(G_TYPE_FROM_INTERFACE(iface) == ATK_TYPE_TEXT);
text = iface;
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_MISC)) {
@@ -1750,7 +1748,7 @@ static void
vte_terminal_accessible_remove_focus_handler(AtkComponent *component,
guint handler_id)
{
- g_return_if_fail(g_signal_handler_is_connected(component, handler_id));
+ g_assert(g_signal_handler_is_connected(component, handler_id));
g_signal_handler_disconnect(component, handler_id);
}
@@ -1758,7 +1756,7 @@ static void
vte_terminal_accessible_component_init(gpointer iface, gpointer data)
{
AtkComponentIface *component;
- g_return_if_fail(G_TYPE_FROM_INTERFACE(iface) == ATK_TYPE_COMPONENT);
+ g_assert(G_TYPE_FROM_INTERFACE(iface) == ATK_TYPE_COMPONENT);
component = iface;
#ifdef VTE_DEBUG
@@ -1889,11 +1887,11 @@ vte_terminal_accessible_factory_create_a
GtkAccessible *accessible;
VteTerminal *terminal;
- g_return_val_if_fail(VTE_IS_TERMINAL(obj), NULL);
+ g_assert(VTE_IS_TERMINAL(obj));
terminal = VTE_TERMINAL(obj);
accessible = GTK_ACCESSIBLE(vte_terminal_accessible_new(terminal));
- g_return_val_if_fail(accessible != NULL, NULL);
+ g_assert(accessible != NULL);
return ATK_OBJECT(accessible);
}
Index: src/vteapp.c
===================================================================
RCS file: /cvs/gnome/vte/src/vteapp.c,v
retrieving revision 1.70
diff -u -p -r1.70 vteapp.c
--- src/vteapp.c 20 Apr 2004 05:16:56 -0000 1.70
+++ src/vteapp.c 30 Oct 2005 13:19:27 -0000
@@ -50,9 +50,9 @@ window_title_changed(GtkWidget *widget,
{
GtkWindow *window;
- g_return_if_fail(VTE_TERMINAL(widget));
- g_return_if_fail(GTK_IS_WINDOW(win));
- g_return_if_fail(VTE_TERMINAL(widget)->window_title != NULL);
+ g_assert(VTE_TERMINAL(widget));
+ g_assert(GTK_IS_WINDOW(win));
+ g_assert(VTE_TERMINAL(widget)->window_title != NULL);
window = GTK_WINDOW(win);
gtk_window_set_title(window, VTE_TERMINAL(widget)->window_title);
@@ -63,9 +63,9 @@ icon_title_changed(GtkWidget *widget, gp
{
GtkWindow *window;
- g_return_if_fail(VTE_TERMINAL(widget));
- g_return_if_fail(GTK_IS_WINDOW(win));
- g_return_if_fail(VTE_TERMINAL(widget)->icon_title != NULL);
+ g_assert(VTE_TERMINAL(widget));
+ g_assert(GTK_IS_WINDOW(win));
+ g_assert(VTE_TERMINAL(widget)->icon_title != NULL);
window = GTK_WINDOW(win);
g_message("Icon title changed to \"%s\".\n",
@@ -80,8 +80,8 @@ char_size_changed(GtkWidget *widget, gui
GdkGeometry geometry;
int xpad, ypad;
- g_return_if_fail(GTK_IS_WINDOW(data));
- g_return_if_fail(VTE_IS_TERMINAL(widget));
+ g_assert(GTK_IS_WINDOW(data));
+ g_assert(VTE_IS_TERMINAL(widget));
terminal = VTE_TERMINAL(widget);
window = GTK_WINDOW(data);
@@ -324,7 +324,7 @@ read_and_feed(GIOChannel *source, GIOCon
char buf[2048];
gsize size;
GIOStatus status;
- g_return_val_if_fail(VTE_IS_TERMINAL(data), FALSE);
+ g_assert(VTE_IS_TERMINAL(data));
status = g_io_channel_read_chars(source, buf, sizeof(buf),
&size, NULL);
if ((status == G_IO_STATUS_NORMAL) && (size > 0)) {
Index: src/vtetc.c
===================================================================
RCS file: /cvs/gnome/vte/src/vtetc.c,v
retrieving revision 1.5
diff -u -p -r1.5 vtetc.c
--- src/vtetc.c 12 Aug 2005 19:51:50 -0000 1.5
+++ src/vtetc.c 30 Oct 2005 13:19:27 -0000
@@ -482,11 +482,11 @@ _vte_termcap_find_l(struct _vte_termcap
char *ttname;
gssize clen;
- g_return_val_if_fail(termcap != NULL, "");
- g_return_val_if_fail(tname != NULL, "");
- g_return_val_if_fail(len > 0, "");
- g_return_val_if_fail(cap != NULL, "");
- g_return_val_if_fail(strlen(cap) > 0, "");
+ g_assert(termcap != NULL);
+ g_assert(tname != NULL);
+ g_assert(len > 0);
+ g_assert(cap != NULL);
+ g_assert(strlen(cap) > 0);
/* Find the entry by this name. */
ttname = g_strndup(tname, len);
@@ -575,7 +575,7 @@ static const char *
_vte_termcap_find(struct _vte_termcap *termcap,
const char *tname, const char *cap)
{
- g_return_val_if_fail(termcap != NULL, "");
+ g_assert(termcap != NULL);
return _vte_termcap_find_l(termcap, tname, strlen(tname), cap);
}
Index: src/vtexft.c
===================================================================
RCS file: /cvs/gnome/vte/src/vtexft.c,v
retrieving revision 1.22
diff -u -p -r1.22 vtexft.c
--- src/vtexft.c 16 Sep 2005 20:14:29 -0000 1.22
+++ src/vtexft.c 30 Oct 2005 13:19:27 -0000
@@ -140,11 +140,11 @@ _vte_xft_font_close(struct _vte_xft_font
FcPattern *pattern;
int i;
- g_return_if_fail(font != NULL);
- g_return_if_fail(font->patterns != NULL);
- g_return_if_fail(font->fonts != NULL);
- g_return_if_fail(font->fontmap != NULL);
- g_return_if_fail(font->widths != NULL);
+ g_assert(font != NULL);
+ g_assert(font->patterns != NULL);
+ g_assert(font->fonts != NULL);
+ g_assert(font->fontmap != NULL);
+ g_assert(font->widths != NULL);
for (i = 0; i < font->patterns->len; i++) {
pattern = g_array_index(font->patterns, FcPattern*, i);
@@ -185,11 +185,11 @@ _vte_xft_font_for_char(struct _vte_xft_f
Display *display;
gpointer p = GINT_TO_POINTER(c);
- g_return_val_if_fail(font != NULL, NULL);
- g_return_val_if_fail(font->patterns != NULL, NULL);
- g_return_val_if_fail(font->fonts != NULL, NULL);
- g_return_val_if_fail(font->fontmap != NULL, NULL);
- g_return_val_if_fail(font->widths != NULL, NULL);
+ g_assert(font != NULL);
+ g_assert(font->patterns != NULL);
+ g_assert(font->fonts != NULL);
+ g_assert(font->fontmap != NULL);
+ g_assert(font->widths != NULL);
/* Check if we have a char-to-font entry for it. */
i = GPOINTER_TO_INT(_vte_tree_lookup(font->fontmap, p));
@@ -292,11 +292,11 @@ _vte_xft_char_width(struct _vte_xft_font
gpointer p = GINT_TO_POINTER(c);
int i;
- g_return_val_if_fail(font != NULL, 0);
- g_return_val_if_fail(font->patterns != NULL, 0);
- g_return_val_if_fail(font->fonts != NULL, 0);
- g_return_val_if_fail(font->fontmap != NULL, 0);
- g_return_val_if_fail(font->widths != NULL, 0);
+ g_assert(font != NULL);
+ g_assert(font->patterns != NULL);
+ g_assert(font->fonts != NULL);
+ g_assert(font->fontmap != NULL);
+ g_assert(font->widths != NULL);
/* Check if we have a char-to-width entry for it. */
i = GPOINTER_TO_INT(_vte_tree_lookup(font->widths, p));
_______________________________________________
Performance-list mailing list
Performance-list gnome org
http://mail.gnome.org/mailman/listinfo/performance-list