pointertoint.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. Description: Patch adds explicit casts to intptr_t or uintptr_t types
  2. to prevent casting to/from pointer from/to integers of different size.
  3. Author: Sergei Golovan
  4. Last-Modified: Wed, 09 Jul 2014 19:20:07 +0400
  5. --- a/generic/bltBgexec.c
  6. +++ b/generic/bltBgexec.c
  7. @@ -668,7 +668,7 @@
  8. sinkPtr->name = name;
  9. sinkPtr->echo = FALSE;
  10. sinkPtr->fd = -1;
  11. - sinkPtr->file = (Tcl_File)NULL;
  12. + sinkPtr->file = (Tcl_File)0;
  13. sinkPtr->byteArr = sinkPtr->staticSpace;
  14. sinkPtr->size = DEF_BUFFER_SIZE;
  15. sinkPtr->encoding = encoding;
  16. @@ -726,7 +726,7 @@
  17. Blt_Free(sinkPtr->byteArr);
  18. }
  19. sinkPtr->fd = -1;
  20. - sinkPtr->file = (Tcl_File)NULL;
  21. + sinkPtr->file = (Tcl_File)0;
  22. #if (TCL_MAJOR_VERSION >= 8)
  23. if (sinkPtr->objv != NULL) {
  24. register int i;
  25. @@ -883,7 +883,7 @@
  26. #else
  27. Tcl_DeleteFileHandler(sinkPtr->fd);
  28. #endif
  29. - sinkPtr->file = (Tcl_File)NULL;
  30. + sinkPtr->file = (Tcl_File)0;
  31. sinkPtr->fd = -1;
  32. #if WINDEBUG
  33. --- a/generic/bltTree.c
  34. +++ b/generic/bltTree.c
  35. @@ -424,7 +424,7 @@
  36. TreeDestroyValues(nodePtr);
  37. UnlinkNode(nodePtr);
  38. treeObjPtr->nNodes--;
  39. - hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)nodePtr->inode);
  40. + hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(intptr_t)nodePtr->inode);
  41. assert(hPtr);
  42. Blt_DeleteHashEntry(&treeObjPtr->nodeTable, hPtr);
  43. nodePtr->inode = -1;
  44. @@ -934,7 +934,7 @@
  45. /* Generate an unique serial number for this node. */
  46. do {
  47. inode = treeObjPtr->nextInode++;
  48. - hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode,
  49. + hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(intptr_t)inode,
  50. &isNew);
  51. } while (!isNew);
  52. nodePtr = NewNode(treeObjPtr, name, inode);
  53. @@ -1030,7 +1030,7 @@
  54. int isNew, result;
  55. treeObjPtr = parentPtr->treeObject;
  56. - hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode, &isNew);
  57. + hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(intptr_t)inode, &isNew);
  58. if (!isNew) {
  59. return NULL;
  60. }
  61. @@ -1166,7 +1166,7 @@
  62. TreeObject *treeObjPtr = clientPtr->treeObject;
  63. Blt_HashEntry *hPtr;
  64. - hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)inode);
  65. + hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(intptr_t)inode);
  66. if (hPtr != NULL) {
  67. return (Blt_TreeNode)Blt_GetHashValue(hPtr);
  68. }
  69. @@ -1179,7 +1179,7 @@
  70. {
  71. Blt_HashEntry *hPtr;
  72. - hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)inode);
  73. + hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(intptr_t)inode);
  74. if (hPtr != NULL) {
  75. return (Node*)Blt_GetHashValue(hPtr);
  76. }
  77. --- a/generic/bltTreeCmd.c
  78. +++ b/generic/bltTreeCmd.c
  79. @@ -1641,7 +1641,7 @@
  80. if (parentId == -1) { /* Dump marks root's parent as -1. */
  81. node = dataPtr->root;
  82. /* Create a mapping between the old id and the new node */
  83. - hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
  84. + hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(intptr_t)nodeId,
  85. &isNew);
  86. Blt_SetHashValue(hPtr, node);
  87. Blt_TreeRelabelNode(cmdPtr->tree, node, names[0]);
  88. @@ -1651,7 +1651,7 @@
  89. * This can happen when there's a id collision with an
  90. * existing node.
  91. */
  92. - hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)parentId);
  93. + hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)(intptr_t)parentId);
  94. if (hPtr != NULL) {
  95. parent = Blt_GetHashValue(hPtr);
  96. } else {
  97. @@ -1688,7 +1688,7 @@
  98. if (dataPtr->flags & RESTORE_OVERWRITE &&
  99. ((node = Blt_TreeFindChild(parent, names[nNames - 1])))) {
  100. /* Create a mapping between the old id and the new node */
  101. - hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
  102. + hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(intptr_t)nodeId,
  103. &isNew);
  104. Blt_SetHashValue(hPtr, node);
  105. }
  106. @@ -1698,7 +1698,7 @@
  107. node = Blt_TreeCreateNode(cmdPtr->tree, parent,
  108. names[nNames - 1], -1);
  109. /* Create a mapping between the old id and the new node */
  110. - hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
  111. + hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(intptr_t)nodeId,
  112. &isNew);
  113. Blt_SetHashValue(hPtr, node);
  114. } else {
  115. @@ -2196,7 +2196,7 @@
  116. for (node = Blt_ListFirstNode(patternList); node != NULL;
  117. node = Blt_ListNextNode(node)) {
  118. - type = (int)Blt_ListGetValue(node);
  119. + type = (intptr_t)Blt_ListGetValue(node);
  120. pattern = (char *)Blt_ListGetKey(node);
  121. switch (type) {
  122. case 0:
  123. @@ -3654,7 +3654,7 @@
  124. for (hPtr = Blt_FirstHashEntry(tablePtr, &cursor);
  125. hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
  126. node = Blt_GetHashValue(hPtr);
  127. - Blt_ChainAppend(chainPtr, (ClientData)Blt_TreeNodeId(node));
  128. + Blt_ChainAppend(chainPtr, (ClientData)(intptr_t)Blt_TreeNodeId(node));
  129. }
  130. /*
  131. * Iterate through this list to delete the nodes. By
  132. @@ -3664,7 +3664,7 @@
  133. for (linkPtr = Blt_ChainFirstLink(chainPtr); linkPtr != NULL;
  134. linkPtr = nextPtr) {
  135. nextPtr = Blt_ChainNextLink(linkPtr);
  136. - inode = (int)Blt_ChainGetValue(linkPtr);
  137. + inode = (intptr_t)Blt_ChainGetValue(linkPtr);
  138. node = Blt_TreeGetNode(cmdPtr->tree, inode);
  139. if (node != NULL) {
  140. DeleteNode(cmdPtr, node);
  141. --- a/generic/bltUnixPipe.c
  142. +++ b/generic/bltUnixPipe.c
  143. @@ -508,7 +508,7 @@
  144. * Reap the child process now if an error occurred during its
  145. * startup.
  146. */
  147. - Tcl_WaitPid((Tcl_Pid)pid, &status, WNOHANG);
  148. + Tcl_WaitPid((Tcl_Pid)(intptr_t)pid, &status, WNOHANG);
  149. }
  150. if (errPipeIn >= 0) {
  151. CloseFile(errPipeIn);
  152. --- a/generic/bltUtil.c
  153. +++ b/generic/bltUtil.c
  154. @@ -827,10 +827,10 @@
  155. if (isNew) {
  156. refCount = 0;
  157. } else {
  158. - refCount = (int)Blt_GetHashValue(hPtr);
  159. + refCount = (intptr_t)Blt_GetHashValue(hPtr);
  160. }
  161. refCount++;
  162. - Blt_SetHashValue(hPtr, (ClientData)refCount);
  163. + Blt_SetHashValue(hPtr, (intptr_t)refCount);
  164. return (Blt_Uid)Blt_GetHashKey(&uidTable, hPtr);
  165. }
  166. @@ -864,12 +864,12 @@
  167. if (hPtr) {
  168. int refCount;
  169. - refCount = (int)Blt_GetHashValue(hPtr);
  170. + refCount = (intptr_t)Blt_GetHashValue(hPtr);
  171. refCount--;
  172. if (refCount == 0) {
  173. Blt_DeleteHashEntry(&uidTable, hPtr);
  174. } else {
  175. - Blt_SetHashValue(hPtr, (ClientData)refCount);
  176. + Blt_SetHashValue(hPtr, (intptr_t)refCount);
  177. }
  178. } else {
  179. fprintf(stderr, "tried to release unknown identifier \"%s\"\n", uid);
  180. --- a/generic/bltInit.c
  181. +++ b/generic/bltInit.c
  182. @@ -514,7 +514,7 @@
  183. int dostub = 0;
  184. #endif
  185. - flags = (int)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
  186. + flags = (intptr_t)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
  187. if ((flags & BLT_TCL_CMDS) == 0) {
  188. register Tcl_AppInitProc **p;
  189. Tcl_Namespace *nsPtr;
  190. @@ -573,7 +573,7 @@
  191. }
  192. #endif
  193. Tcl_SetAssocData(interp, BLT_THREAD_KEY, NULL,
  194. - (ClientData)(flags | BLT_TCL_CMDS));
  195. + (ClientData)(intptr_t)(flags | BLT_TCL_CMDS));
  196. }
  197. #ifndef TCL_ONLY
  198. if ((flags & BLT_TK_CMDS) == 0) {
  199. @@ -609,7 +609,7 @@
  200. }
  201. Blt_InitEpsCanvasItem(interp);
  202. Tcl_SetAssocData(interp, BLT_THREAD_KEY, NULL,
  203. - (ClientData)(flags | BLT_TK_CMDS));
  204. + (ClientData)(intptr_t)(flags | BLT_TK_CMDS));
  205. }
  206. #endif
  207. return TCL_OK;
  208. --- a/generic/bltGrAxis.c
  209. +++ b/generic/bltGrAxis.c
  210. @@ -669,7 +669,7 @@
  211. char *widgRec; /* Pointer to structure record. */
  212. int offset; /* Offset of field in structure. */
  213. {
  214. - unsigned int mask = (unsigned int)clientData;
  215. + unsigned int mask = (uintptr_t)clientData;
  216. Axis *axisPtr = (Axis *)widgRec;
  217. Ticks **ticksPtrPtr = (Ticks **) (widgRec + offset);
  218. int nTicks;
  219. @@ -3687,7 +3687,7 @@
  220. int margin;
  221. /* TODO: fix bug where "$g xaxis x2" leaves x unavailable. */
  222. - margin = (int)argv[-1];
  223. + margin = (intptr_t)argv[-1];
  224. chainPtr = graphPtr->margins[margin].axes;
  225. if (argc == 0) {
  226. for (linkPtr = Blt_ChainFirstLink(chainPtr); linkPtr!= NULL;
  227. @@ -4231,7 +4231,7 @@
  228. return TCL_ERROR;
  229. }
  230. if (proc == UseOp) {
  231. - argv[2] = (char *)margin; /* Hack. Slide a reference to the margin in
  232. + argv[2] = (char *)(intptr_t)margin; /* Hack. Slide a reference to the margin in
  233. * the argument list. Needed only for UseOp.
  234. */
  235. result = (*proc)(graphPtr, NULL, argc - 3, argv +3);
  236. --- a/generic/bltGrBar.c
  237. +++ b/generic/bltGrBar.c
  238. @@ -2197,13 +2197,13 @@
  239. if (isNew) {
  240. count = 1;
  241. } else {
  242. - count = (int)Blt_GetHashValue(hPtr);
  243. + count = (intptr_t)Blt_GetHashValue(hPtr);
  244. if (count == 1) {
  245. nStacks++;
  246. }
  247. count++;
  248. }
  249. - Blt_SetHashValue(hPtr, (ClientData)count);
  250. + Blt_SetHashValue(hPtr, (ClientData)(intptr_t)count);
  251. }
  252. }
  253. if (nSegs == 0) {
  254. @@ -2219,12 +2219,12 @@
  255. infoPtr = graphPtr->freqArr;
  256. for (hPtr = Blt_FirstHashEntry(&freqTable, &cursor); hPtr != NULL;
  257. hPtr = Blt_NextHashEntry(&cursor)) {
  258. - count = (int)Blt_GetHashValue(hPtr);
  259. + count = (intptr_t)Blt_GetHashValue(hPtr);
  260. keyPtr = (FreqKey *)Blt_GetHashKey(&freqTable, hPtr);
  261. if (count > 1) {
  262. h2Ptr = Blt_CreateHashEntry(&(graphPtr->freqTable),
  263. (char *)keyPtr, &isNew);
  264. - count = (int)Blt_GetHashValue(hPtr);
  265. + count = (intptr_t)Blt_GetHashValue(hPtr);
  266. infoPtr->freq = count;
  267. infoPtr->axes = keyPtr->axes;
  268. Blt_SetHashValue(h2Ptr, infoPtr);
  269. --- a/generic/bltGrMisc.c
  270. +++ b/generic/bltGrMisc.c
  271. @@ -260,7 +260,7 @@
  272. {
  273. ColorPair *pairPtr = (ColorPair *)(widgRec + offset);
  274. ColorPair sample;
  275. - int allowDefault = (int)clientData;
  276. + int allowDefault = (intptr_t)clientData;
  277. sample.fgColor = sample.bgColor = NULL;
  278. if ((string != NULL) && (*string != '\0')) {
  279. --- a/generic/bltConfig.c
  280. +++ b/generic/bltConfig.c
  281. @@ -442,7 +442,7 @@
  282. char *widgRec; /* Cubicle structure record */
  283. int offset; /* Offset of style in record */
  284. {
  285. - unsigned int mask = (unsigned int)clientData; /* Bit to be tested */
  286. + unsigned int mask = (uintptr_t)clientData; /* Bit to be tested */
  287. int *flagPtr = (int *)(widgRec + offset);
  288. int bool;
  289. @@ -478,7 +478,7 @@
  290. int offset; /* Offset of fill in widget record */
  291. Tcl_FreeProc **freeProcPtr; /* Not Used. */
  292. {
  293. - unsigned int mask = (unsigned int)clientData; /* Bit to be tested */
  294. + unsigned int mask = (uintptr_t)clientData; /* Bit to be tested */
  295. unsigned int bool = *(unsigned int *)(widgRec + offset);
  296. return (bool & mask) ? "1" : "0";
  297. @@ -559,7 +559,7 @@
  298. int offset; /* Offset of pixel size in record */
  299. {
  300. int *valuePtr = (int *)(widgRec + offset);
  301. - return Blt_GetPixels(interp, tkwin, string, (int)clientData, valuePtr);
  302. + return Blt_GetPixels(interp, tkwin, string, (intptr_t)clientData, valuePtr);
  303. }
  304. /*
  305. @@ -648,7 +648,7 @@
  306. int offset; /* Offset of pixel size in record */
  307. {
  308. int *valuePtr = (int *)(widgRec + offset);
  309. - return Blt_GetInt(interp, string, (int)clientData, valuePtr);
  310. + return Blt_GetInt(interp, string, (intptr_t)clientData, valuePtr);
  311. }
  312. /*
  313. --- a/generic/bltContainer.c
  314. +++ b/generic/bltContainer.c
  315. @@ -822,7 +822,7 @@
  316. char *widgRec; /* Widget record */
  317. int offset; /* Offset to field in structure */
  318. {
  319. - unsigned int flags = (int)clientData;
  320. + unsigned int flags = (uintptr_t)clientData;
  321. Container *cntrPtr = (Container *)widgRec;
  322. Window *winPtr = (Window *) (widgRec + offset);
  323. Tk_Window tkAdopted;
  324. --- a/generic/bltHierbox.c
  325. +++ b/generic/bltHierbox.c
  326. @@ -2077,7 +2077,7 @@
  327. /* Generate a unique node serial number. */
  328. do {
  329. serial = hboxPtr->nextSerial++;
  330. - hPtr = Blt_CreateHashEntry(&(hboxPtr->nodeTable), (char *)serial,
  331. + hPtr = Blt_CreateHashEntry(&(hboxPtr->nodeTable), (char *)(intptr_t)serial,
  332. &isNew);
  333. } while (!isNew);
  334. Blt_SetHashValue(hPtr, treePtr);
  335. @@ -2372,7 +2372,7 @@
  336. if (Tcl_GetInt(NULL, string, &serial) == TCL_OK) {
  337. Blt_HashEntry *hPtr;
  338. - hPtr = Blt_FindHashEntry(&(hboxPtr->nodeTable), (char *)serial);
  339. + hPtr = Blt_FindHashEntry(&(hboxPtr->nodeTable), (char *)(intptr_t)serial);
  340. if (hPtr != NULL) {
  341. return (Tree *) Blt_GetHashValue(hPtr);
  342. }
  343. @@ -2406,7 +2406,7 @@
  344. int serial;
  345. /* Node table keys are integers. Convert them to strings. */
  346. - serial = (int)Blt_GetHashKey(&(hboxPtr->nodeTable),
  347. + serial = (intptr_t)Blt_GetHashKey(&(hboxPtr->nodeTable),
  348. nodePtr->entryPtr->hashPtr);
  349. sprintf(string, "%d", serial);
  350. --- a/generic/bltUnixImage.c
  351. +++ b/generic/bltUnixImage.c
  352. @@ -574,7 +574,7 @@
  353. destPtr = Blt_ColorImageBits(image);
  354. endPtr = destPtr + nPixels;
  355. for (/* empty */; destPtr < endPtr; destPtr++) {
  356. - hPtr = Blt_FindHashEntry(&pixelTable, (char *)destPtr->value);
  357. + hPtr = Blt_FindHashEntry(&pixelTable, (char *)(intptr_t)destPtr->value);
  358. colorPtr = (XColor *)Blt_GetHashValue(hPtr);
  359. destPtr->Red = lut[colorPtr->red >> 8];
  360. destPtr->Green = lut[colorPtr->green >> 8];
  361. --- a/generic/bltTable.c
  362. +++ b/generic/bltTable.c
  363. @@ -2034,7 +2034,7 @@
  364. key = 0; /* Initialize key to bogus span */
  365. for (node = Blt_ListFirstNode(list); node != NULL;
  366. node = Blt_ListNextNode(node)) {
  367. - key = (int)Blt_ListGetKey(node);
  368. + key = (intptr_t)Blt_ListGetKey(node);
  369. if (entryPtr->row.span <= key) {
  370. break;
  371. }
  372. @@ -2046,7 +2046,7 @@
  373. * Create a new list (bucket) to hold entries of that size
  374. * span and and link it into the list of buckets.
  375. */
  376. - newNode = Blt_ListCreateNode(list, (char *)entryPtr->row.span);
  377. + newNode = Blt_ListCreateNode(list, (char *)(intptr_t)entryPtr->row.span);
  378. Blt_ListSetValue(newNode, (char *)Blt_ChainCreate());
  379. Blt_ListLinkBefore(list, newNode, node);
  380. node = newNode;
  381. @@ -2063,7 +2063,7 @@
  382. key = 0;
  383. for (node = Blt_ListFirstNode(list); node != NULL;
  384. node = Blt_ListNextNode(node)) {
  385. - key = (int)Blt_ListGetKey(node);
  386. + key = (intptr_t)Blt_ListGetKey(node);
  387. if (entryPtr->column.span <= key) {
  388. break;
  389. }
  390. @@ -2075,7 +2075,7 @@
  391. * Create a new list (bucket) to hold entries of that size
  392. * span and and link it into the list of buckets.
  393. */
  394. - newNode = Blt_ListCreateNode(list, (char *)entryPtr->column.span);
  395. + newNode = Blt_ListCreateNode(list, (char *)(intptr_t)entryPtr->column.span);
  396. Blt_ListSetValue(newNode, (char *)Blt_ChainCreate());
  397. Blt_ListLinkBefore(list, newNode, node);
  398. node = newNode;
  399. --- a/generic/bltTreeView.c
  400. +++ b/generic/bltTreeView.c
  401. @@ -1314,10 +1314,10 @@
  402. if (isNew) {
  403. refCount = 1;
  404. } else {
  405. - refCount = (int)Blt_GetHashValue(hPtr);
  406. + refCount = (intptr_t)Blt_GetHashValue(hPtr);
  407. refCount++;
  408. }
  409. - Blt_SetHashValue(hPtr, (ClientData)refCount);
  410. + Blt_SetHashValue(hPtr, (ClientData)(intptr_t)refCount);
  411. return Blt_GetHashKey(&tvPtr->uidTable, hPtr);
  412. }
  413. @@ -1343,10 +1343,10 @@
  414. hPtr = Blt_FindHashEntry(&tvPtr->uidTable, uid);
  415. assert(hPtr != NULL);
  416. - refCount = (int)Blt_GetHashValue(hPtr);
  417. + refCount = (intptr_t)Blt_GetHashValue(hPtr);
  418. refCount--;
  419. if (refCount > 0) {
  420. - Blt_SetHashValue(hPtr, (ClientData)refCount);
  421. + Blt_SetHashValue(hPtr, (ClientData)(intptr_t)refCount);
  422. } else {
  423. Blt_DeleteHashEntry(&tvPtr->uidTable, hPtr);
  424. }
  425. --- a/generic/bltTreeViewCmd.c
  426. +++ b/generic/bltTreeViewCmd.c
  427. @@ -516,7 +516,7 @@
  428. if ((context == ITEM_ENTRY) ||
  429. (context == ITEM_ENTRY_BUTTON) ||
  430. - ((unsigned int)context >= (unsigned int)ITEM_STYLE)) {
  431. + ((uintptr_t)context >= (uintptr_t)ITEM_STYLE)) {
  432. entryPtr = Blt_GetCurrentItem(tvPtr->bindTable);
  433. }
  434. }
  435. --- a/generic/bltWinop.c
  436. +++ b/generic/bltWinop.c
  437. @@ -980,9 +980,9 @@
  438. if (isNew) {
  439. Blt_SetHashValue(hPtr, 1);
  440. } else {
  441. - cnt = (int)Blt_GetHashValue(hPtr);
  442. + cnt = (intptr_t)Blt_GetHashValue(hPtr);
  443. cnt++;
  444. - Blt_SetHashValue(hPtr, cnt);
  445. + Blt_SetHashValue(hPtr, (intptr_t)cnt);
  446. }
  447. srcPtr++;
  448. }
  449. @@ -994,7 +994,7 @@
  450. Tcl_Obj *objPtr = Tcl_NewStringObj(Blt_GetHashKey(&hTbl, hPtr), -1);
  451. Tcl_ListObjAppendElement(interp, listPtr, objPtr);
  452. if (iscnt) {
  453. - cnt = (int)Blt_GetHashValue(hPtr);
  454. + cnt = (intptr_t)Blt_GetHashValue(hPtr);
  455. sprintf(buf, "%d", cnt);
  456. objPtr = Tcl_NewStringObj(buf, -1);
  457. Tcl_ListObjAppendElement(interp, listPtr, objPtr);
  458. --- a/generic/bltObjConfig.c
  459. +++ b/generic/bltObjConfig.c
  460. @@ -1338,7 +1338,7 @@
  461. if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
  462. return TCL_ERROR;
  463. }
  464. - flag = (unsigned int)specPtr->customPtr;
  465. + flag = (uintptr_t)specPtr->customPtr;
  466. *(int *)ptr &= ~flag;
  467. if (bool) {
  468. *(int *)ptr |= flag;
  469. @@ -1639,7 +1639,7 @@
  470. {
  471. unsigned int flag;
  472. - flag = (*(int *)ptr) & (unsigned int)specPtr->customPtr;
  473. + flag = (*(unsigned int *)ptr) & (uintptr_t)specPtr->customPtr;
  474. return Tcl_NewBooleanObj((flag != 0));
  475. }