]>
Commit | Line | Data |
---|---|---|
844ddc42 KK |
1 | --- src/common/classes/array.h.orig 2012-06-20 09:58:37.000000000 +0200 |
2 | +++ src/common/classes/array.h 2012-06-26 10:37:49.000000000 +0200 | |
3 | @@ -347,7 +347,7 @@ | |
4 | size_t add(const Value& item) { | |
5 | size_t pos; | |
6 | find(KeyOfValue::generate(this, item), pos); | |
7 | - insert(pos, item); | |
8 | + this->insert(pos, item); | |
9 | return pos; | |
10 | } | |
11 | }; | |
12 | --- src/common/classes/stack.h.orig 2012-06-20 09:58:37.000000000 +0200 | |
13 | +++ src/common/classes/stack.h 2012-06-26 10:41:54.000000000 +0200 | |
14 | @@ -48,7 +48,7 @@ | |
15 | Entry(Object e, Entry* stk) | |
16 | : inherited(), next(stk) | |
17 | { | |
18 | - add(e); | |
19 | + this->add(e); | |
20 | } | |
21 | ||
22 | Entry(Entry* stk) : inherited(), next(stk) { } | |
23 | @@ -62,7 +62,7 @@ | |
24 | { | |
25 | if (inherited::getCount() < this->getCapacity()) | |
26 | { | |
27 | - add(e); | |
28 | + this->add(e); | |
29 | return this; | |
30 | } | |
31 | Entry* newEntry = FB_NEW(p) Entry(e, this); | |
32 | --- src/common/classes/vector.h.orig 2012-06-20 09:58:37.000000000 +0200 | |
33 | +++ src/common/classes/vector.h 2012-06-26 10:37:49.000000000 +0200 | |
34 | @@ -135,7 +135,7 @@ | |
35 | size_t add(const Value& item) { | |
36 | size_t pos; | |
37 | find(KeyOfValue::generate(this, item), pos); | |
38 | - insert(pos, item); | |
39 | + this->insert(pos, item); | |
40 | return pos; | |
41 | } | |
42 | }; | |
43 | --- src/jrd/Collation.cpp.orig 2012-06-20 09:58:27.000000000 +0200 | |
44 | +++ src/jrd/Collation.cpp 2012-06-26 11:35:42.000000000 +0200 | |
45 | @@ -191,154 +191,53 @@ | |
46 | ||
47 | ||
48 | template <class SLEUTHTYPE> | |
49 | -bool SLEUTHNAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj, USHORT flags, | |
50 | - const SLEUTHTYPE* search, SLONG search_len, | |
51 | - const SLEUTHTYPE* match, SLONG match_len) | |
52 | -{ | |
53 | -/************************************** | |
54 | - * | |
55 | - * E V L _ ? ? _ s l e u t h _ c h e c k | |
56 | - * | |
57 | - ************************************** | |
58 | - * | |
59 | - * Functional description | |
60 | - * Evaluate the "sleuth" search operator. | |
61 | - * | |
62 | - * Turn the (pointer, byte length) input parameters into | |
63 | - * (pointer, end_pointer) for use in SLEUTH_AUX | |
64 | - * | |
65 | - **************************************/ | |
66 | - fb_assert((match_len % sizeof(SLEUTHTYPE)) == 0); | |
67 | - fb_assert((search_len % sizeof(SLEUTHTYPE)) == 0); | |
68 | - fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE)); | |
69 | - | |
70 | - const SLEUTHTYPE* const end_match = match + (match_len / sizeof(SLEUTHTYPE)); | |
71 | - const SLEUTHTYPE* const end_search = search + (search_len / sizeof(SLEUTHTYPE)); | |
72 | - | |
73 | - return SLEUTH_AUX(obj, flags, search, end_search, match, end_match); | |
74 | -} | |
75 | - | |
76 | - | |
77 | -template <class SLEUTHTYPE> | |
78 | -ULONG SLEUTH_MERGE_NAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj, | |
79 | - const SLEUTHTYPE* match, SLONG match_bytes, | |
80 | - const SLEUTHTYPE* control, SLONG control_bytes, | |
81 | - SLEUTHTYPE* combined, SLONG combined_bytes) | |
82 | +static bool SLEUTH_CLASS_NAME( | |
83 | + Jrd::TextType* obj, | |
84 | + USHORT flags, | |
85 | + const SLEUTHTYPE* char_class, | |
86 | + const SLEUTHTYPE* const end_class, | |
87 | + SLEUTHTYPE character) | |
88 | { | |
89 | /************************************** | |
90 | * | |
91 | - * E V L _ ? ? _ s l e u t h _ m e r g e | |
92 | + * s l e u t h _ c l a s s | |
93 | * | |
94 | ************************************** | |
95 | * | |
96 | * Functional description | |
97 | - * Merge the matching pattern and control strings to give a cannonical | |
98 | - * matching pattern. Return the length of the combined string. | |
99 | - * | |
100 | - * What this routine does is to take the language template, strip off | |
101 | - * the prefix and put it in the output string, then parse the definitions | |
102 | - * into an array of character pointers. The index array is the defined | |
103 | - * character. The routine then takes the actual match pattern and uses | |
104 | - * the characters in it to index into the definitions to produce an equivalent | |
105 | - * pattern in the cannonical language. | |
106 | - * | |
107 | - * The silly loop setting *v++ to zero initializes the array up to the | |
108 | - * highest character defined (also max_op). Believe it or not, that part | |
109 | - * is not a bug. | |
110 | + * See if a character is a member of a class. | |
111 | + * Japanese version operates on short-based buffer, | |
112 | + * instead of SCHAR-based. | |
113 | * | |
114 | **************************************/ | |
115 | - fb_assert(match != NULL); | |
116 | - fb_assert(control != NULL); | |
117 | - fb_assert(combined != NULL); | |
118 | - | |
119 | - fb_assert((match_bytes % sizeof(SLEUTHTYPE)) == 0); | |
120 | - fb_assert((control_bytes % sizeof(SLEUTHTYPE)) == 0); | |
121 | + fb_assert(char_class != NULL); | |
122 | + fb_assert(end_class != NULL); | |
123 | + fb_assert(char_class <= end_class); | |
124 | fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE)); | |
125 | ||
126 | - const SLEUTHTYPE* const end_match = match + (match_bytes / sizeof(SLEUTHTYPE)); | |
127 | - const SLEUTHTYPE* const end_control = control + (control_bytes / sizeof(SLEUTHTYPE)); | |
128 | - | |
129 | - SLEUTHTYPE max_op = 0; | |
130 | - SLEUTHTYPE* comb = combined; | |
131 | - SLEUTHTYPE* vector[256]; | |
132 | - SLEUTHTYPE** v = vector; | |
133 | - SLEUTHTYPE temp[256]; | |
134 | - SLEUTHTYPE* t = temp; | |
135 | - | |
136 | -/* Parse control string into substitution strings and initializing string */ | |
137 | + bool result = true; | |
138 | ||
139 | - while (control < end_control) { | |
140 | - SLEUTHTYPE c = *control++; | |
141 | - if (*control == *(SLEUTHTYPE*)obj->getGdmlSubstituteCanonic()) { | |
142 | - /* Note: don't allow substitution characters larger than vector */ | |
143 | - SLEUTHTYPE** const end_vector = | |
144 | - vector + (((int)c < FB_NELEM(vector)) ? c : 0); | |
145 | - while (v <= end_vector) | |
146 | - *v++ = 0; | |
147 | - *end_vector = t; | |
148 | - ++control; | |
149 | - while (control < end_control) { | |
150 | - c = *control++; | |
151 | - if ((t > temp && t[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) | |
152 | - || ((c != *(SLEUTHTYPE*)obj->getGdmlCommaCanonic()) && (c != *(SLEUTHTYPE*)obj->getGdmlRParenCanonic()))) | |
153 | - { | |
154 | - *t++ = c; | |
155 | - } | |
156 | - else | |
157 | - break; | |
158 | - } | |
159 | - *t++ = 0; | |
160 | - } | |
161 | - else if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && control < end_control) | |
162 | - *comb++ = *control++; | |
163 | - else if (c == *(SLEUTHTYPE*)obj->getGdmlRParenCanonic()) | |
164 | - break; | |
165 | - else if (c != *(SLEUTHTYPE*)obj->getGdmlLParenCanonic()) | |
166 | - *comb++ = c; | |
167 | + if (*char_class == *(SLEUTHTYPE*)obj->getGdmlNotCanonic()) { | |
168 | + ++char_class; | |
169 | + result = false; | |
170 | } | |
171 | ||
172 | - max_op = v - vector; | |
173 | - | |
174 | -/* Interpret matching string, substituting where appropriate */ | |
175 | - | |
176 | - while (match < end_match) { | |
177 | - const SLEUTHTYPE c = *match++; | |
178 | - | |
179 | - /* if we've got a defined character, slurp the definition */ | |
180 | - | |
181 | - SLEUTHTYPE* p; | |
182 | - if (c <= max_op && (p = vector[c])) { | |
183 | - while (*p) | |
184 | - *comb++ = *p++; | |
185 | - | |
186 | - /* if we've got the definition of a quote character, | |
187 | - slurp the next character too */ | |
188 | - | |
189 | - if (comb > combined && comb[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && *match) | |
190 | - *comb++ = *match++; | |
191 | + while (char_class < end_class) { | |
192 | + const SLEUTHTYPE c = *char_class++; | |
193 | + if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) { | |
194 | + if (*char_class++ == character) | |
195 | + return true; | |
196 | } | |
197 | - | |
198 | - /* at this point we've got a non-match, but as it might be one of ours, | |
199 | - quote it. */ | |
200 | - | |
201 | - else { | |
202 | - if ((((size_t) c) < FB_NELEM(special)) && special[c] && | |
203 | - comb > combined && comb[-1] != *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) | |
204 | - { | |
205 | - *comb++ = *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic(); | |
206 | - } | |
207 | - *comb++ = c; | |
208 | + else if (*char_class == *(SLEUTHTYPE*)obj->getGdmlRangeCanonic()) { | |
209 | + char_class += 2; | |
210 | + if (character >= c && character <= char_class[-1]) | |
211 | + return result; | |
212 | } | |
213 | + else if (character == c) | |
214 | + return result; | |
215 | } | |
216 | ||
217 | -/* Put in trailing stuff */ | |
218 | - | |
219 | - while (control < end_control) | |
220 | - *comb++ = *control++; | |
221 | - | |
222 | - /* YYY - need to add code watching for overflow of combined */ | |
223 | - | |
224 | - return (comb - combined) * sizeof(SLEUTHTYPE); | |
225 | + return !result; | |
226 | } | |
227 | ||
228 | ||
229 | @@ -473,53 +372,154 @@ | |
230 | ||
231 | ||
232 | template <class SLEUTHTYPE> | |
233 | -static bool SLEUTH_CLASS_NAME( | |
234 | - Jrd::TextType* obj, | |
235 | - USHORT flags, | |
236 | - const SLEUTHTYPE* char_class, | |
237 | - const SLEUTHTYPE* const end_class, | |
238 | - SLEUTHTYPE character) | |
239 | +bool SLEUTHNAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj, USHORT flags, | |
240 | + const SLEUTHTYPE* search, SLONG search_len, | |
241 | + const SLEUTHTYPE* match, SLONG match_len) | |
242 | { | |
243 | /************************************** | |
244 | * | |
245 | - * s l e u t h _ c l a s s | |
246 | + * E V L _ ? ? _ s l e u t h _ c h e c k | |
247 | * | |
248 | ************************************** | |
249 | * | |
250 | * Functional description | |
251 | - * See if a character is a member of a class. | |
252 | - * Japanese version operates on short-based buffer, | |
253 | - * instead of SCHAR-based. | |
254 | + * Evaluate the "sleuth" search operator. | |
255 | + * | |
256 | + * Turn the (pointer, byte length) input parameters into | |
257 | + * (pointer, end_pointer) for use in SLEUTH_AUX | |
258 | * | |
259 | **************************************/ | |
260 | - fb_assert(char_class != NULL); | |
261 | - fb_assert(end_class != NULL); | |
262 | - fb_assert(char_class <= end_class); | |
263 | + fb_assert((match_len % sizeof(SLEUTHTYPE)) == 0); | |
264 | + fb_assert((search_len % sizeof(SLEUTHTYPE)) == 0); | |
265 | fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE)); | |
266 | ||
267 | - bool result = true; | |
268 | + const SLEUTHTYPE* const end_match = match + (match_len / sizeof(SLEUTHTYPE)); | |
269 | + const SLEUTHTYPE* const end_search = search + (search_len / sizeof(SLEUTHTYPE)); | |
270 | ||
271 | - if (*char_class == *(SLEUTHTYPE*)obj->getGdmlNotCanonic()) { | |
272 | - ++char_class; | |
273 | - result = false; | |
274 | + return SLEUTH_AUX(obj, flags, search, end_search, match, end_match); | |
275 | +} | |
276 | + | |
277 | + | |
278 | +template <class SLEUTHTYPE> | |
279 | +ULONG SLEUTH_MERGE_NAME(Jrd::thread_db* tdbb_dummy, Jrd::TextType* obj, | |
280 | + const SLEUTHTYPE* match, SLONG match_bytes, | |
281 | + const SLEUTHTYPE* control, SLONG control_bytes, | |
282 | + SLEUTHTYPE* combined, SLONG combined_bytes) | |
283 | +{ | |
284 | +/************************************** | |
285 | + * | |
286 | + * E V L _ ? ? _ s l e u t h _ m e r g e | |
287 | + * | |
288 | + ************************************** | |
289 | + * | |
290 | + * Functional description | |
291 | + * Merge the matching pattern and control strings to give a cannonical | |
292 | + * matching pattern. Return the length of the combined string. | |
293 | + * | |
294 | + * What this routine does is to take the language template, strip off | |
295 | + * the prefix and put it in the output string, then parse the definitions | |
296 | + * into an array of character pointers. The index array is the defined | |
297 | + * character. The routine then takes the actual match pattern and uses | |
298 | + * the characters in it to index into the definitions to produce an equivalent | |
299 | + * pattern in the cannonical language. | |
300 | + * | |
301 | + * The silly loop setting *v++ to zero initializes the array up to the | |
302 | + * highest character defined (also max_op). Believe it or not, that part | |
303 | + * is not a bug. | |
304 | + * | |
305 | + **************************************/ | |
306 | + fb_assert(match != NULL); | |
307 | + fb_assert(control != NULL); | |
308 | + fb_assert(combined != NULL); | |
309 | + | |
310 | + fb_assert((match_bytes % sizeof(SLEUTHTYPE)) == 0); | |
311 | + fb_assert((control_bytes % sizeof(SLEUTHTYPE)) == 0); | |
312 | + fb_assert(obj->getCanonicalWidth() == sizeof(SLEUTHTYPE)); | |
313 | + | |
314 | + const SLEUTHTYPE* const end_match = match + (match_bytes / sizeof(SLEUTHTYPE)); | |
315 | + const SLEUTHTYPE* const end_control = control + (control_bytes / sizeof(SLEUTHTYPE)); | |
316 | + | |
317 | + SLEUTHTYPE max_op = 0; | |
318 | + SLEUTHTYPE* comb = combined; | |
319 | + SLEUTHTYPE* vector[256]; | |
320 | + SLEUTHTYPE** v = vector; | |
321 | + SLEUTHTYPE temp[256]; | |
322 | + SLEUTHTYPE* t = temp; | |
323 | + | |
324 | +/* Parse control string into substitution strings and initializing string */ | |
325 | + | |
326 | + while (control < end_control) { | |
327 | + SLEUTHTYPE c = *control++; | |
328 | + if (*control == *(SLEUTHTYPE*)obj->getGdmlSubstituteCanonic()) { | |
329 | + /* Note: don't allow substitution characters larger than vector */ | |
330 | + SLEUTHTYPE** const end_vector = | |
331 | + vector + (((int)c < FB_NELEM(vector)) ? c : 0); | |
332 | + while (v <= end_vector) | |
333 | + *v++ = 0; | |
334 | + *end_vector = t; | |
335 | + ++control; | |
336 | + while (control < end_control) { | |
337 | + c = *control++; | |
338 | + if ((t > temp && t[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) | |
339 | + || ((c != *(SLEUTHTYPE*)obj->getGdmlCommaCanonic()) && (c != *(SLEUTHTYPE*)obj->getGdmlRParenCanonic()))) | |
340 | + { | |
341 | + *t++ = c; | |
342 | + } | |
343 | + else | |
344 | + break; | |
345 | + } | |
346 | + *t++ = 0; | |
347 | + } | |
348 | + else if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && control < end_control) | |
349 | + *comb++ = *control++; | |
350 | + else if (c == *(SLEUTHTYPE*)obj->getGdmlRParenCanonic()) | |
351 | + break; | |
352 | + else if (c != *(SLEUTHTYPE*)obj->getGdmlLParenCanonic()) | |
353 | + *comb++ = c; | |
354 | } | |
355 | ||
356 | - while (char_class < end_class) { | |
357 | - const SLEUTHTYPE c = *char_class++; | |
358 | - if (c == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) { | |
359 | - if (*char_class++ == character) | |
360 | - return true; | |
361 | + max_op = v - vector; | |
362 | + | |
363 | +/* Interpret matching string, substituting where appropriate */ | |
364 | + | |
365 | + while (match < end_match) { | |
366 | + const SLEUTHTYPE c = *match++; | |
367 | + | |
368 | + /* if we've got a defined character, slurp the definition */ | |
369 | + | |
370 | + SLEUTHTYPE* p; | |
371 | + if (c <= max_op && (p = vector[c])) { | |
372 | + while (*p) | |
373 | + *comb++ = *p++; | |
374 | + | |
375 | + /* if we've got the definition of a quote character, | |
376 | + slurp the next character too */ | |
377 | + | |
378 | + if (comb > combined && comb[-1] == *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic() && *match) | |
379 | + *comb++ = *match++; | |
380 | } | |
381 | - else if (*char_class == *(SLEUTHTYPE*)obj->getGdmlRangeCanonic()) { | |
382 | - char_class += 2; | |
383 | - if (character >= c && character <= char_class[-1]) | |
384 | - return result; | |
385 | + | |
386 | + /* at this point we've got a non-match, but as it might be one of ours, | |
387 | + quote it. */ | |
388 | + | |
389 | + else { | |
390 | + if ((((size_t) c) < FB_NELEM(special)) && special[c] && | |
391 | + comb > combined && comb[-1] != *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic()) | |
392 | + { | |
393 | + *comb++ = *(SLEUTHTYPE*)obj->getGdmlQuoteCanonic(); | |
394 | + } | |
395 | + *comb++ = c; | |
396 | } | |
397 | - else if (character == c) | |
398 | - return result; | |
399 | } | |
400 | ||
401 | - return !result; | |
402 | +/* Put in trailing stuff */ | |
403 | + | |
404 | + while (control < end_control) | |
405 | + *comb++ = *control++; | |
406 | + | |
407 | + /* YYY - need to add code watching for overflow of combined */ | |
408 | + | |
409 | + return (comb - combined) * sizeof(SLEUTHTYPE); | |
410 | } | |
411 | ||
412 |