const.patch 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. Descriptiom: Patch makes explicit casts to silence GCC warnings about
  2. incompatible pointer types (mostly adds or removes const modifier).
  3. Author: Sergei Golovan
  4. Last-Modified: Wed, 09 Jul 2014 19:22:39 +0400
  5. --- a/generic/bltArrayObj.c
  6. +++ b/generic/bltArrayObj.c
  7. @@ -55,7 +55,7 @@
  8. Blt_HashEntry *hPtr;
  9. Blt_HashTable *tablePtr;
  10. Tcl_Obj *elemObjPtr, **vobjv;
  11. - Tcl_ObjType *oldTypePtr;
  12. + CONST Tcl_ObjType *oldTypePtr;
  13. char *string;
  14. int isNew;
  15. int nElem;
  16. --- a/generic/bltBgexec.c
  17. +++ b/generic/bltBgexec.c
  18. @@ -926,7 +926,7 @@
  19. Tcl_DStringInit(&dStr);
  20. GetSinkData(sinkPtr, &data, &length);
  21. Tcl_DStringAppend(&dStr, sinkPtr->command, -1);
  22. - Tcl_DStringAppendElement(&dStr, data);
  23. + Tcl_DStringAppendElement(&dStr, (char *)data);
  24. Tcl_DStringAppendElement(&dStr, status);
  25. if (Tcl_GlobalEval(interp, Tcl_DStringValue(&dStr)) != TCL_OK) {
  26. Tcl_BackgroundError(interp);
  27. --- a/generic/bltTree.c
  28. +++ b/generic/bltTree.c
  29. @@ -47,7 +47,7 @@
  30. if (dictType == NULL) {
  31. Tcl_Obj * obj;
  32. obj = Tcl_NewDictObj();
  33. - dictType = obj->typePtr;
  34. + dictType = (Tcl_ObjType *)obj->typePtr;
  35. Tcl_DecrRefCount(obj);
  36. }
  37. return (objPtr->typePtr == dictType);
  38. @@ -3320,7 +3320,7 @@
  39. if (tPtr->nodeTable.numEntries > 0) {
  40. flags |= TREE_TRACE_TAGMULTIPLE;
  41. }
  42. - result = CallTraces(interp, clientPtr, node->treeObject, node, tagName,
  43. + result = CallTraces(interp, clientPtr, node->treeObject, node, (Blt_TreeKey)tagName,
  44. flags, &cnt);
  45. if (result == TCL_BREAK) {
  46. return TCL_OK;
  47. @@ -3349,7 +3349,7 @@
  48. int cnt;
  49. if (!(node->flags & TREE_TRACE_ACTIVE)) {
  50. - return CallTraces(interp, clientPtr, node->treeObject, node, tagName,
  51. + return CallTraces(interp, clientPtr, node->treeObject, node, (Blt_TreeKey)tagName,
  52. (TREE_TRACE_TAGDELETE), &cnt);
  53. }
  54. return TCL_OK;
  55. --- a/generic/bltTreeCmd.c
  56. +++ b/generic/bltTreeCmd.c
  57. @@ -7733,7 +7733,7 @@
  58. return TCL_ERROR;
  59. }
  60. if (valueObjPtr->typePtr != NULL) {
  61. - Tcl_SetResult(interp, valueObjPtr->typePtr->name, TCL_VOLATILE);
  62. + Tcl_SetResult(interp, (char *)(valueObjPtr->typePtr->name), TCL_VOLATILE);
  63. } else {
  64. Tcl_SetResult(interp, "string", TCL_STATIC);
  65. }
  66. --- a/generic/bltVector.c
  67. +++ b/generic/bltVector.c
  68. @@ -370,7 +370,7 @@
  69. *indexPtr = (int)value;
  70. cleanup:
  71. if (string != zStatic) {
  72. - Blt_Free( string );
  73. + Blt_Free( (void *)string );
  74. }
  75. return result;
  76. }
  77. --- a/generic/bltGrAxis.c
  78. +++ b/generic/bltGrAxis.c
  79. @@ -3436,7 +3436,7 @@
  80. Graph *graphPtr;
  81. Axis *axisPtr;
  82. int argc;
  83. - char *argv[];
  84. + CONST char *argv[];
  85. {
  86. int flags;
  87. --- a/generic/bltGrElem.c
  88. +++ b/generic/bltGrElem.c
  89. @@ -1658,7 +1658,7 @@
  90. Graph *graphPtr; /* Graph widget */
  91. Tcl_Interp *interp; /* Interpreter to report results to */
  92. int argc; /* Number of element names */
  93. - char **argv; /* List of element names */
  94. + CONST char **argv; /* List of element names */
  95. {
  96. Element *elemPtr;
  97. ClosestSearch search;
  98. @@ -1821,12 +1821,12 @@
  99. Graph *graphPtr;
  100. Tcl_Interp *interp;
  101. int argc;
  102. - char *argv[];
  103. + CONST char *argv[];
  104. {
  105. Element *elemPtr;
  106. int flags;
  107. int numNames, numOpts;
  108. - char **options;
  109. + CONST char **options;
  110. register int i;
  111. /* Figure out where the option value pairs begin */
  112. --- a/generic/bltGrGrid.c
  113. +++ b/generic/bltGrGrid.c
  114. @@ -355,7 +355,7 @@
  115. Graph *graphPtr;
  116. Tcl_Interp *interp;
  117. int argc;
  118. - char **argv;
  119. + CONST char **argv;
  120. {
  121. Grid *gridPtr = (Grid *)graphPtr->gridPtr;
  122. int flags;
  123. --- a/generic/bltGrHairs.c
  124. +++ b/generic/bltGrHairs.c
  125. @@ -379,7 +379,7 @@
  126. Graph *graphPtr;
  127. Tcl_Interp *interp;
  128. int argc;
  129. - char **argv;
  130. + CONST char **argv;
  131. {
  132. Crosshairs *chPtr = graphPtr->crosshairs;
  133. --- a/generic/bltGrLegd.c
  134. +++ b/generic/bltGrLegd.c
  135. @@ -1393,7 +1393,7 @@
  136. Graph *graphPtr;
  137. Tcl_Interp *interp;
  138. int argc;
  139. - char **argv;
  140. + CONST char **argv;
  141. {
  142. int flags = TK_CONFIG_ARGV_ONLY;
  143. Legend *legendPtr;
  144. --- a/generic/bltGrMarker.c
  145. +++ b/generic/bltGrMarker.c
  146. @@ -4274,13 +4274,13 @@
  147. Graph *graphPtr;
  148. Tcl_Interp *interp;
  149. int argc;
  150. - char **argv;
  151. + CONST char **argv;
  152. {
  153. Marker *markerPtr;
  154. int flags = TK_CONFIG_ARGV_ONLY;
  155. char *oldName;
  156. int nNames, nOpts;
  157. - char **options;
  158. + CONST char **options;
  159. register int i;
  160. int under;
  161. --- a/generic/bltGrPen.c
  162. +++ b/generic/bltGrPen.c
  163. @@ -475,13 +475,13 @@
  164. Tcl_Interp *interp;
  165. Graph *graphPtr;
  166. int argc;
  167. - char *argv[];
  168. + CONST char *argv[];
  169. {
  170. int flags;
  171. Pen *penPtr;
  172. int nNames, nOpts;
  173. int redraw;
  174. - char **options;
  175. + CONST char **options;
  176. register int i;
  177. /* Figure out where the option value pairs begin */
  178. --- a/generic/bltGrPs.c
  179. +++ b/generic/bltGrPs.c
  180. @@ -406,7 +406,7 @@
  181. Graph *graphPtr;
  182. Tcl_Interp *interp;
  183. int argc; /* Number of options in argv vector */
  184. - char **argv; /* Option vector */
  185. + CONST char **argv; /* Option vector */
  186. {
  187. int flags = TK_CONFIG_ARGV_ONLY;
  188. PostScript *psPtr = (PostScript *)graphPtr->postscript;
  189. @@ -1110,7 +1110,7 @@
  190. Graph *graphPtr; /* Graph widget record */
  191. Tcl_Interp *interp;
  192. int argc; /* Number of options in argv vector */
  193. - char **argv; /* Option vector */
  194. + CONST char **argv; /* Option vector */
  195. {
  196. PostScript *psPtr = (PostScript *)graphPtr->postscript;
  197. FILE *f = NULL;
  198. @@ -1121,7 +1121,7 @@
  199. fileName = NULL;
  200. if (argc > 3) {
  201. if (argv[3][0] != '-') {
  202. - fileName = argv[3]; /* First argument is the file name. */
  203. + fileName = (char *)argv[3]; /* First argument is the file name. */
  204. argv++, argc--;
  205. }
  206. if (Blt_ConfigureWidget(interp, graphPtr->tkwin, configSpecs, argc - 3,
  207. --- a/generic/bltGraph.c
  208. +++ b/generic/bltGraph.c
  209. @@ -887,7 +887,7 @@
  210. CreateGraph(interp, argc, argv, classUid)
  211. Tcl_Interp *interp;
  212. int argc;
  213. - char **argv;
  214. + CONST char **argv;
  215. Blt_Uid classUid;
  216. {
  217. Graph *graphPtr;
  218. @@ -1082,7 +1082,7 @@
  219. Graph *graphPtr;
  220. Tcl_Interp *interp;
  221. int argc;
  222. - char **argv;
  223. + CONST char **argv;
  224. {
  225. int flags;
  226. --- a/generic/bltBitmap.c
  227. +++ b/generic/bltBitmap.c
  228. @@ -887,7 +887,7 @@
  229. ClientData clientData; /* Thread-specific data for bitmaps. */
  230. Tcl_Interp *interp; /* Interpreter to report results to */
  231. int argc; /* Number of arguments */
  232. - char **argv; /* Argument list */
  233. + CONST char **argv; /* Argument list */
  234. {
  235. BitmapInterpData *dataPtr = clientData;
  236. int width, height; /* Dimensions of bitmap */
  237. @@ -934,7 +934,7 @@
  238. ts.leader = 0;
  239. ts.anchor = TK_ANCHOR_CENTER;
  240. - textPtr = Blt_GetTextLayout(argv[3], &ts);
  241. + textPtr = Blt_GetTextLayout((char *)argv[3], &ts);
  242. bitmap = Blt_CreateTextBitmap(tkwin, textPtr, &ts, &width, &height);
  243. Blt_Free(textPtr);
  244. if (bitmap == None) {
  245. @@ -1003,7 +1003,7 @@
  246. ClientData clientData; /* Thread-specific data for bitmaps. */
  247. Tcl_Interp *interp; /* Interpreter to report results to */
  248. int argc; /* Number of arguments */
  249. - char **argv; /* Argument list */
  250. + CONST char **argv; /* Argument list */
  251. {
  252. BitmapInterpData *dataPtr = clientData;
  253. int width, height; /* Dimensions of bitmap */
  254. @@ -1032,7 +1032,7 @@
  255. return TCL_ERROR;
  256. }
  257. /* Skip leading spaces. */
  258. - for (p = argv[3]; isspace(UCHAR(*p)); p++) {
  259. + for (p = (char *)argv[3]; isspace(UCHAR(*p)); p++) {
  260. /*empty*/
  261. }
  262. defn = Blt_Strdup(p);
  263. --- a/generic/bltBusy.c
  264. +++ b/generic/bltBusy.c
  265. @@ -413,7 +413,7 @@
  266. Tcl_Interp *interp;
  267. Busy *busyPtr;
  268. int argc;
  269. - char **argv;
  270. + CONST char **argv;
  271. {
  272. Tk_Cursor oldCursor;
  273. --- a/generic/bltCanvEps.c
  274. +++ b/generic/bltCanvEps.c
  275. @@ -1136,7 +1136,7 @@
  276. Tk_Canvas canvas; /* Canvas containing itemPtr. */
  277. Tk_Item *itemPtr; /* EPS item to reconfigure. */
  278. int argc; /* Number of elements in argv. */
  279. - char **argv; /* Arguments describing things to configure. */
  280. + CONST char **argv; /* Arguments describing things to configure. */
  281. int flags; /* Flags to pass to Tk_ConfigureWidget. */
  282. {
  283. EpsItem *epsPtr = (EpsItem *)itemPtr;
  284. @@ -1282,10 +1282,10 @@
  285. unsigned long gcMask;
  286. GC newGC;
  287. int width, height, i;
  288. - char **argv;
  289. + CONST char **argv;
  290. tkwin = Tk_CanvasTkwin(canvas);
  291. - argv = (char**)ckalloc((argc+1)*sizeof(char*));
  292. + argv = (CONST char **)ckalloc((argc+1)*sizeof(char*));
  293. for (i=0; i<argc; i++) {
  294. argv[i] = Tcl_GetString(objv[i]);
  295. }
  296. --- a/generic/bltConfig.c
  297. +++ b/generic/bltConfig.c
  298. @@ -1545,7 +1545,7 @@
  299. Tk_Window tkwin;
  300. int result;
  301. char *tempName;
  302. - char *oldClass;
  303. + CONST char *oldClass;
  304. int isTemporary = FALSE;
  305. tempName = Blt_Strdup(resName);
  306. @@ -1573,7 +1573,7 @@
  307. Blt_Free(tempName);
  308. Tk_SetClass(tkwin, className);
  309. - result = Blt_ConfigureWidget(interp, tkwin, specsPtr, argc, argv, widgRec,
  310. + result = Blt_ConfigureWidget(interp, tkwin, specsPtr, argc, (CONST char **)argv, widgRec,
  311. flags);
  312. if (isTemporary) {
  313. Tk_DestroyWindow(tkwin);
  314. --- a/generic/bltOldConfig.c
  315. +++ b/generic/bltOldConfig.c
  316. @@ -578,7 +578,7 @@
  317. case TK_CONFIG_CUSTOM:
  318. if ((*specPtr->customPtr->parseProc)(
  319. specPtr->customPtr->clientData, interp, tkwin,
  320. - value, widgRec, specPtr->offset) != TCL_OK) {
  321. + (char *)value, widgRec, specPtr->offset) != TCL_OK) {
  322. return TCL_ERROR;
  323. }
  324. break;
  325. @@ -737,7 +737,7 @@
  326. argv[2] = specPtr->dbClass;
  327. argv[3] = specPtr->defValue;
  328. if (specPtr->type == TK_CONFIG_SYNONYM) {
  329. - return Tcl_Merge(2, argv);
  330. + return Tcl_Merge(2, (char * CONST *)argv);
  331. }
  332. argv[4] = FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer,
  333. &freeProc);
  334. @@ -768,10 +768,10 @@
  335. argv[5] = conftypes[specPtr->type];
  336. - result = Tcl_Merge(6, argv);
  337. + result = Tcl_Merge(6, (char * CONST *)argv);
  338. } else {
  339. - result = Tcl_Merge(5, argv);
  340. + result = Tcl_Merge(5, (char * CONST *)argv);
  341. }
  342. if (freeProc != NULL) {
  343. if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
  344. --- a/generic/bltContainer.c
  345. +++ b/generic/bltContainer.c
  346. @@ -1185,7 +1185,7 @@
  347. * may not already have values for
  348. * some fields. */
  349. int argc;
  350. - char **argv;
  351. + CONST char **argv;
  352. int flags;
  353. {
  354. XGCValues gcValues;
  355. --- a/generic/bltDragdrop.c
  356. +++ b/generic/bltDragdrop.c
  357. @@ -452,9 +452,9 @@
  358. static void SourceEventProc _ANSI_ARGS_((ClientData clientData,
  359. XEvent *eventPtr));
  360. static int ConfigureSource _ANSI_ARGS_((Tcl_Interp *interp, Source * srcPtr,
  361. - int argc, char **argv, int flags));
  362. + int argc, CONST char **argv, int flags));
  363. static int ConfigureToken _ANSI_ARGS_((Tcl_Interp *interp, Source * srcPtr,
  364. - int argc, char **argv));
  365. + int argc, CONST char **argv));
  366. static Target *CreateTarget _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin));
  367. static Target *FindTarget _ANSI_ARGS_((Tk_Window tkwin));
  368. @@ -1060,7 +1060,7 @@
  369. Tcl_Interp *interp;
  370. Source *srcPtr;
  371. int argc;
  372. - char **argv;
  373. + CONST char **argv;
  374. {
  375. Token *tokenPtr;
  376. @@ -1069,7 +1069,7 @@
  377. (char *)tokenPtr, TK_CONFIG_ARGV_ONLY) != TCL_OK) {
  378. return TCL_ERROR;
  379. }
  380. - return ConfigureSource(interp, srcPtr, 0, (char **)NULL,
  381. + return ConfigureSource(interp, srcPtr, 0, (CONST char **)NULL,
  382. TK_CONFIG_ARGV_ONLY);
  383. }
  384. @@ -1161,7 +1161,7 @@
  385. srcPtr->token.borderWidth = srcPtr->token.activeBorderWidth = 3;
  386. srcPtr->hashPtr = hPtr;
  387. Blt_InitHashTable(&(srcPtr->handlerTable), BLT_STRING_KEYS);
  388. - if (ConfigureSource(interp, srcPtr, 0, (char **)NULL, 0) != TCL_OK) {
  389. + if (ConfigureSource(interp, srcPtr, 0, (CONST char **)NULL, 0) != TCL_OK) {
  390. DestroySource(srcPtr);
  391. return NULL;
  392. }
  393. @@ -1280,7 +1280,7 @@
  394. Tcl_Interp *interp; /* current interpreter */
  395. register Source *srcPtr; /* drag&drop source widget record */
  396. int argc; /* number of arguments */
  397. - char **argv; /* argument strings */
  398. + CONST char **argv; /* argument strings */
  399. int flags; /* flags controlling interpretation */
  400. {
  401. unsigned long gcMask;
  402. @@ -2332,11 +2332,11 @@
  403. TokenOp(interp, argc, argv)
  404. Tcl_Interp *interp;
  405. int argc;
  406. - char **argv;
  407. + CONST char **argv;
  408. {
  409. Source *srcPtr;
  410. - if (GetSource(interp, argv[2], &srcPtr) != TCL_OK) {
  411. + if (GetSource(interp, (char *)argv[2], &srcPtr) != TCL_OK) {
  412. return TCL_ERROR;
  413. }
  414. if ((argc > 3) &&
  415. @@ -2408,7 +2408,7 @@
  416. SourceOp(interp, argc, argv)
  417. Tcl_Interp *interp;
  418. int argc;
  419. - char **argv;
  420. + CONST char **argv;
  421. {
  422. Source *srcPtr;
  423. int isNew;
  424. @@ -2429,7 +2429,7 @@
  425. /*
  426. * Find or create source info...
  427. */
  428. - srcPtr = CreateSource(interp, argv[2], &isNew);
  429. + srcPtr = CreateSource(interp, (char *)argv[2], &isNew);
  430. if (srcPtr == NULL) {
  431. return TCL_ERROR;
  432. }
  433. --- a/generic/bltHierbox.c
  434. +++ b/generic/bltHierbox.c
  435. @@ -1088,7 +1088,7 @@
  436. static void EventuallyInvokeSelectCmd _ANSI_ARGS_((Hierbox *hboxPtr));
  437. static int ComputeVisibleEntries _ANSI_ARGS_((Hierbox *hboxPtr));
  438. static int ConfigureEntry _ANSI_ARGS_((Hierbox *hboxPtr, Entry * entryPtr,
  439. - int argc, char **argv, int flags));
  440. + int argc, CONST char **argv, int flags));
  441. static void ComputeLayout _ANSI_ARGS_((Hierbox *hboxPtr));
  442. static CompareProc ExactCompare, GlobCompare, RegexpCompare;
  443. @@ -2064,7 +2064,7 @@
  444. }
  445. entryPtr->labelText = Blt_Strdup(name);
  446. - if (ConfigureEntry(hboxPtr, entryPtr, 0, (char **)NULL, 0) != TCL_OK) {
  447. + if (ConfigureEntry(hboxPtr, entryPtr, 0, (CONST char **)NULL, 0) != TCL_OK) {
  448. DestroyEntry(entryPtr);
  449. return NULL;
  450. }
  451. @@ -3309,7 +3309,7 @@
  452. Hierbox *hboxPtr;
  453. Entry *entryPtr;
  454. int argc;
  455. - char **argv;
  456. + CONST char **argv;
  457. int flags;
  458. {
  459. GC newGC;
  460. @@ -3926,7 +3926,7 @@
  461. Hierbox *hboxPtr; /* Information about widget; may or may not
  462. * already have values for some fields. */
  463. int argc;
  464. - char **argv;
  465. + CONST char **argv;
  466. int flags;
  467. {
  468. XGCValues gcValues;
  469. @@ -5493,7 +5493,7 @@
  470. Hierbox *hboxPtr;
  471. Tcl_Interp *interp;
  472. int argc;
  473. - char **argv;
  474. + CONST char **argv;
  475. {
  476. /* Figure out where the option value pairs begin */
  477. argc -= 3;
  478. @@ -5829,7 +5829,7 @@
  479. char **argv;
  480. {
  481. int nIds, nOpts;
  482. - char **options;
  483. + CONST char **options;
  484. register int i;
  485. Tree *treePtr;
  486. @@ -5847,7 +5847,7 @@
  487. }
  488. nIds = i; /* Number of element names specified */
  489. nOpts = argc - i; /* Number of options specified */
  490. - options = argv + i; /* Start of options in argv */
  491. + options = (CONST char **)argv + i; /* Start of options in argv */
  492. for (i = 0; i < nIds; i++) {
  493. StringToNode(hboxPtr, argv[i], &treePtr);
  494. @@ -7204,7 +7204,7 @@
  495. Tcl_DString dString;
  496. register int i, l;
  497. int nOpts;
  498. - char **options;
  499. + CONST char **options;
  500. char **nameArr;
  501. rootPtr = hboxPtr->rootPtr;
  502. @@ -7230,7 +7230,7 @@
  503. }
  504. }
  505. nOpts = argc - count;
  506. - options = argv + count;
  507. + options = (CONST char **)argv + count;
  508. Tcl_DStringInit(&dString);
  509. for (i = 0; i < count; i++) {
  510. --- a/generic/bltHtext.c
  511. +++ b/generic/bltHtext.c
  512. @@ -3948,7 +3948,7 @@
  513. HText *htPtr; /* Hypertext widget */
  514. Tcl_Interp *interp; /* Interpreter associated with widget */
  515. int argc; /* Number of arguments. */
  516. - char **argv; /* Argument strings. */
  517. + CONST char **argv; /* Argument strings. */
  518. {
  519. Line *linePtr;
  520. EmbeddedWidget *winPtr;
  521. @@ -4092,7 +4092,7 @@
  522. HText *htPtr;
  523. Tcl_Interp *interp;
  524. int argc;
  525. - char **argv;
  526. + CONST char **argv;
  527. {
  528. char *itemPtr;
  529. Tk_ConfigSpec *specsPtr;
  530. @@ -4531,7 +4531,7 @@
  531. Itk_SetWidgetCommand(htPtr->tkwin, htPtr->cmdToken);
  532. #endif
  533. if ((Blt_ConfigureWidget(interp, htPtr->tkwin, configSpecs, argc - 2,
  534. - argv + 2, (char *)htPtr, 0) != TCL_OK) ||
  535. + (CONST char **)argv + 2, (char *)htPtr, 0) != TCL_OK) ||
  536. (ConfigureText(interp, htPtr) != TCL_OK)) {
  537. Tk_DestroyWindow(htPtr->tkwin);
  538. return TCL_ERROR;
  539. --- a/generic/bltTable.c
  540. +++ b/generic/bltTable.c
  541. @@ -1181,7 +1181,7 @@
  542. Tcl_Interp *interp;
  543. Entry *entryPtr;
  544. int argc; /* Option-value arguments */
  545. - char **argv;
  546. + CONST char **argv;
  547. {
  548. int oldRowSpan, oldColSpan;
  549. @@ -1533,7 +1533,7 @@
  550. PartitionInfo *infoPtr;
  551. char *pattern;
  552. int argc;
  553. - char **argv;
  554. + CONST char **argv;
  555. {
  556. RowColumn *rcPtr;
  557. register Blt_ChainLink *linkPtr;
  558. @@ -1852,7 +1852,7 @@
  559. Table *tablePtr; /* Table to be configured */
  560. Tcl_Interp *interp; /* Interpreter to report results back to */
  561. int argc;
  562. - char **argv; /* Option-value pairs */
  563. + CONST char **argv; /* Option-value pairs */
  564. {
  565. if (argc == 0) {
  566. return Tk_ConfigureInfo(interp, tablePtr->tkwin, tableConfigSpecs,
  567. @@ -2179,7 +2179,7 @@
  568. Tk_Window tkwin;
  569. int row, column;
  570. int argc;
  571. - char **argv;
  572. + CONST char **argv;
  573. {
  574. Entry *entryPtr;
  575. int result = TCL_OK;
  576. --- a/generic/bltTabnotebook.c
  577. +++ b/generic/bltTabnotebook.c
  578. @@ -2758,7 +2758,7 @@
  579. * may not already have values for
  580. * some fields. */
  581. int argc;
  582. - char **argv;
  583. + CONST char **argv;
  584. int flags;
  585. {
  586. XGCValues gcValues;
  587. @@ -3155,7 +3155,7 @@
  588. Notebook *nbPtr;
  589. Tcl_Interp *interp;
  590. int argc; /* Not used. */
  591. - char **argv;
  592. + CONST char **argv;
  593. {
  594. Tab *tabPtr;
  595. Blt_ChainLink *linkPtr, *beforeLinkPtr;
  596. @@ -3193,7 +3193,7 @@
  597. }
  598. lastNotebookInstance = nbPtr;
  599. if (Blt_ConfigureWidgetComponent(interp, nbPtr->tkwin, tabPtr->name,
  600. - "Tab", tabConfigSpecs, argc - 3, argv + 3, (char *)tabPtr, 0)
  601. + "Tab", tabConfigSpecs, argc - 3, (char **)argv + 3, (char *)tabPtr, 0)
  602. != TCL_OK) {
  603. DestroyTab(nbPtr, tabPtr);
  604. return TCL_ERROR;
  605. @@ -3658,10 +3658,10 @@
  606. Notebook *nbPtr;
  607. Tcl_Interp *interp;
  608. int argc;
  609. - char **argv;
  610. + CONST char **argv;
  611. {
  612. int nTabs, nOpts, result;
  613. - char **options;
  614. + CONST char **options;
  615. register int i;
  616. Tab *tabPtr;
  617. --- a/generic/bltTabset.c
  618. +++ b/generic/bltTabset.c
  619. @@ -3154,7 +3154,7 @@
  620. * may not already have values for
  621. * some fields. */
  622. int argc,
  623. - char **argv,
  624. + CONST char **argv,
  625. int flags)
  626. {
  627. XGCValues gcValues;
  628. @@ -3404,7 +3404,7 @@
  629. Tabset *setPtr,
  630. Tcl_Interp *interp,
  631. int argc,
  632. - char **argv)
  633. + CONST char **argv)
  634. {
  635. tabSet = setPtr;
  636. if (argc == 2) {
  637. @@ -3665,7 +3665,7 @@
  638. } else {
  639. Tab *beforePtr;
  640. - if (GetTabByIndName(setPtr, argv[2], &beforePtr)
  641. + if (GetTabByIndName(setPtr, (char *)argv[2], &beforePtr)
  642. != TCL_OK) {
  643. result = TCL_ERROR;
  644. goto finish;
  645. @@ -4415,10 +4415,10 @@
  646. Tabset *setPtr;
  647. Tcl_Interp *interp;
  648. int argc;
  649. - char **argv;
  650. + CONST char **argv;
  651. {
  652. int nTabs, nOpts, result;
  653. - char **options;
  654. + CONST char **options;
  655. register int i;
  656. Tab *tabPtr;
  657. @@ -6844,7 +6844,7 @@
  658. return TCL_ERROR;
  659. }
  660. setPtr = CreateTabset(interp, tkwin);
  661. - if (ConfigureTabset(interp, setPtr, argc - 2, argv + 2, 0) != TCL_OK) {
  662. + if (ConfigureTabset(interp, setPtr, argc - 2, (CONST char **)argv + 2, 0) != TCL_OK) {
  663. Tk_DestroyWindow(setPtr->tkwin);
  664. return TCL_ERROR;
  665. }
  666. --- a/generic/bltTreeViewCmd.c
  667. +++ b/generic/bltTreeViewCmd.c
  668. @@ -5186,8 +5186,8 @@
  669. char *string, *subPath;
  670. int nLen, idx, useid, oLen;
  671. int sobjc, tobjc;
  672. - Tcl_Obj *CONST *sobjv;
  673. - Tcl_Obj *CONST *tobjv;
  674. + Tcl_Obj **sobjv;
  675. + Tcl_Obj **tobjv;
  676. TreeViewStyle *stylePtr;
  677. TreeViewColumn *columnPtr;
  678. TreeViewEntry *entryPtr;
  679. --- a/generic/bltUnixDnd.c
  680. +++ b/generic/bltUnixDnd.c
  681. @@ -620,7 +620,7 @@
  682. static void DestroyDnd _ANSI_ARGS_((DestroyData data));
  683. static int DndEventProc _ANSI_ARGS_((ClientData clientData, XEvent *eventPtr));
  684. static int ConfigureToken _ANSI_ARGS_((Tcl_Interp *interp, Dnd *dndPtr,
  685. - int argc, char **argv, int flags));
  686. + int argc, CONST char **argv, int flags));
  687. static Winfo *OverTarget _ANSI_ARGS_((Dnd *dndPtr));
  688. static void AddTargetProperty _ANSI_ARGS_((Dnd *dndPtr));
  689. @@ -1825,7 +1825,7 @@
  690. Tcl_Interp *interp; /* current interpreter */
  691. Dnd *dndPtr; /* Drag&drop source widget record */
  692. int argc; /* number of arguments */
  693. - char **argv; /* argument strings */
  694. + CONST char **argv; /* argument strings */
  695. int flags; /* flags controlling interpretation */
  696. {
  697. GC newGC;
  698. @@ -3761,12 +3761,12 @@
  699. ClientData clientData; /* Thread-specific data. */
  700. Tcl_Interp *interp; /* current interpreter */
  701. int argc; /* number of arguments */
  702. - char **argv; /* argument strings */
  703. + CONST char **argv; /* argument strings */
  704. {
  705. Dnd *dndPtr;
  706. int flags;
  707. - if (GetDnd(clientData, interp, argv[2], &dndPtr) != TCL_OK) {
  708. + if (GetDnd(clientData, interp, (char *)argv[2], &dndPtr) != TCL_OK) {
  709. return TCL_ERROR;
  710. }
  711. flags = TK_CONFIG_ARGV_ONLY;
  712. @@ -4418,7 +4418,7 @@
  713. ClientData clientData;
  714. Tcl_Interp *interp;
  715. int argc;
  716. - char **argv;
  717. + CONST char **argv;
  718. {
  719. DndInterpData *dataPtr = clientData;
  720. Tk_Window tkwin;
  721. @@ -4462,12 +4462,12 @@
  722. ClientData clientData; /* Thread-specific data. */
  723. Tcl_Interp *interp;
  724. int argc;
  725. - char **argv;
  726. + CONST char **argv;
  727. {
  728. Dnd *dndPtr;
  729. int flags;
  730. - if (GetDnd(clientData, interp, argv[3], &dndPtr) != TCL_OK) {
  731. + if (GetDnd(clientData, interp, (char *)argv[3], &dndPtr) != TCL_OK) {
  732. return TCL_ERROR;
  733. }
  734. flags = 0;
  735. @@ -4529,13 +4529,13 @@
  736. ClientData clientData; /* Thread-specific data. */
  737. Tcl_Interp *interp;
  738. int argc;
  739. - char **argv;
  740. + CONST char **argv;
  741. {
  742. Token *tokenPtr;
  743. Dnd *dndPtr;
  744. int flags;
  745. - if (GetDnd(clientData, interp, argv[3], &dndPtr) != TCL_OK) {
  746. + if (GetDnd(clientData, interp, (char *)argv[3], &dndPtr) != TCL_OK) {
  747. return TCL_ERROR;
  748. }
  749. flags = TK_CONFIG_ARGV_ONLY;
  750. --- a/generic/tkButton.c
  751. +++ b/generic/tkButton.c
  752. @@ -855,7 +855,7 @@
  753. Tcl_Interp *interp, int argc, char **argv));
  754. static void ComputeButtonGeometry _ANSI_ARGS_((Button *butPtr));
  755. static int ConfigureButton _ANSI_ARGS_((Tcl_Interp *interp,
  756. - Button *butPtr, int argc, char **argv,
  757. + Button *butPtr, int argc, CONST char **argv,
  758. int flags));
  759. static void DestroyButton _ANSI_ARGS_((Button *butPtr));
  760. static void DisplayButton _ANSI_ARGS_((ClientData clientData));
  761. @@ -1305,7 +1305,7 @@
  762. Tk_CreateEventHandler(butPtr->tkwin,
  763. ExposureMask | StructureNotifyMask | FocusChangeMask,
  764. ButtonEventProc, butPtr);
  765. - if (ConfigureButton(interp, butPtr, argc - 2, argv + 2,
  766. + if (ConfigureButton(interp, butPtr, argc - 2, (CONST char **)argv + 2,
  767. configFlags[type]) != TCL_OK) {
  768. Tk_DestroyWindow(butPtr->tkwin);
  769. return TCL_ERROR;
  770. @@ -1337,7 +1337,7 @@
  771. value = Tcl_GetString(valuePtr);
  772. }
  773. }
  774. - return value;
  775. + return (char *)value;
  776. }
  777. static int ButtonSetValue(Button *butPtr, char *value, int warn) {
  778. @@ -1427,7 +1427,7 @@
  779. (char *)butPtr, argv[2],
  780. configFlags[butPtr->type]);
  781. } else {
  782. - result = ConfigureButton(interp, butPtr, argc - 2, argv + 2,
  783. + result = ConfigureButton(interp, butPtr, argc - 2, (CONST char **)argv + 2,
  784. configFlags[butPtr->type] | TK_CONFIG_ARGV_ONLY);
  785. }
  786. } else if ((c == 'd') && (strncmp(argv[1], "deselect", length) == 0)
  787. @@ -1694,7 +1694,7 @@
  788. register Button *butPtr; /* Information about widget; may or may
  789. * not already have values for some fields. */
  790. int argc; /* Number of valid entries in argv. */
  791. - char **argv; /* Arguments. */
  792. + CONST char **argv; /* Arguments. */
  793. int flags; /* Flags to pass to Tk_ConfigureWidget. */
  794. {
  795. XGCValues gcValues;
  796. --- a/generic/tkFrame.c
  797. +++ b/generic/tkFrame.c
  798. @@ -734,7 +734,7 @@
  799. #endif /* TK_MAJOR_VERSION > 4 */
  800. if (Tk_ConfigureWidget(interp, framePtr->tkwin, configSpecs,
  801. - argc, argv, (char *)framePtr, flags | framePtr->mask) != TCL_OK) {
  802. + argc, (CONST char **)argv, (char *)framePtr, flags | framePtr->mask) != TCL_OK) {
  803. return TCL_ERROR;
  804. }
  805. if (framePtr->tile != NULL) {
  806. --- a/generic/bltScrollbar.c
  807. +++ b/generic/bltScrollbar.c
  808. @@ -301,7 +301,7 @@
  809. static void ComputeScrollbarGeometry _ANSI_ARGS_((
  810. Scrollbar *scrollPtr));
  811. static int ConfigureScrollbar _ANSI_ARGS_((Tcl_Interp *interp,
  812. - Scrollbar *scrollPtr, int argc, char **argv,
  813. + Scrollbar *scrollPtr, int argc, CONST char **argv,
  814. int flags));
  815. static void DestroyScrollbar _ANSI_ARGS_((DestroyData *memPtr));
  816. static void DisplayScrollbar _ANSI_ARGS_((ClientData clientData));
  817. @@ -434,7 +434,7 @@
  818. Tk_CreateEventHandler(scrollPtr->tkwin,
  819. ExposureMask | StructureNotifyMask | FocusChangeMask,
  820. ScrollbarEventProc, (ClientData)scrollPtr);
  821. - if (ConfigureScrollbar(interp, scrollPtr, argc - 2, argv + 2, 0) != TCL_OK) {
  822. + if (ConfigureScrollbar(interp, scrollPtr, argc - 2, (CONST char **)argv + 2, 0) != TCL_OK) {
  823. goto error;
  824. }
  825. Tcl_SetResult(interp, Tk_PathName(scrollPtr->tkwin), TCL_VOLATILE);
  826. @@ -558,7 +558,7 @@
  827. result = Tk_ConfigureInfo(interp, scrollPtr->tkwin, configSpecs,
  828. (char *)scrollPtr, argv[2], 0);
  829. } else {
  830. - result = ConfigureScrollbar(interp, scrollPtr, argc - 2, argv + 2,
  831. + result = ConfigureScrollbar(interp, scrollPtr, argc - 2, (CONST char **)argv + 2,
  832. TK_CONFIG_ARGV_ONLY);
  833. }
  834. } else if ((c == 'd') && (strncmp(argv[1], "delta", length) == 0)) {
  835. @@ -904,7 +904,7 @@
  836. * may not already have values for
  837. * some fields. */
  838. int argc; /* Number of valid entries in argv. */
  839. - char **argv; /* Arguments. */
  840. + CONST char **argv; /* Arguments. */
  841. int flags; /* Flags to pass to
  842. * Tk_ConfigureWidget. */
  843. {
  844. --- a/generic/bltTed.c
  845. +++ b/generic/bltTed.c
  846. @@ -819,7 +819,7 @@
  847. ConfigureTed(tedPtr, argc, argv, flags)
  848. Ted *tedPtr;
  849. int argc;
  850. - char **argv; /* Option-value pairs */
  851. + CONST char **argv; /* Option-value pairs */
  852. int flags;
  853. {
  854. XGCValues gcValues;