summaryrefslogtreecommitdiff
path: root/dev-tcltk/tdom/files/tdom-0.9.5-fix-c23.patch
blob: ad8a5af4d40b38f6c1912d95c1fe41fd831ec7ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
https://bugs.gentoo.org/943934
https://core.tcl-lang.org/tdom/info/2db2c391674a7cc3

Amended to remove https://core.tcl-lang.org/tdom/info/8a8dee52e5eb58d4

--- a/generic/datatypes.c
+++ b/generic/datatypes.c
@@ -225,11 +225,11 @@
     void *constraintData,
     char *text
     )
 {
     tclTCData *tcdata = constraintData;
-    int result, bool;
+    int result, boolVal;
 
     tcdata->evalStub[tcdata->nrArg-1] = Tcl_NewStringObj(text, -1);
     Tcl_IncrRefCount (tcdata->evalStub[tcdata->nrArg-1]);
     tcdata->sdata->currentEvals++;
     result = Tcl_EvalObjv (interp, tcdata->nrArg, tcdata->evalStub,
@@ -238,15 +238,15 @@
     Tcl_DecrRefCount (tcdata->evalStub[tcdata->nrArg-1]);
     if (result != TCL_OK) {
         tcdata->sdata->evalError = 1;
         return 0;
     }
-    result = Tcl_GetBooleanFromObj (interp, Tcl_GetObjResult (interp), &bool);
+    result = Tcl_GetBooleanFromObj (interp, Tcl_GetObjResult (interp), &boolVal);
     if (result != TCL_OK) {
         return 0;
     }
-    if (bool) {
+    if (boolVal) {
         return 1;
     } 
     return 0;
 }
 

--- a/generic/dom.c
+++ b/generic/dom.c
@@ -5489,11 +5489,11 @@
     int objc,
     Tcl_Obj *const objv[]
     )
 {
     CHandlerSet     *handlerSet;
-    int              methodIndex, result, bool;
+    int              methodIndex, result, boolVal;
     tdomCmdReadInfo *info;
     TclGenExpatInfo *expat;
     Tcl_Obj         *newObjName = NULL;
 
     static const char *tdomMethods[] = {
@@ -5601,14 +5601,14 @@
             Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL);
             return TCL_ERROR;
         }
         Tcl_SetIntObj (Tcl_GetObjResult (interp), info->storeLineColumn);
         if (objc == 4) {
-            if (Tcl_GetBooleanFromObj (interp, objv[3], &bool) != TCL_OK) {
+            if (Tcl_GetBooleanFromObj (interp, objv[3], &boolVal) != TCL_OK) {
                 return TCL_ERROR;
             }
-            info->storeLineColumn = bool;
+            info->storeLineColumn = boolVal;
         }
         info->tdomStatus = 1;
         break;
         
     case m_remove:
@@ -5656,15 +5656,15 @@
         if (!info) {
             Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL);
             return TCL_ERROR;
         }
         Tcl_SetIntObj (Tcl_GetObjResult (interp), info->ignoreWhiteSpaces);
-        if (Tcl_GetBooleanFromObj (interp, objv[3], &bool) != TCL_OK) {
+        if (Tcl_GetBooleanFromObj (interp, objv[3], &boolVal) != TCL_OK) {
             return TCL_ERROR;
         }
-        info->ignoreWhiteSpaces = !bool;
-        handlerSet->ignoreWhiteCDATAs = !bool;
+        info->ignoreWhiteSpaces = !boolVal;
+        handlerSet->ignoreWhiteCDATAs = !boolVal;
         info->tdomStatus = 1;
         break;
 
     case m_keepCDATA:
         if (objc != 4) {
@@ -5680,14 +5680,14 @@
         info = handlerSet->userData;
         if (!info) {
             Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL);
             return TCL_ERROR;
         }
-        if (Tcl_GetBooleanFromObj (interp, objv[3], &bool) != TCL_OK) {
+        if (Tcl_GetBooleanFromObj (interp, objv[3], &boolVal) != TCL_OK) {
             return TCL_ERROR;
         }
-        if (bool) {
+        if (boolVal) {
             handlerSet->startCdataSectionCommand = tdom_startCDATA;
             handlerSet->endCdataSectionCommand = endCDATA;
         } else {
             handlerSet->startCdataSectionCommand = NULL;
             handlerSet->endCdataSectionCommand = NULL;
@@ -5709,15 +5709,15 @@
         info = handlerSet->userData;
         if (!info) {
             Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL);
             return TCL_ERROR;
         }
-        if (Tcl_GetBooleanFromObj (interp, objv[3], &bool) != TCL_OK) {
+        if (Tcl_GetBooleanFromObj (interp, objv[3], &boolVal) != TCL_OK) {
             return TCL_ERROR;
         }
         expat = GetExpatInfo (interp, objv[1]);
-        expat->keepTextStart = bool;
+        expat->keepTextStart = boolVal;
         expat->cdataStartLine = 0;
         break;
         
     case m_ignorexmlns:
         info = CHandlerSetGetUserData (interp, objv[1], "tdom");
@@ -5725,17 +5725,17 @@
             Tcl_SetResult (interp, "parser object isn't tdom enabled.", NULL);
             return TCL_ERROR;
         }
         Tcl_SetIntObj (Tcl_GetObjResult (interp), info->ignorexmlns);
         if (objc == 4) {
-            if (Tcl_GetBooleanFromObj (interp, objv[3], &bool) != TCL_OK) {
+            if (Tcl_GetBooleanFromObj (interp, objv[3], &boolVal) != TCL_OK) {
                 return TCL_ERROR;
             }
-            info->ignorexmlns = bool;
+            info->ignorexmlns = boolVal;
         }
         info->tdomStatus = 1;
         break;
 
     }
 
     return TCL_OK;
 }

--- a/generic/tcldom.c
+++ b/generic/tcldom.c
@@ -3400,12 +3400,12 @@
 typedef struct 
 {
     Tcl_Obj  *object;
     Tcl_Obj  *array;
     Tcl_Obj  *null;
-    Tcl_Obj  *true;
-    Tcl_Obj  *false;
+    Tcl_Obj  *trueVal;
+    Tcl_Obj  *falseVal;
     Tcl_Obj  *number;
     Tcl_Obj  *string;
 } asTypedListTypes;
 
 
@@ -3476,14 +3476,14 @@
         switch (node->info) {
         case JSON_NULL:
             Tcl_ListObjAppendElement (NULL, resultObj, c->null);
             break;
         case JSON_TRUE:
-            Tcl_ListObjAppendElement (NULL, resultObj, c->true);
+            Tcl_ListObjAppendElement (NULL, resultObj, c->trueVal);
             break;
         case JSON_FALSE:
-            Tcl_ListObjAppendElement (NULL, resultObj, c->false);
+            Tcl_ListObjAppendElement (NULL, resultObj, c->falseVal);
             break;
         case JSON_NUMBER:
             textNode = (domTextNode *)node;
             if (isJSONNumber (textNode->nodeValue, textNode->valueLength)) {
                 Tcl_ListObjAppendElement(NULL, resultObj, c->number);
@@ -3520,20 +3520,20 @@
     }
 
     c.object = Tcl_NewStringObj ("OBJECT", 6);
     c.array = Tcl_NewStringObj ("ARRAY", 5);
     c.null = Tcl_NewStringObj ("NULL", 4);
-    c.true = Tcl_NewStringObj ("TRUE", 4);
-    c.false = Tcl_NewStringObj ("FALSE", 5);
+    c.trueVal = Tcl_NewStringObj ("TRUE", 4);
+    c.falseVal = Tcl_NewStringObj ("FALSE", 5);
     c.number = Tcl_NewStringObj ("NUMBER", 6);
     c.string = Tcl_NewStringObj ("STRING", 6);
 
     Tcl_IncrRefCount (c.object);
     Tcl_IncrRefCount (c.array);
     Tcl_IncrRefCount (c.null);
-    Tcl_IncrRefCount (c.true);
-    Tcl_IncrRefCount (c.false);
+    Tcl_IncrRefCount (c.trueVal);
+    Tcl_IncrRefCount (c.falseVal);
     Tcl_IncrRefCount (c.number);
     Tcl_IncrRefCount (c.string);
 
     if (node->nodeType == ELEMENT_NODE
         && node->info == 0
@@ -3547,12 +3547,12 @@
                       tcldom_treeAsTypedListWorker (node, &c));
 
     Tcl_DecrRefCount (c.object);
     Tcl_DecrRefCount (c.array);
     Tcl_DecrRefCount (c.null);
-    Tcl_DecrRefCount (c.true);
-    Tcl_DecrRefCount (c.false);
+    Tcl_DecrRefCount (c.trueVal);
+    Tcl_DecrRefCount (c.falseVal);
     Tcl_DecrRefCount (c.number);
     Tcl_DecrRefCount (c.string);
 }
 
 /*----------------------------------------------------------------------------
@@ -3600,11 +3600,11 @@
     Tcl_Obj    *const objv[]
 )
 {
     char          *channelId, prefix[MAX_PREFIX_LEN];
     const char    *localName;
-    int            indent, mode, bool;
+    int            indent, mode, boolVal;
     int            outputFlags = 0;
     int            optionIndex, cdataChild;
     Tcl_Obj       *resultPtr, *encString = NULL;
     Tcl_Channel    chan = (Tcl_Channel) NULL;
     Tcl_HashEntry *h;
@@ -3716,15 +3716,15 @@
             if (objc < 4) {
                 SetResult("-doctypeDeclaration must have a boolean value "
                           "as argument");
                 goto cleanup;
             }
-            if (Tcl_GetBooleanFromObj(interp, objv[3], &bool)
+            if (Tcl_GetBooleanFromObj(interp, objv[3], &boolVal)
                 != TCL_OK) {
                 goto cleanup;
             }
-            if (bool) outputFlags |= SERIALIZE_DOCTYPE_DECLARATION;
+            if (boolVal) outputFlags |= SERIALIZE_DOCTYPE_DECLARATION;
             objc -= 2;
             objv += 2;
             break;
 
         case m_xmlDeclaration:
@@ -3731,15 +3731,15 @@
             if (objc < 4) {
                 SetResult("-xmlDeclaration must have a boolean value "
                           "as argument");
                 goto cleanup;
             }
-            if (Tcl_GetBooleanFromObj(interp, objv[3], &bool)
+            if (Tcl_GetBooleanFromObj(interp, objv[3], &boolVal)
                 != TCL_OK) {
                 goto cleanup;
             }
-            if (bool) outputFlags |= SERIALIZE_XML_DECLARATION;
+            if (boolVal) outputFlags |= SERIALIZE_XML_DECLARATION;
             objc -= 2;
             objv += 2;
             break;
 
         case m_encString:
@@ -4933,11 +4933,11 @@
     const char  *localName, *uri, *nsStr;
     int          result, methodIndex, i;
     domLength    length;
     XML_Size     line, column;
     XML_Index    byteIndex;
-    int          nsIndex, bool, hnew, legacy, jsonType;
+    int          nsIndex, boolVal, hnew, legacy, jsonType;
     Tcl_Obj     *namePtr, *resultPtr;
     Tcl_Obj     *mobjv[MAX_REWRITE_ARGS], *storedErrMsg;
     Tcl_CmdInfo  cmdInfo;
     Tcl_HashEntry *h;
 
@@ -5945,14 +5945,14 @@
                 return TCL_ERROR;
             }
             SetIntResult(
                 (((node->nodeFlags & DISABLE_OUTPUT_ESCAPING) == 0) ? 0 : 1));
             if (objc == 3) {
-                if (Tcl_GetBooleanFromObj(interp, objv[2], &bool) != TCL_OK) {
+                if (Tcl_GetBooleanFromObj(interp, objv[2], &boolVal) != TCL_OK) {
                     return TCL_ERROR;
                 }
-                if (bool) {
+                if (boolVal) {
                     node->nodeFlags |= DISABLE_OUTPUT_ESCAPING;
                 } else {
                     node->nodeFlags &= (~DISABLE_OUTPUT_ESCAPING);
                 }
             }
@@ -5990,20 +5990,20 @@
             FREE (str);
             return TCL_OK;
 
         case m_normalize:
             CheckArgs (2,3,2, "?-forXPath?");
-            bool = 0;
+            boolVal = 0;
             if (objc == 3) {
                 if (strcmp (Tcl_GetString(objv[2]), "-forXPath") == 0) {
-                    bool = 1;
+                    boolVal = 1;
                 } else {
                     SetResult("unknown option! Options: ?-forXPath?");
                     return TCL_ERROR;
                 }
             }
-            domNormalize (node, bool, tcldom_deleteNode, interp);
+            domNormalize (node, boolVal, tcldom_deleteNode, interp);
             return TCL_OK;
 
         case m_jsonType:
             CheckArgs (2,3,2, "?jsonType?");
             if (node->nodeType != ELEMENT_NODE
@@ -6073,11 +6073,11 @@
 
     domDeleteInfo       * dinfo;
     domDocument         * doc;
     char                * method, *tag, *data, *target, *uri, tmp[100];
     char                * str, *docName, *errMsg;
-    int                   methodIndex, result, i, nsIndex, forXPath, bool;
+    int                   methodIndex, result, i, nsIndex, forXPath, boolVal;
     int                   setDocumentElement = 0, restoreDomCreateCmdMode = 0;
     domLength             data_length, target_length;
     domNode             * n;
     Tcl_CmdInfo           cmdInfo;
     Tcl_Obj             * mobjv[MAX_REWRITE_ARGS], *storedErrMsg;
@@ -6420,14 +6420,14 @@
                 SetBooleanResult (1);
             } else {
                 SetBooleanResult(0);
             }
             if (objc == 3) {
-                if (Tcl_GetBooleanFromObj (interp, objv[2], &bool) != TCL_OK) {
+                if (Tcl_GetBooleanFromObj (interp, objv[2], &boolVal) != TCL_OK) {
                     return TCL_ERROR;
                 }
-                if (bool) {
+                if (boolVal) {
                     doc->nodeFlags |= OUTPUT_DEFAULT_INDENT;
                 } else {
                     doc->nodeFlags &= ~OUTPUT_DEFAULT_INDENT;
                 }
             }
@@ -7831,11 +7831,11 @@
 {
     GetTcldomDATA;
 
     char        * method, tmp[300], *string, *option,
                  *replacement;
-    int           methodIndex, result, i, bool, changed;
+    int           methodIndex, result, i, boolVal, changed;
     domLength     repllen;
     Tcl_CmdInfo   cmdInfo;
     Tcl_Obj     * mobjv[MAX_REWRITE_ARGS], *newObj, *storedErrMsg;
     Tcl_DString   cleardString, escapedStr;
 
@@ -7992,34 +7992,34 @@
             break;
 #endif
 
         case m_setStoreLineColumn:
             if (objc == 3) {
-                if (Tcl_GetBooleanFromObj(interp, objv[2], &bool) != TCL_OK) {
+                if (Tcl_GetBooleanFromObj(interp, objv[2], &boolVal) != TCL_OK) {
                     return TCL_ERROR;
                 }
-                TcldomDATA(storeLineColumn) = bool;
+                TcldomDATA(storeLineColumn) = boolVal;
             }
             SetBooleanResult(TcldomDATA(storeLineColumn));
             return TCL_OK;
 
         case m_setNameCheck:
             if (objc == 3) {
-                if (Tcl_GetBooleanFromObj(interp, objv[2], &bool) != TCL_OK) {
+                if (Tcl_GetBooleanFromObj(interp, objv[2], &boolVal) != TCL_OK) {
                     return TCL_ERROR;
                 }
-                TcldomDATA(dontCheckName) = !bool;
+                TcldomDATA(dontCheckName) = !boolVal;
             }
             SetBooleanResult(!TcldomDATA(dontCheckName));
             return TCL_OK;
             
         case m_setTextCheck:
             if (objc == 3) {
-                if (Tcl_GetBooleanFromObj(interp, objv[2], &bool) != TCL_OK) {
+                if (Tcl_GetBooleanFromObj(interp, objv[2], &boolVal) != TCL_OK) {
                     return TCL_ERROR;
                 }
-                TcldomDATA(dontCheckCharData) = !bool;
+                TcldomDATA(dontCheckCharData) = !boolVal;
             }
             SetBooleanResult(!TcldomDATA(dontCheckCharData));
             return TCL_OK;
             
         case m_setObjectCommands:

--- a/generic/tclexpat.c
+++ b/generic/tclexpat.c
@@ -1265,11 +1265,11 @@
   enum paramEntityParsingValues {
       EXPAT_PARAMENTITYPARSINGALWAYS,
       EXPAT_PARAMENTITYPARSINGNEVER,
       EXPAT_PARAMENTITYPARSINGNOTSTANDALONE
   };
-  int optionIndex, value, bool;
+  int optionIndex, value, boolVal;
   Tcl_Obj *const *objPtr = objv;
   Tcl_CmdInfo cmdInfo;
   int rc;
   domLength len;
   char *handlerSetName = NULL;
@@ -1394,15 +1394,15 @@
 #endif          
           break;
           
       case EXPAT_FINAL:			/* -final */
 
-	if (Tcl_GetBooleanFromObj(interp, objPtr[1], &bool) != TCL_OK) {
+	if (Tcl_GetBooleanFromObj(interp, objPtr[1], &boolVal) != TCL_OK) {
             return TCL_ERROR;
 	}
 
-        expat->final = bool;
+        expat->final = boolVal;
 	break;
 
       case EXPAT_BASE:			/* -baseurl */
 
         if (expat->baseURI) {
@@ -1591,22 +1591,22 @@
         }
 	break;
 
       case EXPAT_USEFOREIGNDTD:                /* -useForeignDTD */
         
-        if (Tcl_GetBooleanFromObj (interp, objPtr[1], &bool) != TCL_OK) {
+        if (Tcl_GetBooleanFromObj (interp, objPtr[1], &boolVal) != TCL_OK) {
             return TCL_ERROR;
         }
         if (expat->parser) {
             /* Cannot be changed after parsing as started (which is
                kind of understandable). */
-            if (XML_UseForeignDTD (expat->parser, (unsigned char)bool)
+            if (XML_UseForeignDTD (expat->parser, (unsigned char)boolVal)
                 != XML_ERROR_NONE) {
-                expat->useForeignDTD = bool;
+                expat->useForeignDTD = boolVal;
             }
         } else {
-            expat->useForeignDTD = bool;
+            expat->useForeignDTD = boolVal;
         }
         break;
 
       case EXPAT_COMMENTCMD:      /* -commentcommand */
 	/* ericm@scriptics.com */
@@ -1774,37 +1774,37 @@
             }
         }
         break;
 
     case EXPAT_NOEXPAND:
-        if (Tcl_GetBooleanFromObj (interp, objPtr[1], &bool) != TCL_OK) {
+        if (Tcl_GetBooleanFromObj (interp, objPtr[1], &boolVal) != TCL_OK) {
             return TCL_ERROR;
         }
-        if (bool) {
+        if (boolVal) {
             XML_SetDefaultHandler( expat->parser,
                                    TclGenExpatDefaultHandler);
         } else {
             XML_SetDefaultHandlerExpand( expat->parser,
                                          TclGenExpatDefaultHandler);
         }
-        expat->noexpand = bool;
+        expat->noexpand = boolVal;
         break;
 
     case EXPAT_FASTCALL:
-        if (Tcl_GetBooleanFromObj (interp, objPtr[1], &bool) != TCL_OK) {
+        if (Tcl_GetBooleanFromObj (interp, objPtr[1], &boolVal) != TCL_OK) {
             return TCL_ERROR;
         }
         CheckDefaultTclHandlerSet;
-        activeTclHandlerSet->fastCall = bool;
+        activeTclHandlerSet->fastCall = boolVal;
         break;
                   
     case EXPAT_KEEPTEXTSTART:
-        if (Tcl_GetBooleanFromObj(interp, objPtr[1], &bool) != TCL_OK) {
+        if (Tcl_GetBooleanFromObj(interp, objPtr[1], &boolVal) != TCL_OK) {
             return TCL_ERROR;
 	}
 
-        expat->keepTextStart = bool;
+        expat->keepTextStart = boolVal;
 	break;
 
 #ifndef TDOM_NO_SCHEMA
     case EXPAT_VALIDATECMD:
         schemacmd = Tcl_GetString (objv[1]);