summaryrefslogtreecommitdiffstats
path: root/win/tkWinSendCom.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2003-11-20 19:36:57 (GMT)
committervincentdarley <vincentdarley@noemail.net>2003-11-20 19:36:57 (GMT)
commitd1540c7dc61fa3c0b9ee27520a887123ab979729 (patch)
tree684fb4db11be849a8038c86b097a225aa442d1b3 /win/tkWinSendCom.c
parentca52c650c0397c8589060f12a1b04d124cf32852 (diff)
downloadtk-d1540c7dc61fa3c0b9ee27520a887123ab979729.zip
tk-d1540c7dc61fa3c0b9ee27520a887123ab979729.tar.gz
tk-d1540c7dc61fa3c0b9ee27520a887123ab979729.tar.bz2
winSend cleanup and bug fix -- these files need better documentation
FossilOrigin-Name: ea139e1e50b60de89fe8f69012d42b14466bff2b
Diffstat (limited to 'win/tkWinSendCom.c')
-rw-r--r--win/tkWinSendCom.c54
1 files changed, 20 insertions, 34 deletions
diff --git a/win/tkWinSendCom.c b/win/tkWinSendCom.c
index be612b8..b5e0686 100644
--- a/win/tkWinSendCom.c
+++ b/win/tkWinSendCom.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinSendCom.c,v 1.2 2003/10/08 21:49:57 patthoyts Exp $
+ * RCS: @(#) $Id: tkWinSendCom.c,v 1.3 2003/11/20 19:36:58 vincentdarley Exp $
*/
#include "tkWinSendCom.h"
@@ -260,27 +260,26 @@ WinSendCom_Invoke(
HRESULT hr = DISP_E_MEMBERNOTFOUND;
TkWinSendCom *this = (TkWinSendCom*)This;
- switch (dispidMember)
- {
+ switch (dispidMember) {
case TKWINSENDCOM_DISPID_SEND:
- if (wFlags | DISPATCH_METHOD)
- {
- if (pDispParams->cArgs != 1)
+ if (wFlags | DISPATCH_METHOD) {
+ if (pDispParams->cArgs != 1) {
hr = DISP_E_BADPARAMCOUNT;
- else
+ } else {
hr = Send(this, pDispParams->rgvarg[0],
pvarResult, pExcepInfo, puArgErr);
+ }
}
break;
case TKWINSENDCOM_DISPID_ASYNC:
- if (wFlags | DISPATCH_METHOD)
- {
- if (pDispParams->cArgs != 1)
+ if (wFlags | DISPATCH_METHOD) {
+ if (pDispParams->cArgs != 1) {
hr = DISP_E_BADPARAMCOUNT;
- else
+ } else {
hr = Async(this, pDispParams->rgvarg[0],
pExcepInfo, puArgErr);
+ }
}
break;
@@ -349,7 +348,7 @@ static HRESULT
Async(TkWinSendCom* obj, VARIANT Cmd, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HRESULT hr = S_OK;
- int r = TCL_OK;
+ int result = TCL_OK;
VARIANT vCmd;
VariantInit(&vCmd);
@@ -363,13 +362,11 @@ Async(TkWinSendCom* obj, VARIANT Cmd, EXCEPINFO *pExcepInfo, UINT *puArgErr)
}
- if (SUCCEEDED(hr))
- {
- if (obj->interp)
- {
+ if (SUCCEEDED(hr)) {
+ if (obj->interp) {
Tcl_Obj *scriptPtr = Tcl_NewUnicodeObj(vCmd.bstrVal,
(int)SysStringLen(vCmd.bstrVal));
- r = TkWinSend_QueueCommand(obj->interp, scriptPtr);
+ result = TkWinSend_QueueCommand(obj->interp, scriptPtr);
}
}
@@ -402,28 +399,24 @@ Send(TkWinSendCom* obj, VARIANT vCmd,
VARIANT* pvResult, EXCEPINFO* pExcepInfo, UINT *puArgErr)
{
HRESULT hr = S_OK;
- int r = TCL_OK;
+ int result = TCL_OK;
VARIANT v;
VariantInit(&v);
hr = VariantChangeType(&v, &vCmd, 0, VT_BSTR);
- if (SUCCEEDED(hr))
- {
- if (obj->interp)
- {
+ if (SUCCEEDED(hr)) {
+ if (obj->interp) {
Tcl_Obj *scriptPtr = Tcl_NewUnicodeObj(v.bstrVal,
(int)SysStringLen(v.bstrVal));
- r = Tcl_EvalObjEx(obj->interp, scriptPtr,
+ result = Tcl_EvalObjEx(obj->interp, scriptPtr,
TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL);
- if (pvResult)
- {
+ if (pvResult) {
VariantInit(pvResult);
pvResult->vt = VT_BSTR;
pvResult->bstrVal = SysAllocString(Tcl_GetUnicode(Tcl_GetObjResult(obj->interp)));
}
- if (r == TCL_ERROR)
- {
+ if (result == TCL_ERROR) {
hr = DISP_E_EXCEPTION;
SetExcepInfo(obj->interp, pExcepInfo);
}
@@ -433,10 +426,3 @@ Send(TkWinSendCom* obj, VARIANT vCmd,
return hr;
}
-/*
- * Local Variables:
- * mode: c
- * tab-width: 8
- * c-indentation-style: tcltk
- * End:
- */