Line 0
Link Here
|
|
|
1 |
--- src/main.c.orig Wed Mar 10 17:35:40 2004 |
2 |
+++ src/main.c Thu Jul 1 21:03:44 2004 |
3 |
@@ -107,16 +107,20 @@ |
4 |
|
5 |
void set_escaped ( gchar * expression, unsigned int levels ) |
6 |
{ |
7 |
+ unsigned int num; |
8 |
+ gchar * escaped; |
9 |
+ unsigned int x; // temp var |
10 |
+ unsigned int i, j; |
11 |
+ |
12 |
if ( !expression ) |
13 |
return; |
14 |
|
15 |
- unsigned int num = (1<<levels)-1; |
16 |
- gchar * escaped = g_malloc ( (strlen ( expression ) * (num+1) )+1 ); // worst case if each character would be escaped |
17 |
+ num = (1<<levels)-1; |
18 |
+ escaped = g_malloc ( (strlen ( expression ) * (num+1) )+1 ); // worst case if each character would be escaped |
19 |
escaped[0] = 0; |
20 |
|
21 |
- unsigned int x; // temp var |
22 |
- unsigned int i = 0; |
23 |
- unsigned int j = 0; |
24 |
+ i = 0; |
25 |
+ j = 0; |
26 |
while ( expression[i] ) |
27 |
{ |
28 |
switch ( expression[i] ) |
29 |
@@ -144,10 +148,12 @@ |
30 |
|
31 |
void clear_result () |
32 |
{ |
33 |
+ ResultItem * result; |
34 |
+ |
35 |
if ( !lastResult ) |
36 |
return; |
37 |
|
38 |
- ResultItem * result = lastResult; |
39 |
+ result = lastResult; |
40 |
while ( result->position >= 0 ) |
41 |
{ |
42 |
if ( result->value ) |
43 |
@@ -202,14 +208,16 @@ |
44 |
ResultItem * transform ( int * ovector, unsigned int matches, const gchar * data ) |
45 |
{ |
46 |
ResultItem * resultItems; |
47 |
+ int parent; |
48 |
+ GTrashStack * stack; |
49 |
+ unsigned int o; |
50 |
|
51 |
resultItems = g_malloc ( sizeof(ResultItem)*(matches+1) ); |
52 |
|
53 |
- int parent = 0; |
54 |
+ parent = 0; |
55 |
|
56 |
- GTrashStack * stack = NULL; |
57 |
+ stack = NULL; |
58 |
|
59 |
- unsigned int o; |
60 |
for ( o = 0; o<matches; o++ ) |
61 |
{ |
62 |
int offset = ovector[o*2]; |
63 |
@@ -268,17 +276,18 @@ |
64 |
{ |
65 |
GtkTextIter iter; |
66 |
GtkTextBuffer * buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(resultEntry) ); |
67 |
+ gchar * result; |
68 |
+ int o, j, i, x; |
69 |
|
70 |
gtk_text_buffer_set_text ( buffer, "", -1 ); |
71 |
|
72 |
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0); |
73 |
|
74 |
- gchar * result = g_malloc ( (strlen ( data ) + 128 ) * 2 ); |
75 |
+ result = g_malloc ( (strlen ( data ) + 128 ) * 2 ); |
76 |
|
77 |
- int o; |
78 |
- int j = 0; |
79 |
- int i = 0; |
80 |
- int x = 0; |
81 |
+ j = 0; |
82 |
+ i = 0; |
83 |
+ x = 0; |
84 |
while ( data[i] ) |
85 |
{ |
86 |
for ( o = 0; o<matches; o++ ) |
87 |
@@ -362,6 +371,8 @@ |
88 |
|
89 |
int flags = PCRE_UTF8; |
90 |
|
91 |
+ ResultItem * resultItems; |
92 |
+ |
93 |
if ( opt_multiline() ) |
94 |
flags |= PCRE_MULTILINE; |
95 |
|
96 |
@@ -403,7 +414,6 @@ |
97 |
|
98 |
// Fill result tree |
99 |
|
100 |
- ResultItem * resultItems; |
101 |
resultItems = transform ( ovector, rc, data ); |
102 |
update_model ( resultItems, resultTree ); |
103 |
|
104 |
@@ -441,14 +451,14 @@ |
105 |
GtkTreeSelection * sel; |
106 |
GtkTreeModel * model; |
107 |
GtkTreeIter iter; |
108 |
+ gint position; |
109 |
+ |
110 |
sel = gtk_tree_view_get_selection ( GTK_TREE_VIEW(resultTree) ); |
111 |
|
112 |
if ( !gtk_tree_selection_get_selected ( sel, &model, &iter ) ) |
113 |
{ |
114 |
return; |
115 |
} |
116 |
- |
117 |
- gint position; |
118 |
|
119 |
gtk_tree_model_get ( model, &iter, POSITION_COLUMN, &position, -1 ); |
120 |
|