summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkTheme.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/ttk/ttkTheme.c')
-rw-r--r--generic/ttk/ttkTheme.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c
index 5095487..b0e9171 100644
--- a/generic/ttk/ttkTheme.c
+++ b/generic/ttk/ttkTheme.c
@@ -40,7 +40,7 @@ typedef struct Ttk_Style_
static Style *NewStyle()
{
- Style *stylePtr = (Style*)ckalloc(sizeof(Style));
+ Style *stylePtr = ckalloc(sizeof(Style));
stylePtr->styleName = NULL;
stylePtr->parentStyle = NULL;
@@ -75,7 +75,7 @@ static void FreeStyle(Style *stylePtr)
Ttk_FreeLayoutTemplate(stylePtr->layoutTemplate);
- ckfree((ClientData)stylePtr);
+ ckfree(stylePtr);
}
/*
@@ -179,7 +179,7 @@ static const Tk_OptionSpec *TTKGetOptionSpec(
static OptionMap
BuildOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable)
{
- OptionMap optionMap = (OptionMap)ckalloc(
+ OptionMap optionMap = ckalloc(
sizeof(const Tk_OptionSpec) * elementClass->nResources + 1);
int i;
@@ -221,8 +221,7 @@ GetOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable)
static Ttk_ElementClass *
NewElementClass(const char *name, Ttk_ElementSpec *specPtr,void *clientData)
{
- Ttk_ElementClass *elementClass =
- (Ttk_ElementClass*)ckalloc(sizeof(Ttk_ElementClass));
+ Ttk_ElementClass *elementClass = ckalloc(sizeof(Ttk_ElementClass));
int i;
elementClass->name = name;
@@ -238,7 +237,7 @@ NewElementClass(const char *name, Ttk_ElementSpec *specPtr,void *clientData)
/* Initialize default values:
*/
- elementClass->defaultValues = (Tcl_Obj**)
+ elementClass->defaultValues =
ckalloc(elementClass->nResources * sizeof(Tcl_Obj *) + 1);
for (i=0; i < elementClass->nResources; ++i) {
const char *defaultValue = specPtr->options[i].defaultValue;
@@ -275,7 +274,7 @@ static void FreeElementClass(Ttk_ElementClass *elementClass)
Tcl_DecrRefCount(elementClass->defaultValues[i]);
}
}
- ckfree((ClientData)elementClass->defaultValues);
+ ckfree(elementClass->defaultValues);
/*
* Free option map cache:
@@ -288,7 +287,7 @@ static void FreeElementClass(Ttk_ElementClass *elementClass)
Tcl_DeleteHashTable(&elementClass->optMapCache);
ckfree(elementClass->elementRecord);
- ckfree((ClientData)elementClass);
+ ckfree(elementClass);
}
/*------------------------------------------------------------------------
@@ -311,7 +310,7 @@ typedef struct Ttk_Theme_
static Theme *NewTheme(Ttk_ResourceCache cache, Ttk_Theme parent)
{
- Theme *themePtr = (Theme*)ckalloc(sizeof(Theme));
+ Theme *themePtr = ckalloc(sizeof(Theme));
Tcl_HashEntry *entryPtr;
int unused;
@@ -365,7 +364,7 @@ static void FreeTheme(Theme *themePtr)
/*
* Free theme record:
*/
- ckfree((ClientData)themePtr);
+ ckfree(themePtr);
return;
}
@@ -454,11 +453,11 @@ static void Ttk_StylePkgFree(ClientData clientData, Tcl_Interp *interp)
while (cleanup) {
Cleanup *next = cleanup->next;
cleanup->cleanupProc(cleanup->clientData);
- ckfree((ClientData)cleanup);
+ ckfree(cleanup);
cleanup = next;
}
- ckfree((ClientData)pkgPtr);
+ ckfree(pkgPtr);
}
/*
@@ -484,7 +483,7 @@ void Ttk_RegisterCleanup(
Tcl_Interp *interp, ClientData clientData, Ttk_CleanupProc *cleanupProc)
{
StylePackageData *pkgPtr = GetStylePackageData(interp);
- Cleanup *cleanup = (Cleanup*)ckalloc(sizeof(*cleanup));
+ Cleanup *cleanup = ckalloc(sizeof(*cleanup));
cleanup->clientData = clientData;
cleanup->cleanupProc = cleanupProc;
@@ -800,7 +799,7 @@ int Ttk_RegisterElementFactory(
Ttk_ElementFactory factory, void *clientData)
{
StylePackageData *pkgPtr = GetStylePackageData(interp);
- FactoryRec *recPtr = (FactoryRec*)ckalloc(sizeof(*recPtr));
+ FactoryRec *recPtr = ckalloc(sizeof(*recPtr));
Tcl_HashEntry *entryPtr;
int newEntry;
@@ -1695,8 +1694,7 @@ void Ttk_StylePkgInit(Tcl_Interp *interp)
{
Tcl_Namespace *nsPtr;
- StylePackageData *pkgPtr = (StylePackageData *)
- ckalloc(sizeof(StylePackageData));
+ StylePackageData *pkgPtr = ckalloc(sizeof(StylePackageData));
pkgPtr->interp = interp;
Tcl_InitHashTable(&pkgPtr->themeTable, TCL_STRING_KEYS);