vte r2354 - in trunk: . src
- From: behdad svn gnome org
- To: svn-commits-list gnome org
- Subject: vte r2354 - in trunk: . src
- Date: Fri, 26 Dec 2008 04:13:33 +0000 (UTC)
Author: behdad
Date: Fri Dec 26 04:13:33 2008
New Revision: 2354
URL: http://svn.gnome.org/viewvc/vte?rev=2354&view=rev
Log:
2008-12-25 Behdad Esfahbod <behdad gnome org>
* src/interpret.c (main):
* src/slowcat.c (catfile):
* src/table.c (_vte_table_addi), (_vte_table_add):
* src/trie.c (_vte_trie_matchx):
* src/vte.c (_vte_invalidate_cell), (_vte_terminal_insert_char):
* src/vteaccess.c (offset_from_xy),
(vte_terminal_accessible_finalize),
(vte_terminal_accessible_get_text),
(vte_terminal_accessible_get_text_somewhere):
* src/vteapp.c (main):
* src/vtebg.c (vte_bg_cache_item_free), (vte_bg_cache_add):
Fix warnings.
Modified:
trunk/ChangeLog
trunk/src/interpret.c
trunk/src/slowcat.c
trunk/src/table.c
trunk/src/trie.c
trunk/src/vte.c
trunk/src/vteaccess.c
trunk/src/vteapp.c
trunk/src/vtebg.c
Modified: trunk/src/interpret.c
==============================================================================
--- trunk/src/interpret.c (original)
+++ trunk/src/interpret.c Fri Dec 26 04:13:33 2008
@@ -42,8 +42,9 @@
struct _vte_termcap *termcap = NULL;
struct _vte_buffer *buffer = NULL;
GArray *array;
- int i, j, l;
- char c;
+ unsigned int i, j;
+ int l;
+ char b;
GValue *value;
FILE *infile = NULL;
struct _vte_iso2022_state *subst;
@@ -83,8 +84,8 @@
subst = _vte_iso2022_state_new(NULL, NULL, NULL);
- while (fread(&c, 1, 1, infile) == 1) {
- _vte_buffer_append(buffer, &c, 1);
+ while (fread(&b, 1, 1, infile) == 1) {
+ _vte_buffer_append(buffer, &b, 1);
}
_vte_iso2022_process(subst, buffer->bytes,
_vte_buffer_length(buffer), array);
Modified: trunk/src/slowcat.c
==============================================================================
--- trunk/src/slowcat.c (original)
+++ trunk/src/slowcat.c Fri Dec 26 04:13:33 2008
@@ -62,7 +62,8 @@
}
}
if (i > 0) {
- write(STDOUT_FILENO, buf, i);
+ int bytes;
+ bytes = write(STDOUT_FILENO, buf, i);
fsync(STDOUT_FILENO);
}
}
Modified: trunk/src/table.c
==============================================================================
--- trunk/src/table.c (original)
+++ trunk/src/table.c Fri Dec 26 04:13:33 2008
@@ -201,7 +201,7 @@
struct _vte_table *subtable;
if (original_length == -1) {
- original_length = strlen(original);
+ original_length = strlen((char *) original);
}
if (length == -1) {
length = strlen(pattern);
@@ -269,9 +269,9 @@
b = g_byte_array_new();
g_byte_array_set_size(b, 0);
g_byte_array_append(b, original, initial);
- g_byte_array_append(b, pattern + 2, length - 2);
+ g_byte_array_append(b, (const guint8*)pattern + 2, length - 2);
_vte_table_addi(table, b->data, b->len,
- b->data + initial,
+ (const char *)b->data + initial,
b->len - initial,
result, quark, inc);
g_byte_array_free(b, TRUE);
@@ -401,7 +401,8 @@
const char *pattern, gssize length,
const char *result, GQuark quark)
{
- _vte_table_addi(table, pattern, length,
+ _vte_table_addi(table,
+ (const unsigned char *) pattern, length,
pattern, length,
result, quark, 0);
}
Modified: trunk/src/trie.c
==============================================================================
--- trunk/src/trie.c (original)
+++ trunk/src/trie.c Fri Dec 26 04:13:33 2008
@@ -573,7 +573,7 @@
/* Move past characters which might match this
* part of the string... */
while (cclass->multiple &&
- ((prospect - pattern) < length) &&
+ ((gsize)(prospect - pattern) < length) &&
cclass->check(prospect[0], data)) {
prospect++;
}
Modified: trunk/src/vte.c
==============================================================================
--- trunk/src/vte.c (original)
+++ trunk/src/vte.c Fri Dec 26 04:13:33 2008
@@ -706,7 +706,7 @@
VteRowData *row_data;
int columns;
- if (!GTK_WIDGET_DRAWABLE(terminal) || terminal->pvt->invalidated_all) {
+ if (G_UNLIKELY (!GTK_WIDGET_DRAWABLE(terminal) || terminal->pvt->invalidated_all)) {
return;
}
@@ -3131,11 +3131,11 @@
row_num = screen->cursor_current.row;
row = NULL;
- if (col == 0) {
+ if (G_UNLIKELY (col == 0)) {
/* We are at first column. See if the previous line softwrapped.
* If it did, move there. Otherwise skip inserting. */
- if (row_num > 0) {
+ if (G_LIKELY (row_num > 0)) {
row_num--;
row = _vte_terminal_find_row_data (terminal, row_num);
Modified: trunk/src/vteaccess.c
==============================================================================
--- trunk/src/vteaccess.c (original)
+++ trunk/src/vteaccess.c Fri Dec 26 04:13:33 2008
@@ -125,11 +125,11 @@
gint linebreak;
gint next_linebreak;
- if (y >= priv->snapshot_linebreaks->len)
+ if (y >= (gint) priv->snapshot_linebreaks->len)
y = priv->snapshot_linebreaks->len -1;
linebreak = g_array_index (priv->snapshot_linebreaks, int, y);
- if (y +1 == priv->snapshot_linebreaks->len)
+ if (y + 1 == (gint) priv->snapshot_linebreaks->len)
next_linebreak = priv->snapshot_characters->len;
else
next_linebreak = g_array_index (priv->snapshot_linebreaks, int, y + 1);
@@ -871,7 +871,7 @@
if (accessible->widget != NULL) {
g_object_remove_weak_pointer(G_OBJECT(accessible->widget),
- (gpointer*) &accessible->widget);
+ (gpointer*)(gpointer)&accessible->widget);
g_signal_handlers_disconnect_matched(accessible->widget,
G_SIGNAL_MATCH_FUNC |
G_SIGNAL_MATCH_DATA,
@@ -958,13 +958,13 @@
/* If the requested area is after all of the text, just return an
* empty string. */
- if (start_offset >= priv->snapshot_characters->len) {
+ if (start_offset >= (int) priv->snapshot_characters->len) {
return g_strdup("");
}
/* Map the offsets to, er, offsets. */
start = g_array_index(priv->snapshot_characters, int, start_offset);
- if ((end_offset == -1) || (end_offset >= priv->snapshot_characters->len) ) {
+ if ((end_offset == -1) || (end_offset >= (int) priv->snapshot_characters->len) ) {
/* Get everything up to the end of the buffer. */
end = priv->snapshot_text->len;
} else {
@@ -1019,7 +1019,7 @@
offset, priv->snapshot_attributes->len);
g_assert(priv->snapshot_text != NULL);
g_assert(priv->snapshot_characters != NULL);
- if (offset == priv->snapshot_characters->len) {
+ if (offset == (int) priv->snapshot_characters->len) {
return g_strdup("");
}
g_assert(offset < priv->snapshot_characters->len);
@@ -1031,7 +1031,7 @@
* position, the one before it, or the one after it. */
offset += direction;
start = MAX(offset, 0);
- end = MIN(offset + 1, priv->snapshot_attributes->len);
+ end = MIN(offset + 1, (int) priv->snapshot_attributes->len);
break;
case ATK_TEXT_BOUNDARY_WORD_START:
/* Back up to the previous non-word-word transition. */
@@ -1072,7 +1072,7 @@
* non-word character, then the next word character
* after that. */
if (direction == direction_next) {
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
next = vte_terminal_accessible_get_character_at_offset(text, offset);
if (vte_terminal_is_word_char(terminal, next)) {
offset++;
@@ -1080,7 +1080,7 @@
break;
}
}
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
next = vte_terminal_accessible_get_character_at_offset(text, offset);
if (!vte_terminal_is_word_char(terminal, next)) {
offset++;
@@ -1091,7 +1091,7 @@
start = offset;
}
/* Now find the end of this word. */
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
if (vte_terminal_is_word_char(terminal, current)) {
offset++;
@@ -1101,7 +1101,7 @@
}
/* Now find the next non-word-word transition */
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
next = vte_terminal_accessible_get_character_at_offset(text, offset);
if (!vte_terminal_is_word_char(terminal, next)) {
offset++;
@@ -1156,7 +1156,7 @@
* word character, then the next non-word character
* after that. */
if (direction == direction_next) {
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
if (!vte_terminal_is_word_char(terminal, current)) {
offset++;
@@ -1164,7 +1164,7 @@
break;
}
}
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
if (vte_terminal_is_word_char(terminal, current)) {
offset++;
@@ -1175,7 +1175,7 @@
start = offset;
}
/* Now find the next word end. */
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
if (!vte_terminal_is_word_char(terminal, current)) {
offset++;
@@ -1183,7 +1183,7 @@
break;
}
}
- while (offset < priv->snapshot_characters->len) {
+ while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
if (vte_terminal_is_word_char(terminal, current)) {
offset++;
Modified: trunk/src/vteapp.c
==============================================================================
--- trunk/src/vteapp.c (original)
+++ trunk/src/vteapp.c Fri Dec 26 04:13:33 2008
@@ -446,7 +446,7 @@
{
GdkScreen *screen;
GdkColormap *colormap;
- GtkWidget *window, *widget,*hbox, *scrollbar, *scrolled_window;
+ GtkWidget *window, *widget,*hbox = NULL, *scrollbar, *scrolled_window = NULL;
VteTerminal *terminal;
char *env_add[] = {
#ifdef VTE_DEBUG
@@ -789,13 +789,17 @@
antialias ? VTE_ANTI_ALIAS_USE_DEFAULT : VTE_ANTI_ALIAS_FORCE_DISABLE);
/* Match "abcdefg". */
- vte_terminal_match_add(terminal, "abcdefg");
if (dingus) {
int id;
- id = vte_terminal_match_add(terminal, DINGUS1);
+ GRegex *regex;
+ regex = g_regex_new (DINGUS1, 0, 0, NULL);
+ id = vte_terminal_match_add_gregex(terminal, regex, 0);
+ g_regex_unref (regex);
vte_terminal_match_set_cursor_type(terminal,
id, GDK_GUMBY);
- id = vte_terminal_match_add(terminal, DINGUS2);
+ regex = g_regex_new (DINGUS2, 0, 0, NULL);
+ id = vte_terminal_match_add_gregex(terminal, regex, 0);
+ g_regex_unref (regex);
vte_terminal_match_set_cursor_type(terminal,
id, GDK_HAND1);
}
Modified: trunk/src/vtebg.c
==============================================================================
--- trunk/src/vtebg.c (original)
+++ trunk/src/vtebg.c Fri Dec 26 04:13:33 2008
@@ -343,16 +343,16 @@
/* Clean up whatever is left in the structure. */
if (item->source_pixbuf != NULL) {
g_object_remove_weak_pointer(G_OBJECT(item->source_pixbuf),
- (gpointer*)&item->source_pixbuf);
+ (gpointer*)(void*)&item->source_pixbuf);
}
g_free(item->source_file);
if (item->pixmap != NULL) {
g_object_remove_weak_pointer(G_OBJECT(item->pixmap),
- (gpointer*)&item->pixmap);
+ (gpointer*)(void*)&item->pixmap);
}
if (item->pixbuf != NULL) {
g_object_remove_weak_pointer(G_OBJECT(item->pixbuf),
- (gpointer*)&item->pixbuf);
+ (gpointer*)(void*)&item->pixbuf);
}
g_slice_free(struct VteBgCacheItem, item);
@@ -441,15 +441,15 @@
bg->pvt->cache = g_list_prepend(bg->pvt->cache, item);
if (item->source_pixbuf != NULL) {
g_object_add_weak_pointer(G_OBJECT(item->source_pixbuf),
- (gpointer*)&item->source_pixbuf);
+ (gpointer*)(void*)&item->source_pixbuf);
}
if (item->pixbuf != NULL) {
g_object_add_weak_pointer(G_OBJECT(item->pixbuf),
- (gpointer*)&item->pixbuf);
+ (gpointer*)(void*)&item->pixbuf);
}
if (item->pixmap != NULL) {
g_object_add_weak_pointer(G_OBJECT(item->pixmap),
- (gpointer*)&item->pixmap);
+ (gpointer*)(void*)&item->pixmap);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]