summaryrefslogtreecommitdiffstats
path: root/win/tkWinSend.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinSend.c')
-rw-r--r--win/tkWinSend.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/win/tkWinSend.c b/win/tkWinSend.c
index c1f9193..e191609 100644
--- a/win/tkWinSend.c
+++ b/win/tkWinSend.c
@@ -10,16 +10,12 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinSend.c,v 1.15.2.1 2010/03/12 13:02:36 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinSend.c,v 1.25 2010/09/28 08:22:30 nijtmans Exp $
*/
#include "tkInt.h"
#include "tkWinSendCom.h"
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#endif
-
/*
* Should be defined in WTypes.h but mingw 1.0 is missing them.
*/
@@ -171,7 +167,7 @@ Tk_SetAppName(
if (riPtr == NULL) {
LPUNKNOWN *objPtr;
- riPtr = (RegisteredInterp *) ckalloc(sizeof(RegisteredInterp));
+ riPtr = ckalloc(sizeof(RegisteredInterp));
memset(riPtr, 0, sizeof(RegisteredInterp));
riPtr->interp = interp;
@@ -328,7 +324,7 @@ Tk_SendObjCmd(
enum {
SEND_ASYNC, SEND_DISPLAYOF, SEND_LAST
};
- static const char *sendOptions[] = {
+ static const char *const sendOptions[] = {
"-async", "-displayof", "--", NULL
};
int result = TCL_OK;
@@ -369,9 +365,8 @@ Tk_SendObjCmd(
*/
if (displayPtr) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- "option not implemented: \"displayof\" is not available "
- "for this platform.", -1);
+ Tcl_SetResult(interp, "option not implemented: \"displayof\" is "
+ "not available for this platform.", TCL_STATIC);
result = TCL_ERROR;
}
@@ -381,6 +376,7 @@ Tk_SendObjCmd(
/* FIX ME: we need to check for local interp */
if (result == TCL_OK) {
LPDISPATCH pdisp;
+
result = FindInterpreterObject(interp, Tcl_GetString(objv[i]), &pdisp);
if (result == TCL_OK) {
i++;
@@ -793,7 +789,7 @@ Send(
if (ei.bstrSource != NULL) {
int len;
- char *szErrorInfo;
+ const char *szErrorInfo;
opError = Tcl_NewUnicodeObj(ei.bstrSource, -1);
Tcl_ListObjIndex(interp, opError, 0, &opErrorCode);
@@ -841,9 +837,9 @@ Win32ErrorObj(
TCHAR sBuffer[30];
Tcl_Obj* errPtr = NULL;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, (DWORD)hrError, LANG_NEUTRAL,
- (LPTSTR)&lpBuffer, 0, NULL);
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD)hrError,
+ LANG_NEUTRAL, (LPTSTR)&lpBuffer, 0, NULL);
if (lpBuffer == NULL) {
lpBuffer = sBuffer;
@@ -957,7 +953,7 @@ TkWinSend_QueueCommand(
TRACE("SendQueueCommand()\n");
- evPtr = (SendEvent *)ckalloc(sizeof(SendEvent));
+ evPtr = ckalloc(sizeof(SendEvent));
evPtr->header.proc = SendEventProc;
evPtr->header.nextPtr = NULL;
evPtr->interp = interp;
@@ -1038,8 +1034,8 @@ SendTrace(
static char buffer[1024];
va_start(args, format);
- vsnprintf(buffer, 1023, format, args);
- OutputDebugString(buffer);
+ _vsnprintf(buffer, 1023, format, args);
+ OutputDebugStringA(buffer);
va_end(args);
}