author | erik <erik> | 2007-01-29 21:53:48 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-29 21:53:48 (UTC) |
commit | 02ef45be75a3024df11365956e1cce6392d9103c (patch) (unidiff) | |
tree | 42fd5c909d67a473f57a607e01d32e01b3dd2511 /noncore/apps/opie-reader/CRegExp.cpp | |
parent | b2c306a99b8dc82c981390f02db859149fac8cf0 (diff) | |
download | opie-02ef45be75a3024df11365956e1cce6392d9103c.zip opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.gz opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.bz2 |
Each file in this commit has an issue where the initial value of a variable
is assumed to be something but no initial value is given.
This commit changes that by either assigning an initial value or removing
the assumption on an initial value (usually the former).
Diffstat (limited to 'noncore/apps/opie-reader/CRegExp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CRegExp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/CRegExp.cpp b/noncore/apps/opie-reader/CRegExp.cpp index 6318d28..e3194df 100644 --- a/noncore/apps/opie-reader/CRegExp.cpp +++ b/noncore/apps/opie-reader/CRegExp.cpp | |||
@@ -64,97 +64,97 @@ void CRegExpFilt::prepreprocessing(const QString& pat, bool insens) | |||
64 | #ifdef _WINDOWS | 64 | #ifdef _WINDOWS |
65 | switch (pat.at(p).unicode()) | 65 | switch (pat.at(p).unicode()) |
66 | #else | 66 | #else |
67 | switch (pat[p].unicode()) | 67 | switch (pat[p].unicode()) |
68 | #endif | 68 | #endif |
69 | { | 69 | { |
70 | case '{': | 70 | case '{': |
71 | { | 71 | { |
72 | break; | 72 | break; |
73 | } | 73 | } |
74 | case '}': | 74 | case '}': |
75 | { | 75 | { |
76 | break; | 76 | break; |
77 | } | 77 | } |
78 | case '^': | 78 | case '^': |
79 | { | 79 | { |
80 | break; | 80 | break; |
81 | } | 81 | } |
82 | case '.' : | 82 | case '.' : |
83 | { | 83 | { |
84 | break; | 84 | break; |
85 | } | 85 | } |
86 | case '#': | 86 | case '#': |
87 | { | 87 | { |
88 | p++; | 88 | p++; |
89 | #ifdef _WINDOWS | 89 | #ifdef _WINDOWS |
90 | while ('0' <= pat.at(p).unicode() && pat.at(p).unicode() <= '9') | 90 | while ('0' <= pat.at(p).unicode() && pat.at(p).unicode() <= '9') |
91 | #else | 91 | #else |
92 | while ('0' <= pat[p].unicode() && pat[p].unicode() <= '9') | 92 | while ('0' <= pat[p].unicode() && pat[p].unicode() <= '9') |
93 | #endif | 93 | #endif |
94 | { | 94 | { |
95 | } | 95 | } |
96 | p--; | 96 | p--; |
97 | break; | 97 | break; |
98 | } | 98 | } |
99 | case '\\' : | 99 | case '\\' : |
100 | { | 100 | { |
101 | #ifdef _WINDOWS | 101 | #ifdef _WINDOWS |
102 | tchar c = escapedchar(pat.at(++p).unicode()); | 102 | tchar c = escapedchar(pat.at(++p).unicode()); |
103 | #else | 103 | #else |
104 | tchar c = escapedchar(pat[++p].unicode()); | 104 | tchar c = escapedchar(pat[++p].unicode()); |
105 | #endif | 105 | #endif |
106 | regchar(c, insens); | 106 | regchar(c, insens); |
107 | break; | 107 | break; |
108 | } | 108 | } |
109 | 109 | ||
110 | case '[' : | 110 | case '[' : |
111 | { | 111 | { |
112 | tchar clast; | 112 | tchar clast = 0; |
113 | bool invert = false; | 113 | bool invert = false; |
114 | tchar c; | 114 | tchar c; |
115 | #ifdef _WINDOWS | 115 | #ifdef _WINDOWS |
116 | if (pat.at(p+1).unicode() == '^') | 116 | if (pat.at(p+1).unicode() == '^') |
117 | #else | 117 | #else |
118 | if (pat[p+1].unicode() == '^') | 118 | if (pat[p+1].unicode() == '^') |
119 | #endif | 119 | #endif |
120 | { | 120 | { |
121 | p++; | 121 | p++; |
122 | invert = true; | 122 | invert = true; |
123 | } | 123 | } |
124 | #ifdef _WINDOWS | 124 | #ifdef _WINDOWS |
125 | while ((c = pat.at(++p).unicode()) != ']') | 125 | while ((c = pat.at(++p).unicode()) != ']') |
126 | #else | 126 | #else |
127 | while ((c = pat[++p].unicode()) != ']') | 127 | while ((c = pat[++p].unicode()) != ']') |
128 | #endif | 128 | #endif |
129 | { | 129 | { |
130 | if (c == '\\') | 130 | if (c == '\\') |
131 | { | 131 | { |
132 | #ifdef _WINDOWS | 132 | #ifdef _WINDOWS |
133 | c = escapedchar(pat.at(++p).unicode()); | 133 | c = escapedchar(pat.at(++p).unicode()); |
134 | #else | 134 | #else |
135 | c = escapedchar(pat[++p].unicode()); | 135 | c = escapedchar(pat[++p].unicode()); |
136 | #endif | 136 | #endif |
137 | if (c == ']') break; | 137 | if (c == ']') break; |
138 | } | 138 | } |
139 | if (c == '-') | 139 | if (c == '-') |
140 | { | 140 | { |
141 | #ifdef _WINDOWS | 141 | #ifdef _WINDOWS |
142 | c = pat.at(++p).unicode(); | 142 | c = pat.at(++p).unicode(); |
143 | #else | 143 | #else |
144 | c = pat[++p].unicode(); | 144 | c = pat[++p].unicode(); |
145 | #endif | 145 | #endif |
146 | for (tchar j = clast; j <= c; j++) | 146 | for (tchar j = clast; j <= c; j++) |
147 | { | 147 | { |
148 | regchar(j, insens); | 148 | regchar(j, insens); |
149 | } | 149 | } |
150 | } | 150 | } |
151 | else | 151 | else |
152 | { | 152 | { |
153 | regchar(c, insens); | 153 | regchar(c, insens); |
154 | } | 154 | } |
155 | clast = c; | 155 | clast = c; |
156 | } | 156 | } |
157 | break; | 157 | break; |
158 | } | 158 | } |
159 | default : | 159 | default : |
160 | { | 160 | { |
@@ -242,97 +242,97 @@ unsigned int CRegExpFilt::preprocessing(const QString& pat, bool insens) | |||
242 | #endif | 242 | #endif |
243 | } | 243 | } |
244 | p--; | 244 | p--; |
245 | count = count-1; | 245 | count = count-1; |
246 | unsigned int mask = 0; | 246 | unsigned int mask = 0; |
247 | for (unsigned int i = m; i < m+count; i++) | 247 | for (unsigned int i = m; i < m+count; i++) |
248 | { | 248 | { |
249 | mask |= bit[i]; | 249 | mask |= bit[i]; |
250 | } | 250 | } |
251 | 251 | ||
252 | for (iter it = CV.begin(); it != CV.end(); ++it) | 252 | for (iter it = CV.begin(); it != CV.end(); ++it) |
253 | { | 253 | { |
254 | if (CV[it.first()] & bit[m-1]) | 254 | if (CV[it.first()] & bit[m-1]) |
255 | { | 255 | { |
256 | CV[it.first()] |= mask; | 256 | CV[it.first()] |= mask; |
257 | } | 257 | } |
258 | } | 258 | } |
259 | if (keep & bit[m-1]) keep |= mask; | 259 | if (keep & bit[m-1]) keep |= mask; |
260 | m += count; | 260 | m += count; |
261 | } | 261 | } |
262 | else | 262 | else |
263 | { | 263 | { |
264 | p++; | 264 | p++; |
265 | } | 265 | } |
266 | break; | 266 | break; |
267 | } | 267 | } |
268 | case '\\' : | 268 | case '\\' : |
269 | { | 269 | { |
270 | #ifdef _WINDOWS | 270 | #ifdef _WINDOWS |
271 | tchar c = escapedchar(pat.at(++p).unicode()); | 271 | tchar c = escapedchar(pat.at(++p).unicode()); |
272 | #else | 272 | #else |
273 | tchar c = escapedchar(pat[++p].unicode()); | 273 | tchar c = escapedchar(pat[++p].unicode()); |
274 | #endif | 274 | #endif |
275 | if (insens) | 275 | if (insens) |
276 | { | 276 | { |
277 | CV[upper(c)] |= bit[m]; | 277 | CV[upper(c)] |= bit[m]; |
278 | CV[lower(c)] |= bit[m]; | 278 | CV[lower(c)] |= bit[m]; |
279 | } | 279 | } |
280 | else | 280 | else |
281 | { | 281 | { |
282 | CV[c] |= bit[m]; | 282 | CV[c] |= bit[m]; |
283 | } | 283 | } |
284 | m++; | 284 | m++; |
285 | break; | 285 | break; |
286 | } | 286 | } |
287 | 287 | ||
288 | case '[' : | 288 | case '[' : |
289 | { | 289 | { |
290 | tchar c, clast; | 290 | tchar c, clast = 0; |
291 | bool invert = false; | 291 | bool invert = false; |
292 | #ifdef _WINDOWS | 292 | #ifdef _WINDOWS |
293 | if (pat.at(p+1).unicode() == '^') | 293 | if (pat.at(p+1).unicode() == '^') |
294 | #else | 294 | #else |
295 | if (pat[p+1].unicode() == '^') | 295 | if (pat[p+1].unicode() == '^') |
296 | #endif | 296 | #endif |
297 | { | 297 | { |
298 | p++; | 298 | p++; |
299 | invert = true; | 299 | invert = true; |
300 | } | 300 | } |
301 | #ifdef _WINDOWS | 301 | #ifdef _WINDOWS |
302 | while ((c = pat.at(++p).unicode()) != ']') | 302 | while ((c = pat.at(++p).unicode()) != ']') |
303 | #else | 303 | #else |
304 | while ((c = pat[++p].unicode()) != ']') | 304 | while ((c = pat[++p].unicode()) != ']') |
305 | #endif | 305 | #endif |
306 | { | 306 | { |
307 | if (c == '\\') | 307 | if (c == '\\') |
308 | { | 308 | { |
309 | #ifdef _WINDOWS | 309 | #ifdef _WINDOWS |
310 | c = escapedchar(pat.at(++p).unicode()); | 310 | c = escapedchar(pat.at(++p).unicode()); |
311 | #else | 311 | #else |
312 | c = escapedchar(pat[++p].unicode()); | 312 | c = escapedchar(pat[++p].unicode()); |
313 | #endif | 313 | #endif |
314 | if (c == ']') break; | 314 | if (c == ']') break; |
315 | } | 315 | } |
316 | if (c == '-') | 316 | if (c == '-') |
317 | { | 317 | { |
318 | #ifdef _WINDOWS | 318 | #ifdef _WINDOWS |
319 | c = pat.at(++p).unicode(); | 319 | c = pat.at(++p).unicode(); |
320 | #else | 320 | #else |
321 | c = pat[++p].unicode(); | 321 | c = pat[++p].unicode(); |
322 | #endif | 322 | #endif |
323 | for (tchar j = clast; j <= c; j++) | 323 | for (tchar j = clast; j <= c; j++) |
324 | { | 324 | { |
325 | if (insens) | 325 | if (insens) |
326 | { | 326 | { |
327 | iter it; | 327 | iter it; |
328 | if ((it = CV.find(upper(j))) != CV.end()) | 328 | if ((it = CV.find(upper(j))) != CV.end()) |
329 | CV[it] |= bit[m]; | 329 | CV[it] |= bit[m]; |
330 | else | 330 | else |
331 | CV[0] |= bit[m]; | 331 | CV[0] |= bit[m]; |
332 | if ((it = CV.find(lower(j))) != CV.end()) | 332 | if ((it = CV.find(lower(j))) != CV.end()) |
333 | CV[it] |= bit[m]; | 333 | CV[it] |= bit[m]; |
334 | else | 334 | else |
335 | CV[0] |= bit[m]; | 335 | CV[0] |= bit[m]; |
336 | } | 336 | } |
337 | else | 337 | else |
338 | { | 338 | { |