summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkImage.c
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2020-05-24 15:44:22 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2020-05-24 15:44:22 (GMT)
commite9d72bbaa4a4cef256b3d3480ed1136b8651d019 (patch)
tree5b555bb43f3c32b4ff86fe07b3b06f5000ade4d9 /generic/ttk/ttkImage.c
parenta48a5b55179978d3f31371c90d9be6eaa6931f17 (diff)
parentad1ded4a7f409e06bd6e1b33da463e6c7cd844af (diff)
downloadtk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.zip
tk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.tar.gz
tk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.tar.bz2
Merge trunk
Diffstat (limited to 'generic/ttk/ttkImage.c')
-rw-r--r--generic/ttk/ttkImage.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c
index 002a753..e6ad27d 100644
--- a/generic/ttk/ttkImage.c
+++ b/generic/ttk/ttkImage.c
@@ -31,9 +31,17 @@ struct TtkImageSpec {
/* NullImageChanged --
* Do-nothing Tk_ImageChangedProc.
*/
-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;
+}
/* ImageSpecImageChanged --
* Image changes should trigger a repaint.
@@ -74,7 +82,7 @@ TtkGetImageSpecEx(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr,
int i = 0, n = 0, objc;
Tcl_Obj **objv;
- imageSpec = ckalloc(sizeof(*imageSpec));
+ imageSpec = (Ttk_ImageSpec *)ckalloc(sizeof(*imageSpec));
imageSpec->baseImage = 0;
imageSpec->mapCount = 0;
imageSpec->states = 0;
@@ -97,8 +105,8 @@ TtkGetImageSpecEx(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr,
}
n = (objc - 1) / 2;
- imageSpec->states = ckalloc(n * sizeof(Ttk_StateSpec));
- imageSpec->images = ckalloc(n * sizeof(Tk_Image *));
+ imageSpec->states = (Ttk_StateSpec *)ckalloc(n * sizeof(Ttk_StateSpec));
+ imageSpec->images = (Tk_Image *)ckalloc(n * sizeof(Tk_Image));
/* Get base image:
*/
@@ -205,6 +213,7 @@ static void Ttk_Fill(
int dr = dst.x + dst.width;
int db = dst.y + dst.height;
int x,y;
+ (void)tkwin;
if (!(src.width && src.height && dst.width && dst.height))
return;
@@ -262,7 +271,7 @@ typedef struct { /* ClientData for image elements */
static void FreeImageData(void *clientData)
{
- ImageData *imageData = clientData;
+ ImageData *imageData = (ImageData *)clientData;
if (imageData->imageSpec) { TtkFreeImageSpec(imageData->imageSpec); }
#if TILE_07_COMPAT
if (imageData->imageMap) { Tcl_DecrRefCount(imageData->imageMap); }
@@ -274,8 +283,10 @@ static void ImageElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ImageData *imageData = clientData;
+ ImageData *imageData = (ImageData *)clientData;
Tk_Image image = imageData->imageSpec->baseImage;
+ (void)elementRecord;
+ (void)tkwin;
if (image) {
Tk_SizeOfImage(image, widthPtr, heightPtr);
@@ -294,10 +305,11 @@ static void ImageElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- ImageData *imageData = clientData;
+ ImageData *imageData = (ImageData *)clientData;
Tk_Image image = 0;
int imgWidth, imgHeight;
Ttk_Box src, dst;
+ (void)elementRecord;
#if TILE_07_COMPAT
if (imageData->imageMap) {
@@ -324,7 +336,7 @@ static void ImageElementDraw(
Ttk_Tile(tkwin, d, image, src, dst, imageData->border);
}
-static Ttk_ElementSpec ImageElementSpec =
+static const Ttk_ElementSpec ImageElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NullElement),
@@ -339,7 +351,7 @@ static Ttk_ElementSpec ImageElementSpec =
static int
Ttk_CreateImageElement(
Tcl_Interp *interp,
- void *clientData,
+ void *dummy,
Ttk_Theme theme,
const char *elementName,
int objc, Tcl_Obj *const objv[])
@@ -352,6 +364,7 @@ Ttk_CreateImageElement(
ImageData *imageData = 0;
int padding_specified = 0;
int i;
+ (void)dummy;
if (objc <= 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -365,7 +378,7 @@ Ttk_CreateImageElement(
return TCL_ERROR;
}
- imageData = ckalloc(sizeof(*imageData));
+ imageData = (ImageData *)ckalloc(sizeof(*imageData));
imageData->imageSpec = imageSpec;
imageData->minWidth = imageData->minHeight = -1;
imageData->sticky = TTK_FILL_BOTH;