summaryrefslogtreecommitdiffstats
path: root/win/tclWinDde.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-01-10 22:58:39 (GMT)
committernijtmans <nijtmans>2010-01-10 22:58:39 (GMT)
commita81c8243240443b1ffe54faec5e49d7e5dba4ee6 (patch)
treedbbc67aa5fc759bc2ea978873fb23e5c3a614329 /win/tclWinDde.c
parent997d61c0f6049d4bc0dd57aefc84e5f7f12c4ac2 (diff)
downloadtcl-a81c8243240443b1ffe54faec5e49d7e5dba4ee6.zip
tcl-a81c8243240443b1ffe54faec5e49d7e5dba4ee6.tar.gz
tcl-a81c8243240443b1ffe54faec5e49d7e5dba4ee6.tar.bz2
* win/tclWinDde.c: VC++ 6.0 doesn't have
* win/tclWinReg.c PDWORD_PTR * win/tclWinThrd.c: Fix various minor gcc warnings. * win/tclWinTime.c * win/tclWinConsole.c Put channel type definitions * win/tclWinChan.c in static const memory * win/tclWinPipe.c * win/tclWinSerial.c * win/tclWinSock.c * generic/tclIOGT.c * generic/tclIORChan.c * generic/tclIORTrans.c * unix/tclUnixChan.c * unix/tclUnixPipe.c * unix/tclUnixSock.c * unix/configure (regenerated with autoconf 2.59) * tests/info.test: Make test independant from tcltest implementation.
Diffstat (limited to 'win/tclWinDde.c')
-rw-r--r--win/tclWinDde.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index 4f94e76..40c44b7 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.39 2009/12/21 23:25:41 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinDde.c,v 1.40 2010/01/10 22:58:40 nijtmans Exp $
*/
#undef STATIC_BUILD
@@ -714,7 +714,7 @@ DdeServerProc(
}
if (convPtr != NULL) {
- const char *returnString;
+ BYTE *returnString;
len = DdeQueryString(ddeInstance, ddeItem, NULL, 0, CP_WINANSI);
Tcl_DStringInit(&dString);
@@ -723,9 +723,9 @@ DdeServerProc(
DdeQueryString(ddeInstance, ddeItem, utilString, (DWORD) len + 1,
CP_WINANSI);
if (strcasecmp(utilString, TCL_DDE_EXECUTE_RESULT) == 0) {
- returnString =
+ returnString = (BYTE *)
Tcl_GetStringFromObj(convPtr->returnPackagePtr, &len);
- ddeReturn = DdeCreateDataHandle(ddeInstance, (LPBYTE)returnString,
+ ddeReturn = DdeCreateDataHandle(ddeInstance, returnString,
(DWORD) len+1, 0, ddeItem, CF_TEXT, 0);
} else {
if (Tcl_IsSafe(convPtr->riPtr->interp)) {
@@ -735,10 +735,10 @@ DdeServerProc(
convPtr->riPtr->interp, utilString, NULL,
TCL_GLOBAL_ONLY);
if (variableObjPtr != NULL) {
- returnString = Tcl_GetStringFromObj(variableObjPtr,
- &len);
+ returnString = (BYTE *) Tcl_GetStringFromObj(
+ variableObjPtr, &len);
ddeReturn = DdeCreateDataHandle(ddeInstance,
- (PBYTE)returnString, (DWORD) len+1, 0, ddeItem,
+ returnString, (DWORD) len+1, 0, ddeItem,
CF_TEXT, 0);
} else {
ddeReturn = NULL;
@@ -889,7 +889,7 @@ MakeDdeConnection(
HCONV ddeConv;
ddeService = DdeCreateStringHandle(ddeInstance, TCL_DDE_SERVICE_NAME, 0);
- ddeTopic = DdeCreateStringHandle(ddeInstance, (LPTSTR) name, 0);
+ ddeTopic = DdeCreateStringHandle(ddeInstance, name, 0);
ddeConv = DdeConnect(ddeInstance, ddeService, ddeTopic, NULL);
DdeFreeStringHandle(ddeInstance, ddeService);
@@ -1041,12 +1041,12 @@ DdeEnumWindowsCallback(
HWND hwndTarget,
LPARAM lParam)
{
- LRESULT dwResult = 0;
+ DWORD dwResult = 0;
struct DdeEnumServices *es = (struct DdeEnumServices *) lParam;
SendMessageTimeout(hwndTarget, WM_DDE_INITIATE, (WPARAM)es->hwnd,
MAKELONG(es->service, es->topic), SMTO_ABORTIFHUNG, 1000,
- (PDWORD_PTR) &dwResult);
+ &dwResult);
return TRUE;
}
@@ -1173,7 +1173,8 @@ DdeObjCmd(
HSZ ddeService = NULL, ddeTopic = NULL, ddeItem = NULL, ddeCookie = NULL;
HDDEDATA ddeData = NULL, ddeItemData = NULL, ddeReturn;
HCONV hConv = NULL;
- const char *serviceName = NULL, *topicName = NULL, *string;
+ const char *serviceName = NULL, *topicName = NULL;
+ char *string;
DWORD ddeResult;
Tcl_Obj *objPtr, *handlerPtr = NULL;
@@ -1322,7 +1323,7 @@ DdeObjCmd(
if (length == 0) {
serviceName = NULL;
} else if ((index != DDE_SERVERNAME) && (index != DDE_EVAL)) {
- ddeService = DdeCreateStringHandle(ddeInstance, (LPTSTR) serviceName,
+ ddeService = DdeCreateStringHandle(ddeInstance, serviceName,
CP_WINANSI);
}
@@ -1331,7 +1332,7 @@ DdeObjCmd(
if (length == 0) {
topicName = NULL;
} else {
- ddeTopic = DdeCreateStringHandle(ddeInstance, (LPTSTR)topicName,
+ ddeTopic = DdeCreateStringHandle(ddeInstance, topicName,
CP_WINANSI);
}
}
@@ -1348,8 +1349,8 @@ DdeObjCmd(
case DDE_EXECUTE: {
int dataLength;
- const char *dataString = Tcl_GetStringFromObj(objv[firstArg + 2],
- &dataLength);
+ BYTE *dataString = (BYTE *) Tcl_GetStringFromObj(
+ objv[firstArg + 2], &dataLength);
if (dataLength == 0) {
Tcl_SetObjResult(interp,
@@ -1367,7 +1368,7 @@ DdeObjCmd(
break;
}
- ddeData = DdeCreateDataHandle(ddeInstance, (PBYTE)dataString,
+ ddeData = DdeCreateDataHandle(ddeInstance, dataString,
(DWORD) dataLength+1, 0, 0, CF_TEXT, 0);
if (ddeData != NULL) {
if (async) {
@@ -1407,7 +1408,7 @@ DdeObjCmd(
result = TCL_ERROR;
} else {
Tcl_Obj *returnObjPtr;
- ddeItem = DdeCreateStringHandle(ddeInstance, (char *)itemString,
+ ddeItem = DdeCreateStringHandle(ddeInstance, itemString,
CP_WINANSI);
if (ddeItem != NULL) {
ddeData = DdeClientTransaction(NULL, 0, hConv, ddeItem,
@@ -1417,13 +1418,13 @@ DdeObjCmd(
result = TCL_ERROR;
} else {
DWORD tmp;
- char *dataString = (char *) DdeAccessData(ddeData, &tmp);
+ const BYTE *dataString = DdeAccessData(ddeData, &tmp);
if (binary) {
- returnObjPtr = Tcl_NewByteArrayObj((unsigned char *)dataString,
+ returnObjPtr = Tcl_NewByteArrayObj(dataString,
(int) tmp);
} else {
- returnObjPtr = Tcl_NewStringObj(dataString, -1);
+ returnObjPtr = Tcl_NewStringObj((char *)dataString, -1);
}
DdeUnaccessData(ddeData);
DdeFreeDataHandle(ddeData);
@@ -1439,7 +1440,7 @@ DdeObjCmd(
}
case DDE_POKE: {
const char *itemString = Tcl_GetStringFromObj(objv[firstArg + 2], &length);
- const char *dataString;
+ BYTE *dataString;
if (length == 0) {
Tcl_SetObjResult(interp,
@@ -1447,7 +1448,7 @@ DdeObjCmd(
result = TCL_ERROR;
goto cleanup;
}
- dataString = Tcl_GetStringFromObj(objv[firstArg + 3], &length);
+ dataString = (BYTE *) Tcl_GetStringFromObj(objv[firstArg + 3], &length);
hConv = DdeConnect(ddeInstance, ddeService, ddeTopic, NULL);
DdeFreeStringHandle(ddeInstance, ddeService);
@@ -1457,10 +1458,10 @@ DdeObjCmd(
SetDdeError(interp);
result = TCL_ERROR;
} else {
- ddeItem = DdeCreateStringHandle(ddeInstance, (LPTSTR)itemString,
+ ddeItem = DdeCreateStringHandle(ddeInstance, itemString,
CP_WINANSI);
if (ddeItem != NULL) {
- ddeData = DdeClientTransaction((PBYTE)dataString, (DWORD) length+1,
+ ddeData = DdeClientTransaction(dataString, (DWORD) length+1,
hConv, ddeItem, CF_TEXT, XTYP_POKE, 5000, NULL);
if (ddeData == NULL) {
SetDdeError(interp);
@@ -1602,8 +1603,8 @@ DdeObjCmd(
objPtr = Tcl_ConcatObj(objc, objv);
string = Tcl_GetStringFromObj(objPtr, &length);
- ddeItemData = DdeCreateDataHandle(ddeInstance, (PBYTE)string,
- (DWORD) length+1, 0, 0, CF_TEXT, 0);
+ ddeItemData = DdeCreateDataHandle(ddeInstance,
+ (BYTE *) string, (DWORD) length+1, 0, 0, CF_TEXT, 0);
if (async) {
ddeData = DdeClientTransaction((LPBYTE) ddeItemData,
@@ -1645,7 +1646,7 @@ DdeObjCmd(
length = DdeGetData(ddeData, NULL, 0, 0);
Tcl_SetObjLength(resultPtr, length);
string = Tcl_GetString(resultPtr);
- DdeGetData(ddeData, (PBYTE)string, (DWORD) length, 0);
+ DdeGetData(ddeData, (BYTE *) string, (DWORD) length, 0);
Tcl_SetObjLength(resultPtr, (int) strlen(string));
if (Tcl_ListObjIndex(NULL, resultPtr, 0, &objPtr) != TCL_OK) {