summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-16 16:33:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-16 16:33:50 (GMT)
commit22f8312f1177e98133c31e059d6f1ae948178f37 (patch)
treee984d3f416896b6823505e01ca26920799b1134f /win
parent871d0ab87051648f1dcc4fc86445dcde3527c7b2 (diff)
parent3dd24b804c90d0421a7200b2a2b04794887b95fa (diff)
downloadtk-22f8312f1177e98133c31e059d6f1ae948178f37.zip
tk-22f8312f1177e98133c31e059d6f1ae948178f37.tar.gz
tk-22f8312f1177e98133c31e059d6f1ae948178f37.tar.bz2
Merge 8.7. More WIP.
Diffstat (limited to 'win')
-rwxr-xr-xwin/configure6
-rw-r--r--win/tcl.m415
-rw-r--r--win/tkWinDialog.c60
-rw-r--r--win/tkWinDraw.c6
-rw-r--r--win/tkWinEmbed.c13
-rw-r--r--win/tkWinFont.c26
-rw-r--r--win/tkWinImage.c22
-rw-r--r--win/tkWinInit.c1
-rw-r--r--win/tkWinKey.c23
-rw-r--r--win/tkWinMenu.c14
-rw-r--r--win/ttkWinXPTheme.c2
11 files changed, 116 insertions, 72 deletions
diff --git a/win/configure b/win/configure
index 95a550c..af50495 100755
--- a/win/configure
+++ b/win/configure
@@ -4273,7 +4273,7 @@ $as_echo "using shared flags" >&6; }
case "${CC}" in
*++)
- CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format -Wunused-parameter"
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format"
;;
*)
CFLAGS_WARNING="${CFLAGS_WARNING} -Wdeclaration-after-statement"
@@ -4648,10 +4648,6 @@ $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
fi
fi
-
-$as_echo "#define MP_32BIT 1" >>confdefs.h
-
-
# DL_LIBS is empty, but then we match the Unix version
diff --git a/win/tcl.m4 b/win/tcl.m4
index 73e0b5b..565cd67 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -541,14 +541,14 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
if test "$ac_cv_cross" = "yes"; then
case "$do64bit" in
amd64|x64|yes)
- CC="x86_64-w64-mingw32-gcc"
+ CC="x86_64-w64-mingw32-${CC}"
LD="x86_64-w64-mingw32-ld"
AR="x86_64-w64-mingw32-ar"
RANLIB="x86_64-w64-mingw32-ranlib"
RC="x86_64-w64-mingw32-windres"
;;
*)
- CC="i686-w64-mingw32-gcc"
+ CC="i686-w64-mingw32-${CC}"
LD="i686-w64-mingw32-ld"
AR="i686-w64-mingw32-ar"
RANLIB="i686-w64-mingw32-ranlib"
@@ -685,10 +685,19 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
+ case "${CC}" in
+ *++)
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format"
+ ;;
+ *)
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wdeclaration-after-statement"
+ ;;
+ esac
+
# Specify the CC output file names based on the target name
CC_OBJNAME="-o \[$]@"
CC_EXENAME="-o \[$]@"
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 6059d21..8c80ca9 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -423,7 +423,7 @@ typedef struct IFileSaveDialogVtbl {
ULONG ( STDMETHODCALLTYPE *Release )( IFileSaveDialog *);
HRESULT ( STDMETHODCALLTYPE *Show )(
IFileSaveDialog *, HWND);
- HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileSaveDialog * this,
+ HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileSaveDialog *,
UINT, const TCLCOMDLG_FILTERSPEC *);
HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )(
IFileSaveDialog *, UINT);
@@ -718,7 +718,7 @@ void
TkWinDialogDebug(
int debug)
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->debugFlag = debug;
@@ -750,7 +750,7 @@ Tk_ChooseColorObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData, parent;
+ Tk_Window tkwin = (Tk_Window)clientData, parent;
HWND hWnd;
int i, oldMode, winCode, result;
CHOOSECOLORW chooseColor;
@@ -904,10 +904,11 @@ ColorDlgHookProc(
WPARAM wParam, /* First message parameter. */
LPARAM lParam) /* Second message parameter. */
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
const char *title;
CHOOSECOLOR *ccPtr;
+ (void)wParam;
if (WM_INITDIALOG == uMsg) {
@@ -1085,7 +1086,7 @@ ParseOFNOptions(
ZeroMemory(optsPtr, sizeof(*optsPtr));
// optsPtr->forceXPStyle = 1;
- optsPtr->tkwin = clientData;
+ optsPtr->tkwin = (Tk_Window)clientData;
optsPtr->confirmOverwrite = 1; /* By default we ask for confirmation */
Tcl_DStringInit(&optsPtr->utfDirString);
optsPtr->file[0] = 0;
@@ -1146,7 +1147,7 @@ ParseOFNOptions(
Tcl_DStringFree(&ds);
break;
case FILE_PARENT:
- optsPtr->tkwin = Tk_NameToWindow(interp, string, clientData);
+ optsPtr->tkwin = Tk_NameToWindow(interp, string, (Tk_Window)clientData);
if (optsPtr->tkwin == NULL)
goto error_return;
break;
@@ -1205,7 +1206,7 @@ static int VistaFileDialogsAvailable()
{
HRESULT hr;
IFileDialog *fdlgPtr = NULL;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->newFileDialogsState == FDLG_STATE_INIT) {
@@ -1267,7 +1268,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
IShellItem *dirIf = NULL;
LPWSTR wstr;
Tcl_Obj *resultObj = NULL;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int oldMode;
@@ -1409,7 +1410,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
if (normPath) {
LPCWSTR nativePath;
Tcl_IncrRefCount(normPath);
- nativePath = Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/
+ nativePath = (LPCWSTR)Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/
if (nativePath) {
hr = ShellProcs.SHCreateItemFromParsingName(
nativePath, NULL,
@@ -1576,7 +1577,7 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper
Tcl_DString utfFilterString, ds;
Tcl_DString extString, filterString, dirString, titleString;
const char *str;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
ZeroMemory(&ofnData, sizeof(OFNData));
@@ -1621,7 +1622,7 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper
*/
ofnData.dynFileBufferSize = 512;
- ofnData.dynFileBuffer = ckalloc(512 * sizeof(WCHAR));
+ ofnData.dynFileBuffer = (WCHAR *)ckalloc(512 * sizeof(WCHAR));
}
if (optsPtr->extObj != NULL) {
@@ -1919,10 +1920,11 @@ OFNHookProc(
WPARAM wParam, /* Message parameter */
LPARAM lParam) /* Message parameter */
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
OPENFILENAME *ofnPtr;
OFNData *ofnData;
+ (void)wParam;
if (uMsg == WM_INITDIALOG) {
TkWinSetUserData(hdlg, lParam);
@@ -1967,7 +1969,7 @@ OFNHookProc(
if ((selsize > 1) && (dirsize > 0)) {
if (ofnData->dynFileBufferSize < buffersize) {
- buffer = ckrealloc(buffer, buffersize * sizeof(WCHAR));
+ buffer = (WCHAR *)ckrealloc(buffer, buffersize * sizeof(WCHAR));
ofnData->dynFileBufferSize = buffersize;
ofnData->dynFileBuffer = buffer;
}
@@ -2099,7 +2101,7 @@ MakeFilter(
*/
const char *defaultFilter = "All Files (*.*)";
- p = filterStr = ckalloc(30);
+ p = filterStr = (char *)ckalloc(30);
strcpy(p, defaultFilter);
p+= strlen(defaultFilter);
@@ -2135,7 +2137,7 @@ MakeFilter(
* twice the size of the string to format the filter
*/
- filterStr = ckalloc(len * 3);
+ filterStr = (char *)ckalloc(len * 3);
for (filterPtr = flist.filters, p = filterStr; filterPtr;
filterPtr = filterPtr->next) {
@@ -2288,7 +2290,7 @@ static int MakeFilterVista(
Tcl_DStringInit(&ds);
Tcl_DStringInit(&patterns);
- dlgFilterPtr = ckalloc(flist.numFilters * sizeof(*dlgFilterPtr));
+ dlgFilterPtr = (TCLCOMDLG_FILTERSPEC *)ckalloc(flist.numFilters * sizeof(*dlgFilterPtr));
for (i = 0, filterPtr = flist.filters;
filterPtr;
@@ -2306,7 +2308,7 @@ static int MakeFilterVista(
Tcl_UtfToWCharDString(filterPtr->name, -1, &ds);
nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */
nbytes += sizeof(WCHAR); /* Terminating \0 */
- dlgFilterPtr[i].pszName = ckalloc(nbytes);
+ dlgFilterPtr[i].pszName = (LPCWSTR)ckalloc(nbytes);
memmove((void *) dlgFilterPtr[i].pszName, Tcl_DStringValue(&ds), nbytes);
Tcl_DStringFree(&ds);
@@ -2335,7 +2337,7 @@ static int MakeFilterVista(
Tcl_UtfToWCharDString(Tcl_DStringValue(&patterns), -1, &ds);
nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */
nbytes += sizeof(WCHAR); /* Terminating \0 */
- dlgFilterPtr[i].pszSpec = ckalloc(nbytes);
+ dlgFilterPtr[i].pszSpec = (LPCWSTR)ckalloc(nbytes);
memmove((void *)dlgFilterPtr[i].pszSpec, Tcl_DStringValue(&ds), nbytes);
Tcl_DStringFree(&ds);
Tcl_DStringSetLength(&patterns, 0);
@@ -2626,7 +2628,7 @@ ChooseDirectoryValidateProc(
Tcl_DString tempString;
Tcl_DString initDirString;
WCHAR string[MAX_PATH];
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->debugFlag) {
@@ -2789,7 +2791,7 @@ Tk_MessageBoxObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData, parent;
+ Tk_Window tkwin = (Tk_Window)clientData, parent;
HWND hWnd;
Tcl_Obj *messageObj, *titleObj, *detailObj, *tmpObj;
int defaultBtn, icon, type;
@@ -2803,7 +2805,7 @@ Tk_MessageBoxObjCmd(
MSG_DEFAULT, MSG_DETAIL, MSG_ICON, MSG_MESSAGE,
MSG_PARENT, MSG_TITLE, MSG_TYPE
};
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_DString titleBuf, tmpBuf;
LPCWSTR titlePtr, tmpPtr;
@@ -2973,7 +2975,7 @@ MsgBoxCBTProc(
WPARAM wParam,
LPARAM lParam)
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (nCode == HCBT_CREATEWND) {
@@ -3020,7 +3022,7 @@ static void
SetTkDialog(
ClientData clientData)
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
char buf[32];
@@ -3113,7 +3115,7 @@ ApplyLogfont(
Tcl_Obj **objv, **tmpv;
Tcl_ListObjGetElements(NULL, cmdObj, &objc, &objv);
- tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ tmpv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
tmpv[objc] = GetFontObj(hdc, logfontPtr);
TkBackgroundEvalObjv(interp, objc+1, tmpv, TCL_EVAL_GLOBAL);
@@ -3151,7 +3153,7 @@ HookProc(
CHOOSEFONT *pcf = (CHOOSEFONT *) lParam;
HWND hwndCtrl;
static HookData *phd = NULL;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (WM_INITDIALOG == msg && lParam != 0) {
@@ -3294,14 +3296,14 @@ FontchooserConfigureCmd(
int objc,
Tcl_Obj *const objv[])
{
- Tk_Window tkwin = clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
HookData *hdPtr = NULL;
int i, r = TCL_OK;
static const char *const optionStrings[] = {
"-parent", "-title", "-font", "-command", "-visible", NULL
};
- hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
+ hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
/*
* With no arguments we return all the options in a dict.
@@ -3438,7 +3440,7 @@ FontchooserShowCmd(
Tcl_Obj *const objv[])
{
Tcl_DString ds;
- Tk_Window tkwin = clientData, parent;
+ Tk_Window tkwin = (Tk_Window)clientData, parent;
CHOOSEFONTW cf;
LOGFONTW lf;
HDC hdc;
@@ -3447,7 +3449,7 @@ FontchooserShowCmd(
(void)objc;
(void)objv;
- hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
+ hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
parent = tkwin;
if (hdPtr->parentObj) {
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 1257d46..b21376a 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -244,7 +244,7 @@ ConvertPoints(
if (tsdPtr->winPoints != NULL) {
ckfree(tsdPtr->winPoints);
}
- tsdPtr->winPoints = ckalloc(sizeof(POINT) * npoints);
+ tsdPtr->winPoints = (POINT *)ckalloc(sizeof(POINT) * npoints);
if (tsdPtr->winPoints == NULL) {
tsdPtr->nWinPoints = -1;
return NULL;
@@ -987,6 +987,7 @@ XFillPolygon(
HPEN pen;
TkWinDCState state;
HDC dc;
+ (void)shape;
if (d == None) {
return BadDrawable;
@@ -1407,6 +1408,7 @@ TkScrollWindow(
{
HWND hwnd = TkWinGetHWND(Tk_WindowId(tkwin));
RECT scrollRect;
+ (void)gc;
scrollRect.left = x;
scrollRect.top = y;
@@ -1483,6 +1485,8 @@ TkpDrawHighlightBorder(
int highlightWidth,
Drawable drawable)
{
+ (void)bgGC;
+
TkDrawInsetFocusHighlight(tkwin, fgGC, highlightWidth, drawable, 0);
}
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index 716d456..c6a8b94 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -69,7 +69,7 @@ void
TkWinCleanupContainerList(void)
{
Container *nextPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (; tsdPtr->firstContainerPtr != NULL;
@@ -99,11 +99,16 @@ TkWinCleanupContainerList(void)
/* ARGSUSED */
int
TkpTestembedCmd(
- ClientData clientData,
+ ClientData dummy,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
+ (void)dummy;
+ (void)interp;
+ (void)objc;
+ (void)objv;
+
return TCL_OK;
}
@@ -371,7 +376,7 @@ TkpMakeContainer(
*/
Tk_MakeWindowExist(tkwin);
- containerPtr = ckalloc(sizeof(Container));
+ containerPtr = (Container *)ckalloc(sizeof(Container));
containerPtr->parentPtr = winPtr;
containerPtr->parentHWnd = Tk_GetHWND(Tk_WindowId(tkwin));
containerPtr->embeddedHWnd = NULL;
@@ -1050,6 +1055,8 @@ TkpRedirectKeyEvent(
XEvent *eventPtr) /* X event to redirect (should be KeyPress or
* KeyRelease). */
{
+ (void)winPtr;
+ (void)eventPtr;
/* not implemented */
}
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 451dc68..7bea983 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -299,8 +299,8 @@ TkpGetNativeFont(
}
tkwin = (Tk_Window) ((TkWindow *) tkwin)->mainPtr->winPtr;
- fontPtr = ckalloc(sizeof(WinFont));
- InitFont(tkwin, GetStockObject(object), 0, fontPtr);
+ fontPtr = (WinFont *)ckalloc(sizeof(WinFont));
+ InitFont(tkwin, (HFONT)GetStockObject(object), 0, fontPtr);
return (TkFont *) fontPtr;
}
@@ -557,7 +557,7 @@ TkpGetFontFromAttributes(
hFont = GetScreenFont(faPtr, faceName,
(int)(TkFontGetPixels(tkwin, faPtr->size) + 0.5), 0.0);
if (tkFontPtr == NULL) {
- fontPtr = ckalloc(sizeof(WinFont));
+ fontPtr = (WinFont *)ckalloc(sizeof(WinFont));
} else {
fontPtr = (WinFont *) tkFontPtr;
ReleaseFont(fontPtr);
@@ -660,6 +660,8 @@ WinFontFamilyEnumProc(
WCHAR *faceName = lfPtr->elfLogFont.lfFaceName;
Tcl_Obj *resultObj = (Tcl_Obj *) lParam;
Tcl_DString faceString;
+ (void)tmPtr;
+ (void)fontType;
Tcl_DStringInit(&faceString);
Tcl_WCharToUtfDString(faceName, wcslen(faceName), &faceString);
@@ -1079,6 +1081,7 @@ Tk_DrawChars(
HDC dc;
WinFont *fontPtr;
TkWinDCState state;
+ (void)tkfont;
fontPtr = (WinFont *) gc->font;
display->request++;
@@ -1227,6 +1230,7 @@ TkDrawAngledChars(
HDC dc;
WinFont *fontPtr;
TkWinDCState state;
+ (void)tkfont;
fontPtr = (WinFont *) gc->font;
display->request++;
@@ -1744,6 +1748,7 @@ AllocFontFamily(
WCHAR buf[LF_FACESIZE];
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ (void)base;
hFont = SelectObject(hdc, hFont);
GetTextFaceW(hdc, LF_FACESIZE, buf);
@@ -2044,6 +2049,8 @@ WinFontCanUseProc(
SubFont *subFontPtr;
Tcl_DString faceString;
Tcl_DString *nameTriedPtr;
+ (void)tmPtr;
+ (void)fontType;
canUsePtr = (CanUse *) lParam;
ch = canUsePtr->ch;
@@ -2558,6 +2565,11 @@ WinFontExistProc(
int fontType, /* Type of font (not used). */
LPARAM lParam) /* EnumFontData to hold result. */
{
+ (void)lfPtr;
+ (void)tmPtr;
+ (void)fontType;
+ (void)lParam;
+
return 0;
}
@@ -2766,8 +2778,8 @@ LoadFontRanges(
segCount = subTable.segment.segCountX2 / 2;
cbData = segCount * sizeof(USHORT);
- startCount = ckalloc(cbData);
- endCount = ckalloc(cbData);
+ startCount = (USHORT *)ckalloc(cbData);
+ endCount = (USHORT *)ckalloc(cbData);
offset = encTable.offset + sizeof(subTable.segment);
GetFontData(hdc, cmapKey, (DWORD) offset, endCount, cbData);
@@ -2810,8 +2822,8 @@ LoadFontRanges(
segCount = 1;
cbData = segCount * sizeof(USHORT);
- startCount = ckalloc(cbData);
- endCount = ckalloc(cbData);
+ startCount = (USHORT *)ckalloc(cbData);
+ endCount = (USHORT *)ckalloc(cbData);
startCount[0] = 0x0000;
endCount[0] = 0x00ff;
}
diff --git a/win/tkWinImage.c b/win/tkWinImage.c
index e1660a9..dfb72a8 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -212,7 +212,10 @@ XCreateImage(
int bitmap_pad,
int bytes_per_line)
{
- XImage* imagePtr = ckalloc(sizeof(XImage));
+ XImage* imagePtr = (XImage*)ckalloc(sizeof(XImage));
+ (void)display;
+ (void)visual;
+
imagePtr->width = width;
imagePtr->height = height;
imagePtr->xoffset = offset;
@@ -300,6 +303,7 @@ XGetImageZPixmap(
unsigned char *data;
TkWinDCState state;
BOOL ret;
+ (void)plane_mask;
if (format != ZPixmap) {
TkpDisplayWarning("Only ZPixmap types are implemented",
@@ -350,7 +354,7 @@ XGetImageZPixmap(
if (depth <= 8) {
size += sizeof(unsigned short) << depth;
}
- bmInfo = ckalloc(size);
+ bmInfo = (BITMAPINFO *)ckalloc(size);
bmInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmInfo->bmiHeader.biWidth = width;
@@ -368,7 +372,7 @@ XGetImageZPixmap(
unsigned char *p, *pend;
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS);
- data = ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
@@ -404,7 +408,7 @@ XGetImageZPixmap(
unsigned char *p;
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS);
- data = ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
@@ -435,7 +439,7 @@ XGetImageZPixmap(
}
} else if (depth == 16) {
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS);
- data = ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
@@ -461,7 +465,7 @@ XGetImageZPixmap(
}
} else {
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS);
- data = ckalloc(width * height * 4);
+ data = (unsigned char *)ckalloc(width * height * 4);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
@@ -484,7 +488,7 @@ XGetImageZPixmap(
unsigned int byte_width, h, w;
byte_width = ((width * 3 + 3) & ~(unsigned)3);
- smallBitBase = ckalloc(byte_width * height);
+ smallBitBase = (unsigned char *)ckalloc(byte_width * height);
if (!smallBitBase) {
ckfree(ret_image->data);
ckfree(ret_image);
@@ -614,7 +618,7 @@ XGetImage(
imagePtr = XCreateImage(display, NULL, 32, format, 0, NULL,
width, height, 32, 0);
size = imagePtr->bytes_per_line * imagePtr->height;
- imagePtr->data = ckalloc(size);
+ imagePtr->data = (char *)ckalloc(size);
ZeroMemory(imagePtr->data, size);
for (yy = 0; yy < height; yy++) {
@@ -661,7 +665,7 @@ XGetImage(
imagePtr = XCreateImage(display, NULL, 1, XYBitmap, 0, NULL,
width, height, 32, 0);
- imagePtr->data = ckalloc(imagePtr->bytes_per_line * imagePtr->height);
+ imagePtr->data = (char *)ckalloc(imagePtr->bytes_per_line * imagePtr->height);
dc = GetDC(NULL);
diff --git a/win/tkWinInit.c b/win/tkWinInit.c
index 8f4ac5d..854d62f 100644
--- a/win/tkWinInit.c
+++ b/win/tkWinInit.c
@@ -35,6 +35,7 @@ int
TkpInit(
Tcl_Interp *interp)
{
+ (void)interp;
/*
* This is necessary for static initialization, and is ok otherwise
* because TkWinXInit flips a static bit to do its work just once.
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index 29f2ff0..43e9206 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -99,6 +99,7 @@ TkpGetString(
XKeyEvent *keyEv = &eventPtr->xkey;
int len;
char buf[4];
+ (void)winPtr;
Tcl_DStringInit(dsPtr);
if (keyEv->send_event == -1) {
@@ -155,6 +156,7 @@ XKeycodeToKeysym(
int index)
{
int state = 0;
+ (void)display;
if (index & 0x01) {
state |= ShiftMask;
@@ -504,7 +506,7 @@ TkpInitKeymapInfo(
}
dispPtr->numModKeyCodes = 0;
arraySize = KEYCODE_ARRAY_SIZE;
- dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
+ dispPtr->modKeyCodes = (KeyCode *)ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) {
if (*codePtr == 0) {
continue;
@@ -520,18 +522,18 @@ TkpInitKeymapInfo(
}
}
if (dispPtr->numModKeyCodes >= arraySize) {
- KeyCode *new;
+ KeyCode *newKey;
/*
* Ran out of space in the array; grow it.
*/
arraySize *= 2;
- new = ckalloc(arraySize * sizeof(KeyCode));
- memcpy(new, dispPtr->modKeyCodes,
+ newKey = (KeyCode *)ckalloc(arraySize * sizeof(KeyCode));
+ memcpy(newKey, dispPtr->modKeyCodes,
dispPtr->numModKeyCodes * sizeof(KeyCode));
ckfree(dispPtr->modKeyCodes);
- dispPtr->modKeyCodes = new;
+ dispPtr->modKeyCodes = newKey;
}
dispPtr->modKeyCodes[dispPtr->numModKeyCodes] = *codePtr;
dispPtr->numModKeyCodes++;
@@ -555,6 +557,7 @@ TkpSetKeycodeAndState(
int i;
SHORT result;
int shift;
+ (void)tkwin;
eventPtr->xkey.keycode = 0;
if (keySym == NoSymbol) {
@@ -611,6 +614,7 @@ XKeysymToKeycode(
{
int i;
SHORT result;
+ (void)display;
/*
* We check our private map first for a virtual keycode, as VkKeyScan will
@@ -656,10 +660,11 @@ XModifierKeymap *
XGetModifierMapping(
Display *display)
{
- XModifierKeymap *map = ckalloc(sizeof(XModifierKeymap));
+ XModifierKeymap *map = (XModifierKeymap *)ckalloc(sizeof(XModifierKeymap));
+ (void)display;
map->max_keypermod = 1;
- map->modifiermap = ckalloc(sizeof(KeyCode) * 8);
+ map->modifiermap = (KeyCode *)ckalloc(sizeof(KeyCode) * 8);
map->modifiermap[ShiftMapIndex] = VK_SHIFT;
map->modifiermap[LockMapIndex] = VK_CAPITAL;
map->modifiermap[ControlMapIndex] = VK_CONTROL;
@@ -717,6 +722,8 @@ KeySym
XStringToKeysym(
_Xconst char *string)
{
+ (void)string;
+
return NoSymbol;
}
@@ -740,6 +747,8 @@ char *
XKeysymToString(
KeySym keysym)
{
+ (void)keysym;
+
return NULL;
}
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 2b5e9af..f3adb26 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -233,13 +233,13 @@ GetNewID(
TkMenuEntry *mePtr, /* The menu we are working with. */
WORD *menuIDPtr) /* The resulting id. */
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
WORD curID = tsdPtr->lastCommandID;
while (1) {
Tcl_HashEntry *commandEntryPtr;
- int new;
+ int isNew;
/*
* Try the next ID number, taking care to wrap rather than stray
@@ -255,8 +255,8 @@ GetNewID(
}
commandEntryPtr = Tcl_CreateHashEntry(&tsdPtr->commandTable,
- INT2PTR(curID), &new);
- if (new) {
+ INT2PTR(curID), &isNew);
+ if (isNew) {
Tcl_SetHashValue(commandEntryPtr, mePtr);
*menuIDPtr = curID;
tsdPtr->lastCommandID = curID;
@@ -285,7 +285,7 @@ static void
FreeID(
WORD commandID)
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -328,7 +328,7 @@ TkpNewMenu(
HMENU winMenuHdl;
Tcl_HashEntry *hashEntryPtr;
int newEntry;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
winMenuHdl = CreatePopupMenu();
@@ -374,7 +374,7 @@ TkpDestroyMenu(
{
HMENU winMenuHdl = (HMENU) menuPtr->platformData;
const char *searchName;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 8a97852..784a96d 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1025,7 +1025,7 @@ static ElementInfo ElementInfoTable[] = {
{ "Menubutton.dropdown", &GenericElementSpec, L"TOOLBAR",
TP_SPLITBUTTONDROPDOWN,toolbutton_statemap, NOPAD,0 },
{ "Treeview.field", &GenericElementSpec, L"TREEVIEW",
- TVP_TREEITEM, treeview_statemap, PAD(1, 1, 1, 1), 0 },
+ TVP_TREEITEM, treeview_statemap, PAD(1, 1, 1, 1), IGNORE_THEMESIZE },
{ "Treeitem.indicator", &TreeIndicatorElementSpec, L"TREEVIEW",
TVP_GLYPH, tvpglyph_statemap, PAD(1,1,6,0), PAD_MARGINS },
{ "Treeheading.border", &GenericElementSpec, L"HEADER",