applied patch from kmaraas to replace g_return* with g_assert in static functions

parent ac0e2cad
2006-01-15 Guilherme de S. Pastore <gpastore@gnome.org>
* src/: applied patch from Kjartan Maraas that replaces g_return
functions with g_assert. Should give an 8% speed boost.
2006-01-14 Guilherme de S. Pastore <gpastore@gnome.org>
* doc/reference/Makefile.am: install more than *.html, based on the
......
......@@ -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++) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -50,9 +50,9 @@ window_title_changed(GtkWidget *widget, gpointer win)
{
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, gpointer win)
{
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, guint width, guint height, gpointer data)
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, GIOCondition condition, gpointer data)
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)) {
......
......@@ -482,11 +482,11 @@ _vte_termcap_find_l(struct _vte_termcap *termcap, const char *tname, gssize len,
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);
}
......
......@@ -140,11 +140,11 @@ _vte_xft_font_close(struct _vte_xft_font *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_font *font, gunichar c)
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 *font, XftFont *ftfont, gunichar c)
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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment