summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredman <redman>1999-08-12 17:38:49 (GMT)
committerredman <redman>1999-08-12 17:38:49 (GMT)
commitfd628b582dd6a8acaa2628db880ae38b454b9832 (patch)
tree4be5734bc6aa947b2c74190e7d604e0950f897f8
parent0bb185a015acf8108be87d21d765ba537fb27999 (diff)
downloadtcl-fd628b582dd6a8acaa2628db880ae38b454b9832.zip
tcl-fd628b582dd6a8acaa2628db880ae38b454b9832.tar.gz
tcl-fd628b582dd6a8acaa2628db880ae38b454b9832.tar.bz2
Applied patch to remove compiler warning.
-rw-r--r--ChangeLog5
-rw-r--r--win/tclWinSerial.c95
2 files changed, 53 insertions, 47 deletions
diff --git a/ChangeLog b/ChangeLog
index 39f979e..db22963 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-08-12 Scott Redman <redman@scriptics.com>
+
+ * win/tclWinSerial.c: Applied patch from Petteri Kettunen to
+ remove compiler warning.
+
1999-08-10 Scott Redman <redman@scriptics.com>
* generic/tclAlloc.c:
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index 5ff5e96..67b29b4 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -10,7 +10,7 @@
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
* Changes by Rolf.Schroedter@dlr.de June 25-27, 1999
*
- * RCS: @(#) $Id: tclWinSerial.c,v 1.6 1999/07/22 00:06:10 redman Exp $
+ * RCS: @(#) $Id: tclWinSerial.c,v 1.7 1999/08/12 17:38:49 redman Exp $
*/
#include "tclWinInt.h"
@@ -961,54 +961,55 @@ SerialSetOptionProc(instanceData, interp, optionName, value)
Tcl_Interp *interp; /* For error reporting - can be NULL. */
char *optionName; /* Which option to set? */
char *value; /* New value for option. */
- {
- SerialInfo *infoPtr;
- DCB dcb;
- int len;
- BOOL result;
- Tcl_DString ds;
- TCHAR *native;
-
- infoPtr = (SerialInfo *) instanceData;
-
- len = strlen(optionName);
- if ((len > 1) && (strncmp(optionName, "-mode", len) == 0)) {
- if (GetCommState(infoPtr->handle, &dcb)) {
- native = Tcl_WinUtfToTChar(value, -1, &ds);
- result = (*tclWinProcs->buildCommDCBProc)(native, &dcb);
- Tcl_DStringFree(&ds);
-
- if ((result == FALSE) ||
+{
+ SerialInfo *infoPtr;
+ DCB dcb;
+ int len;
+ BOOL result;
+ Tcl_DString ds;
+ TCHAR *native;
+
+ infoPtr = (SerialInfo *) instanceData;
+
+ len = strlen(optionName);
+ if ((len > 1) && (strncmp(optionName, "-mode", len) == 0)) {
+ if (GetCommState(infoPtr->handle, &dcb)) {
+ native = Tcl_WinUtfToTChar(value, -1, &ds);
+ result = (*tclWinProcs->buildCommDCBProc)(native, &dcb);
+ Tcl_DStringFree(&ds);
+
+ if ((result == FALSE) ||
(SetCommState(infoPtr->handle, &dcb) == FALSE)) {
- /*
- * one should separate the 2 errors...
- */
-
- if (interp) {
- Tcl_AppendResult(interp,
- "bad value for -mode: should be ",
- "baud,parity,data,stop", NULL);
- }
- return TCL_ERROR;
- } else {
- return TCL_OK;
- }
- } else {
- if (interp) {
- Tcl_AppendResult(interp, "can't get comm state", NULL);
- }
- return TCL_ERROR;
- }
- } else if ((len > 1) &&
- (strncmp(optionName, "-pollinterval", len) == 0)) {
- if ( Tcl_GetInt(interp, value, &(infoPtr->blockTime)) != TCL_OK ) {
- return TCL_ERROR;
- }
- } else {
- return Tcl_BadChannelOption(interp, optionName,
- "mode pollinterval");
- }
+ /*
+ * one should separate the 2 errors...
+ */
+
+ if (interp) {
+ Tcl_AppendResult(interp,
+ "bad value for -mode: should be ",
+ "baud,parity,data,stop", NULL);
+ }
+ return TCL_ERROR;
+ } else {
+ return TCL_OK;
+ }
+ } else {
+ if (interp) {
+ Tcl_AppendResult(interp, "can't get comm state", NULL);
+ }
+ return TCL_ERROR;
+ }
+ } else if ((len > 1) &&
+ (strncmp(optionName, "-pollinterval", len) == 0)) {
+ if ( Tcl_GetInt(interp, value, &(infoPtr->blockTime)) != TCL_OK ) {
+ return TCL_ERROR;
+ }
+ } else {
+ return Tcl_BadChannelOption(interp, optionName,
+ "mode pollinterval");
}
+ return TCL_ERROR;
+}
/*
*----------------------------------------------------------------------