summaryrefslogtreecommitdiffstats
path: root/generic/tkBitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkBitmap.c')
-rw-r--r--generic/tkBitmap.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index ad118d3..edd36ad 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -5,8 +5,8 @@
* toolkit. This allows bitmaps to be shared between widgets and also
* avoids interactions with the X server.
*
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1998 Sun Microsystems, Inc.
+ * Copyright © 1990-1994 The Regents of the University of California.
+ * Copyright © 1994-1998 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -125,12 +125,14 @@ static void InitBitmapObj(Tcl_Obj *objPtr);
* field of the Tcl_Obj points to a TkBitmap object.
*/
-const Tcl_ObjType tkBitmapObjType = {
- "bitmap", /* name */
+const TkObjType tkBitmapObjType = {
+ {"bitmap", /* name */
FreeBitmapObjProc, /* freeIntRepProc */
DupBitmapObjProc, /* dupIntRepProc */
NULL, /* updateStringProc */
- NULL /* setFromAnyProc */
+ NULL, /* setFromAnyProc */
+ TCL_OBJTYPE_V0},
+ 0
};
/*
@@ -168,7 +170,7 @@ Tk_AllocBitmapFromObj(
{
TkBitmap *bitmapPtr;
- if (objPtr->typePtr != &tkBitmapObjType) {
+ if (objPtr->typePtr != &tkBitmapObjType.objType) {
InitBitmapObj(objPtr);
}
bitmapPtr = (TkBitmap *)objPtr->internalRep.twoPtrValue.ptr1;
@@ -348,8 +350,8 @@ GetBitmap(
if (Tcl_IsSafe(interp)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't specify bitmap with '@' in a safe interpreter",
- -1));
- Tcl_SetErrorCode(interp, "TK", "SAFE", "BITMAP_FILE", NULL);
+ TCL_INDEX_NONE));
+ Tcl_SetErrorCode(interp, "TK", "SAFE", "BITMAP_FILE", (char *)NULL);
goto error;
}
@@ -371,7 +373,7 @@ GetBitmap(
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"error reading bitmap file \"%s\"", string));
- Tcl_SetErrorCode(interp, "TK", "BITMAP", "FILE_ERROR", NULL);
+ Tcl_SetErrorCode(interp, "TK", "BITMAP", "FILE_ERROR", (char *)NULL);
}
Tcl_DStringFree(&buffer);
goto error;
@@ -394,7 +396,7 @@ GetBitmap(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bitmap \"%s\" not defined", string));
Tcl_SetErrorCode(interp, "TK", "LOOKUP", "BITMAP", string,
- NULL);
+ (char *)NULL);
}
goto error;
}
@@ -498,7 +500,7 @@ Tk_DefineBitmap(
if (!isNew) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bitmap \"%s\" is already defined", name));
- Tcl_SetErrorCode(interp, "TK", "BITMAP", "EXISTS", NULL);
+ Tcl_SetErrorCode(interp, "TK", "BITMAP", "EXISTS", (char *)NULL);
return TCL_ERROR;
}
predefPtr = (TkPredefBitmap *)ckalloc(sizeof(TkPredefBitmap));
@@ -540,7 +542,7 @@ Tk_NameOfBitmap(
Tcl_Panic("Tk_NameOfBitmap received unknown bitmap argument");
}
- idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, (char *) bitmap);
+ idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, bitmap);
if (idHashPtr == NULL) {
goto unknown;
}
@@ -582,7 +584,7 @@ Tk_SizeOfBitmap(
Tcl_Panic("Tk_SizeOfBitmap received unknown bitmap argument");
}
- idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, (char *) bitmap);
+ idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, bitmap);
if (idHashPtr == NULL) {
goto unknownBitmap;
}
@@ -670,7 +672,7 @@ Tk_FreeBitmap(
Tcl_Panic("Tk_FreeBitmap called before Tk_GetBitmap");
}
- idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, (char *) bitmap);
+ idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, bitmap);
if (idHashPtr == NULL) {
Tcl_Panic("Tk_FreeBitmap received unknown bitmap argument");
}
@@ -909,7 +911,7 @@ GetBitmapFromObj(
Tcl_HashEntry *hashPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (objPtr->typePtr != &tkBitmapObjType) {
+ if (objPtr->typePtr != &tkBitmapObjType.objType) {
InitBitmapObj(objPtr);
}
@@ -984,7 +986,7 @@ InitBitmapObj(
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
typePtr->freeIntRepProc(objPtr);
}
- objPtr->typePtr = &tkBitmapObjType;
+ objPtr->typePtr = &tkBitmapObjType.objType;
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
@@ -1159,9 +1161,9 @@ TkDebugBitmap(
for ( ; (bitmapPtr != NULL); bitmapPtr = bitmapPtr->nextPtr) {
objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewIntObj(bitmapPtr->resourceRefCount));
+ Tcl_NewWideIntObj(bitmapPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewIntObj(bitmapPtr->objRefCount));
+ Tcl_NewWideIntObj(bitmapPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}