summaryrefslogtreecommitdiffstats
path: root/win/tkWinDialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinDialog.c')
-rw-r--r--win/tkWinDialog.c60
1 files changed, 31 insertions, 29 deletions
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) {