summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-09 13:53:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-09 13:53:37 (GMT)
commita4a25a7ea07ed1aa869f025b16ba5905a11465ca (patch)
tree3036d43c426260a5349c7860ace069c6dd08fcd7 /win
parent84a65733cee47ca4c146903065b3f42331beb39e (diff)
downloadtk-a4a25a7ea07ed1aa869f025b16ba5905a11465ca.zip
tk-a4a25a7ea07ed1aa869f025b16ba5905a11465ca.tar.gz
tk-a4a25a7ea07ed1aa869f025b16ba5905a11465ca.tar.bz2
A few more -Wundef warnings, and a 'const' addition
Diffstat (limited to 'win')
-rw-r--r--win/ttkWinXPTheme.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 22b371c..361ee8a 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -15,14 +15,14 @@
* shellcc/platform/commctls/userex/refentry.asp >
*/
+#define WINVER 0x0501 /* Requires Windows XP APIs */
+
+#include <tkWinInt.h>
#ifndef HAVE_UXTHEME_H
/* Stub for platforms that lack the XP theme API headers: */
-#include <tkWinInt.h>
int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { return TCL_OK; }
#else
-#define WINVER 0x0501 /* Requires Windows XP APIs */
-
#include <windows.h>
#include <uxtheme.h>
#if defined(HAVE_VSSYM32_H) || _MSC_VER > 1500
@@ -31,8 +31,6 @@ int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { return TCL_OK; }
# include <tmschema.h>
#endif
-#include <tkWinInt.h>
-
#include "ttk/ttkTheme.h"
typedef HTHEME (STDAPICALLTYPE OpenThemeDataProc)(HWND hwnd,
@@ -397,7 +395,7 @@ typedef struct
/*
* Static data, initialized when element is registered:
*/
- ElementInfo *info;
+ const ElementInfo *info;
XPThemeProcs *procs; /* Pointer to theme procedure table */
/*
@@ -413,7 +411,7 @@ typedef struct
} ElementData;
static ElementData *
-NewElementData(XPThemeProcs *procs, ElementInfo *info)
+NewElementData(XPThemeProcs *procs, const ElementInfo *info)
{
ElementData *elementData = (ElementData *)ckalloc(sizeof(ElementData));
@@ -799,7 +797,7 @@ static Ttk_ElementSpec TreeIndicatorElementSpec =
TreeIndicatorElementDraw
};
-#if BROKEN_TEXT_ELEMENT
+#ifdef BROKEN_TEXT_ELEMENT
/*
*----------------------------------------------------------------------
@@ -1050,12 +1048,10 @@ static ElementInfo ElementInfoTable[] = {
{ "Spinbox.downarrow", &SpinboxArrowElementSpec, L"SPIN",
SPNP_DOWN, spinbutton_statemap, NOPAD,
PAD_MARGINS | ((SM_CXVSCROLL << 8) | SM_CYVSCROLL) },
-
-#if BROKEN_TEXT_ELEMENT
+#ifdef BROKEN_TEXT_ELEMENT
{ "Labelframe.text", &TextElementSpec, L"BUTTON",
BP_GROUPBOX, groupbox_statemap, NOPAD,0 },
#endif
-
{ 0,0,0,0,0,NOPAD,0 }
};
#undef PAD
@@ -1288,7 +1284,7 @@ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd)
XPThemeProcs *procs;
HINSTANCE hlibrary;
Ttk_Theme themePtr, parentPtr, vistaPtr;
- ElementInfo *infoPtr;
+ const ElementInfo *infoPtr;
procs = LoadXPThemeProcs(&hlibrary);
if (!procs)