summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkCache.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-20 10:41:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-20 10:41:43 (GMT)
commit2f89fa96c29e874b87523d628df15c62984dd9b7 (patch)
tree512c62f76a0e9be490f422d8aa6f866cd1c0c5c3 /generic/ttk/ttkCache.c
parent22f8312f1177e98133c31e059d6f1ae948178f37 (diff)
downloadtk-2f89fa96c29e874b87523d628df15c62984dd9b7.zip
tk-2f89fa96c29e874b87523d628df15c62984dd9b7.tar.gz
tk-2f89fa96c29e874b87523d628df15c62984dd9b7.tar.bz2
Much more WIP: Appears to be working on UNIX, and for a bit part on Windows too.
Diffstat (limited to 'generic/ttk/ttkCache.c')
-rw-r--r--generic/ttk/ttkCache.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c
index c29007c..9059c55 100644
--- a/generic/ttk/ttkCache.c
+++ b/generic/ttk/ttkCache.c
@@ -48,7 +48,7 @@ struct Ttk_ResourceCache_ {
*/
Ttk_ResourceCache Ttk_CreateResourceCache(Tcl_Interp *interp)
{
- Ttk_ResourceCache cache = ckalloc(sizeof(*cache));
+ Ttk_ResourceCache cache = (Ttk_ResourceCache)ckalloc(sizeof(*cache));
cache->tkwin = NULL; /* initialized later */
cache->interp = interp;
@@ -75,7 +75,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache)
*/
entryPtr = Tcl_FirstHashEntry(&cache->fontTable, &search);
while (entryPtr != NULL) {
- Tcl_Obj *fontObj = Tcl_GetHashValue(entryPtr);
+ Tcl_Obj *fontObj = (Tcl_Obj *)Tcl_GetHashValue(entryPtr);
if (fontObj) {
Tk_FreeFontFromObj(cache->tkwin, fontObj);
Tcl_DecrRefCount(fontObj);
@@ -90,7 +90,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache)
*/
entryPtr = Tcl_FirstHashEntry(&cache->colorTable, &search);
while (entryPtr != NULL) {
- Tcl_Obj *colorObj = Tcl_GetHashValue(entryPtr);
+ Tcl_Obj *colorObj = (Tcl_Obj *)Tcl_GetHashValue(entryPtr);
if (colorObj) {
Tk_FreeColorFromObj(cache->tkwin, colorObj);
Tcl_DecrRefCount(colorObj);
@@ -105,7 +105,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache)
*/
entryPtr = Tcl_FirstHashEntry(&cache->borderTable, &search);
while (entryPtr != NULL) {
- Tcl_Obj *borderObj = Tcl_GetHashValue(entryPtr);
+ Tcl_Obj *borderObj = (Tcl_Obj *)Tcl_GetHashValue(entryPtr);
if (borderObj) {
Tk_Free3DBorderFromObj(cache->tkwin, borderObj);
Tcl_DecrRefCount(borderObj);
@@ -120,7 +120,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache)
*/
entryPtr = Tcl_FirstHashEntry(&cache->imageTable, &search);
while (entryPtr != NULL) {
- Tk_Image image = Tcl_GetHashValue(entryPtr);
+ Tk_Image image = (Tk_Image)Tcl_GetHashValue(entryPtr);
if (image) {
Tk_FreeImage(image);
}
@@ -153,7 +153,7 @@ void Ttk_FreeResourceCache(Ttk_ResourceCache cache)
*/
entryPtr = Tcl_FirstHashEntry(&cache->namedColors, &search);
while (entryPtr != NULL) {
- Tcl_Obj *colorNameObj = Tcl_GetHashValue(entryPtr);
+ Tcl_Obj *colorNameObj = (Tcl_Obj *)Tcl_GetHashValue(entryPtr);
Tcl_DecrRefCount(colorNameObj);
entryPtr = Tcl_NextHashEntry(&search);
}
@@ -168,7 +168,7 @@ void Ttk_FreeResourceCache(Ttk_ResourceCache cache)
*/
static void CacheWinEventHandler(ClientData clientData, XEvent *eventPtr)
{
- Ttk_ResourceCache cache = clientData;
+ Ttk_ResourceCache cache = (Ttk_ResourceCache)clientData;
if (eventPtr->type != DestroyNotify) {
return;
@@ -216,7 +216,7 @@ void Ttk_RegisterNamedColor(
entryPtr = Tcl_CreateHashEntry(&cache->namedColors, colorName, &newEntry);
if (!newEntry) {
- Tcl_Obj *oldColor = Tcl_GetHashValue(entryPtr);
+ Tcl_Obj *oldColor = (Tcl_Obj *)Tcl_GetHashValue(entryPtr);
Tcl_DecrRefCount(oldColor);
}
@@ -234,7 +234,7 @@ static Tcl_Obj *CheckNamedColor(Ttk_ResourceCache cache, Tcl_Obj *objPtr)
Tcl_HashEntry *entryPtr =
Tcl_FindHashEntry(&cache->namedColors, Tcl_GetString(objPtr));
if (entryPtr) { /* Use named color instead */
- objPtr = Tcl_GetHashValue(entryPtr);
+ objPtr = (Tcl_Obj *)Tcl_GetHashValue(entryPtr);
}
return objPtr;
}
@@ -257,7 +257,7 @@ static Tcl_Obj *Ttk_Use(
Tcl_Obj *cacheObj;
if (!newEntry) {
- return Tcl_GetHashValue(entryPtr);
+ return (Tcl_Obj *)Tcl_GetHashValue(entryPtr);
}
cacheObj = Tcl_DuplicateObj(objPtr);
@@ -314,9 +314,17 @@ Tcl_Obj *Ttk_UseBorder(
* Tk_ImageChangedProc for Ttk_UseImage
*/
-static void NullImageChanged(ClientData clientData,
+static void NullImageChanged(ClientData dummy,
int x, int y, int width, int height, int imageWidth, int imageHeight)
-{ /* No-op */ }
+{ /* No-op */
+ (void)dummy;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)imageWidth;
+ (void)imageHeight;
+}
/*
* Ttk_UseImage --
@@ -333,7 +341,7 @@ Tk_Image Ttk_UseImage(Ttk_ResourceCache cache, Tk_Window tkwin, Tcl_Obj *objPtr)
InitCacheWindow(cache, tkwin);
if (!newEntry) {
- return Tcl_GetHashValue(entryPtr);
+ return (Tk_Image)Tcl_GetHashValue(entryPtr);
}
image = Tk_GetImage(cache->interp, tkwin, imageName, NullImageChanged,0);