summaryrefslogtreecommitdiffstats
path: root/generic/tk3d.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tk3d.c')
-rw-r--r--generic/tk3d.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c
index 9ed419a..faa12b7 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -90,7 +90,7 @@ Tk_Alloc3DBorderFromObj(
if (objPtr->typePtr != &tkBorderObjType) {
InitBorderObj(objPtr);
}
- borderPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1;
/*
* If the object currently points to a TkBorder, see if it's the one we
@@ -127,7 +127,7 @@ Tk_Alloc3DBorderFromObj(
*/
if (borderPtr != NULL) {
- TkBorder *firstBorderPtr = Tcl_GetHashValue(borderPtr->hashPtr);
+ TkBorder *firstBorderPtr = (TkBorder *)Tcl_GetHashValue(borderPtr->hashPtr);
FreeBorderObj(objPtr);
for (borderPtr = firstBorderPtr ; borderPtr != NULL;
@@ -200,7 +200,7 @@ Tk_Get3DBorder(
hashPtr = Tcl_CreateHashEntry(&dispPtr->borderTable, colorName, &isNew);
if (!isNew) {
- existingBorderPtr = Tcl_GetHashValue(hashPtr);
+ existingBorderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr);
for (borderPtr = existingBorderPtr; borderPtr != NULL;
borderPtr = borderPtr->nextPtr) {
if ((Tk_Screen(tkwin) == borderPtr->screen)
@@ -420,12 +420,11 @@ Tk_Free3DBorder(
Display *display = DisplayOfScreen(borderPtr->screen);
TkBorder *prevPtr;
- borderPtr->resourceRefCount--;
- if (borderPtr->resourceRefCount > 0) {
+ if (borderPtr->resourceRefCount-- > 1) {
return;
}
- prevPtr = Tcl_GetHashValue(borderPtr->hashPtr);
+ prevPtr = (TkBorder *)Tcl_GetHashValue(borderPtr->hashPtr);
TkpFreeBorder(borderPtr);
if (borderPtr->bgColorPtr != NULL) {
Tk_FreeColor(borderPtr->bgColorPtr);
@@ -527,7 +526,7 @@ static void
FreeBorderObj(
Tcl_Obj *objPtr) /* The object we are releasing. */
{
- TkBorder *borderPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ TkBorder *borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1;
if (borderPtr != NULL) {
borderPtr->objRefCount--;
@@ -562,7 +561,7 @@ DupBorderObjProc(
Tcl_Obj *srcObjPtr, /* The object we are copying from. */
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
- TkBorder *borderPtr = srcObjPtr->internalRep.twoPtrValue.ptr1;
+ TkBorder *borderPtr = (TkBorder *)srcObjPtr->internalRep.twoPtrValue.ptr1;
dupObjPtr->typePtr = srcObjPtr->typePtr;
dupObjPtr->internalRep.twoPtrValue.ptr1 = borderPtr;
@@ -1253,7 +1252,7 @@ Tk_Get3DBorderFromObj(
* cached in the internal representation of the Tcl_Obj. Check it out...
*/
- borderPtr = objPtr->internalRep.twoPtrValue.ptr1;
+ borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1;
if ((borderPtr != NULL)
&& (borderPtr->resourceRefCount > 0)
&& (Tk_Screen(tkwin) == borderPtr->screen)
@@ -1281,7 +1280,7 @@ Tk_Get3DBorderFromObj(
if (hashPtr == NULL) {
goto error;
}
- for (borderPtr = Tcl_GetHashValue(hashPtr); borderPtr != NULL;
+ for (borderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr); borderPtr != NULL;
borderPtr = borderPtr->nextPtr) {
if ((Tk_Screen(tkwin) == borderPtr->screen)
&& (Tk_Colormap(tkwin) == borderPtr->colormap)) {
@@ -1371,7 +1370,7 @@ TkDebugBorder(
resultPtr = Tcl_NewObj();
hashPtr = Tcl_FindHashEntry(&dispPtr->borderTable, name);
if (hashPtr != NULL) {
- TkBorder *borderPtr = Tcl_GetHashValue(hashPtr);
+ TkBorder *borderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr);
if (borderPtr == NULL) {
Tcl_Panic("TkDebugBorder found empty hash table entry");