summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/tclWinDde.c32
-rw-r--r--win/tclWinReg.c16
2 files changed, 23 insertions, 25 deletions
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index 1425e94..4c7fc5b 100644
--- a/win/tclWinDde.c
+++ b/win/tclWinDde.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinDde.c,v 1.34 2009/02/03 23:10:57 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinDde.c,v 1.35 2009/08/16 10:20:19 nijtmans Exp $
*/
#include "tclInt.h"
@@ -722,7 +722,7 @@ DdeServerProc(
if (stricmp(utilString, TCL_DDE_EXECUTE_RESULT) == 0) {
returnString =
Tcl_GetStringFromObj(convPtr->returnPackagePtr, &len);
- ddeReturn = DdeCreateDataHandle(ddeInstance, (char *)returnString,
+ ddeReturn = DdeCreateDataHandle(ddeInstance, (LPBYTE)returnString,
(DWORD) len+1, 0, ddeItem, CF_TEXT, 0);
} else {
if (Tcl_IsSafe(convPtr->riPtr->interp)) {
@@ -735,7 +735,7 @@ DdeServerProc(
returnString = Tcl_GetStringFromObj(variableObjPtr,
&len);
ddeReturn = DdeCreateDataHandle(ddeInstance,
- (char *)returnString, (DWORD) len+1, 0, ddeItem,
+ (PBYTE)returnString, (DWORD) len+1, 0, ddeItem,
CF_TEXT, 0);
} else {
ddeReturn = NULL;
@@ -995,8 +995,8 @@ DdeServicesOnAck(
es = (struct DdeEnumServices *) GetWindowLong(hwnd, GWL_USERDATA);
#endif
- if ((es->service == (ATOM)NULL || es->service == service)
- && (es->topic == (ATOM)NULL || es->topic == topic)) {
+ if ((es->service == (ATOM)0 || es->service == service)
+ && (es->topic == (ATOM)0 || es->topic == topic)) {
Tcl_Obj *matchPtr = Tcl_NewListObj(0, NULL);
Tcl_Obj *resultPtr = Tcl_GetObjResult(es->interp);
@@ -1043,7 +1043,7 @@ DdeEnumWindowsCallback(
SendMessageTimeout(hwndTarget, WM_DDE_INITIATE, (WPARAM)es->hwnd,
MAKELONG(es->service, es->topic), SMTO_ABORTIFHUNG, 1000,
- &dwResult);
+ (PDWORD_PTR) &dwResult);
return TRUE;
}
@@ -1058,8 +1058,8 @@ DdeGetServicesList(
es.interp = interp;
es.result = TCL_OK;
es.service = (serviceName == NULL)
- ? (ATOM)NULL : GlobalAddAtom(serviceName);
- es.topic = (topicName == NULL) ? (ATOM)NULL : GlobalAddAtom(topicName);
+ ? (ATOM)0 : GlobalAddAtom(serviceName);
+ es.topic = (topicName == NULL) ? (ATOM)0 : GlobalAddAtom(topicName);
Tcl_ResetResult(interp); /* our list is to be appended to result. */
DdeCreateClient(&es);
@@ -1068,10 +1068,10 @@ DdeGetServicesList(
if (IsWindow(es.hwnd)) {
DestroyWindow(es.hwnd);
}
- if (es.service != (ATOM)NULL) {
+ if (es.service != (ATOM)0) {
GlobalDeleteAtom(es.service);
}
- if (es.topic != (ATOM)NULL) {
+ if (es.topic != (ATOM)0) {
GlobalDeleteAtom(es.topic);
}
return es.result;
@@ -1364,7 +1364,7 @@ Tcl_DdeObjCmd(
break;
}
- ddeData = DdeCreateDataHandle(ddeInstance, (char *)dataString,
+ ddeData = DdeCreateDataHandle(ddeInstance, (PBYTE)dataString,
(DWORD) dataLength+1, 0, 0, CF_TEXT, 0);
if (ddeData != NULL) {
if (async) {
@@ -1414,10 +1414,10 @@ Tcl_DdeObjCmd(
result = TCL_ERROR;
} else {
DWORD tmp;
- char *dataString = DdeAccessData(ddeData, &tmp);
+ char *dataString = (char *) DdeAccessData(ddeData, &tmp);
if (binary) {
- returnObjPtr = Tcl_NewByteArrayObj(dataString,
+ returnObjPtr = Tcl_NewByteArrayObj((unsigned char *)dataString,
(int) tmp);
} else {
returnObjPtr = Tcl_NewStringObj(dataString, -1);
@@ -1457,7 +1457,7 @@ Tcl_DdeObjCmd(
ddeItem = DdeCreateStringHandle(ddeInstance, itemString,
CP_WINANSI);
if (ddeItem != NULL) {
- ddeData = DdeClientTransaction((char *)dataString, (DWORD) length+1,
+ ddeData = DdeClientTransaction((PBYTE)dataString, (DWORD) length+1,
hConv, ddeItem, CF_TEXT, XTYP_POKE, 5000, NULL);
if (ddeData == NULL) {
SetDdeError(interp);
@@ -1599,7 +1599,7 @@ Tcl_DdeObjCmd(
objPtr = Tcl_ConcatObj(objc, objv);
string = Tcl_GetStringFromObj(objPtr, &length);
- ddeItemData = DdeCreateDataHandle(ddeInstance, (char *)string,
+ ddeItemData = DdeCreateDataHandle(ddeInstance, (PBYTE)string,
(DWORD) length+1, 0, 0, CF_TEXT, 0);
if (async) {
@@ -1642,7 +1642,7 @@ Tcl_DdeObjCmd(
length = DdeGetData(ddeData, NULL, 0, 0);
Tcl_SetObjLength(resultPtr, length);
string = Tcl_GetString(resultPtr);
- DdeGetData(ddeData, (char *)string, (DWORD) length, 0);
+ DdeGetData(ddeData, (PBYTE)string, (DWORD) length, 0);
Tcl_SetObjLength(resultPtr, (int) strlen(string));
if (Tcl_ListObjIndex(NULL, resultPtr, 0, &objPtr) != TCL_OK) {
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 16b4b3e..849e9a9 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinReg.c,v 1.45 2009/02/03 23:10:57 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinReg.c,v 1.46 2009/08/16 10:20:19 nijtmans Exp $
*/
#include "tclInt.h"
@@ -218,6 +218,7 @@ int
Registry_Init(
Tcl_Interp *interp)
{
+ int useWide;
Tcl_Command cmd;
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
@@ -229,11 +230,8 @@ Registry_Init(
* appropriate registry function table.
*/
- if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- regWinProcs = &unicodeProcs;
- } else {
- regWinProcs = &asciiProcs;
- }
+ useWide = (TclWinGetPlatformId() != VER_PLATFORM_WIN32_WINDOWS);
+ regWinProcs = useWide ? &unicodeProcs : &asciiProcs;
cmd = Tcl_CreateObjCommand(interp, "registry", RegistryObjCmd,
(ClientData)interp, DeleteCmd);
@@ -878,7 +876,7 @@ GetValue(
*/
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(
- Tcl_DStringValue(&data), (int) length));
+ (const unsigned char *)Tcl_DStringValue(&data), (int) length));
}
Tcl_DStringFree(&data);
return result;
@@ -1398,7 +1396,7 @@ SetValue(
* Store binary data in the registry.
*/
- data = Tcl_GetByteArrayFromObj(dataObj, &length);
+ data = (char *) Tcl_GetByteArrayFromObj(dataObj, &length);
result = regWinProcs->regSetValueExProc(key, valueName, 0,
(DWORD) type, (BYTE *) data, (DWORD) length);
}
@@ -1471,7 +1469,7 @@ BroadcastValue(
*/
result = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE,
- (WPARAM) 0, (LPARAM) str, SMTO_ABORTIFHUNG, timeout, &sendResult);
+ (WPARAM) 0, (LPARAM) str, SMTO_ABORTIFHUNG, timeout, (PDWORD_PTR) &sendResult);
objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewLongObj((long) result));