From 2926cc260bcdcacebeb374e0900a8dec1ee66c4d Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 20 Jun 2006 11:01:23 +0000 Subject: [PATCH] Warning suppression and made sure it all works with 8.2 - 8.5 --- ChangeLog | 1 + doc/udp.man | 4 ++++ generic/udp_tcl.c | 8 ++++---- tests/all.tcl | 10 +++++++++- tests/udp-srv.test | 7 +++++-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 367a387..a7023d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * tests/udp-srv.test: Added new test file which runs a child proces as a udp server. + * tests/all.tcl: Support 8.2 and 8.3 test package. 2006-05-15 Pat Thoyts diff --git a/doc/udp.man b/doc/udp.man index 2d69487..6ad1e3c 100644 --- a/doc/udp.man +++ b/doc/udp.man @@ -30,12 +30,16 @@ if required. [call [cmd "udp_conf"] [arg "sock"] [arg "host"] [arg "port"]] +[emph Deprecated] in favour of the standard Tcl [cmd fconfigure] command. +[nl] [cmd udp_conf] in this configuration is used to specify the remote destination for packets written to this [arg "sock"]. You must call this command before writing data to the UDP socket. [call [cmd "udp_conf"] [arg "sock"] [arg [opt -myport]] [arg [opt -remote]] [arg [opt -peer]] [arg [opt "-broadcast bool"]] [arg [opt "-ttl count"]]] +[emph Deprecated] in favour of the standard Tcl [cmd fconfigure] command. +[nl] In addition to being used to configure the remote host, the [cmd "udp_conf"] command is used to obtain information about the UDP socket. diff --git a/generic/udp_tcl.c b/generic/udp_tcl.c index e19db8e..fdeae4a 100644 --- a/generic/udp_tcl.c +++ b/generic/udp_tcl.c @@ -394,11 +394,11 @@ udpConf(ClientData clientData, Tcl_Interp *interp, } else if (argc == 4) { if (!strcmp(argv[2], "-mcastadd")) { - r = UdpMulticast(statePtr, interp, argv[3], IP_ADD_MEMBERSHIP); + r = UdpMulticast((ClientData)statePtr, interp, argv[3], IP_ADD_MEMBERSHIP); } else if (!strcmp(argv[2], "-mcastdrop")) { - r = UdpMulticast(statePtr, interp, argv[3], IP_DROP_MEMBERSHIP); + r = UdpMulticast((ClientData)statePtr, interp, argv[3], IP_DROP_MEMBERSHIP); } else if (!strcmp(argv[2], "-broadcast")) { @@ -862,7 +862,7 @@ udpClose(ClientData instanceData, Tcl_Interp *interp) int n = 0; Tcl_ListObjGetElements(interp, statePtr->groupsObj, &objc, &objv); for (n = 0; n < objc; n++) { - UdpMulticast(statePtr, interp, + UdpMulticast((ClientData)statePtr, interp, Tcl_GetString(objv[n]), IP_DROP_MEMBERSHIP); } Tcl_DecrRefCount(statePtr->groupsObj); @@ -1217,7 +1217,7 @@ udpGetOption(ClientData instanceData, Tcl_Interp *interp, CONST84 char *optionName, Tcl_DString *optionValue) { UdpState *statePtr = (UdpState *)instanceData; - const char * options[] = { "myport", "remote", "peer", "mcastgroups", "broadcast", "ttl", NULL}; + CONST84 char * options[] = { "myport", "remote", "peer", "mcastgroups", "broadcast", "ttl", NULL}; int r = TCL_OK; if (optionName == NULL) { diff --git a/tests/all.tcl b/tests/all.tcl index d711f38..b415887 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -18,7 +18,15 @@ set ::tcltest::testSingleFile false set ::tcltest::testsDirectory [file dir [info script]] # We need to ensure that the testsDirectory is absolute -::tcltest::normalizePath ::tcltest::testsDirectory +if {[catch {::tcltest::normalizePath ::tcltest::testsDirectory}]} { + # The version of tcltest we have here does not support + # 'normalizePath', so we have to do this on our own. + + set oldpwd [pwd] + catch {cd $::tcltest::testsDirectory} + set ::tcltest::testsDirectory [pwd] + cd $oldpwd +} set chan $::tcltest::outputChannel diff --git a/tests/udp-srv.test b/tests/udp-srv.test index e3c5f30..28e5c84 100644 --- a/tests/udp-srv.test +++ b/tests/udp-srv.test @@ -1,6 +1,9 @@ -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest +if {[catch { + package require tcltest 2 namespace import -force ::tcltest::* +} err]} { + puts "skipping [file tail [info script]]: these tests require tcltest 2.0" + return } package require udp -- 2.23.0