Tcl Source Code

Check-in [3455fbea17]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the code slightly more pleasing to the eyes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-456
Files: files | file ages | folders
SHA1: 3455fbea17e25889481b579e580fd4a6b311e1ad
User & Date: limeboy 2017-01-01 22:19:26
Context
2017-01-04
12:55
TIP 456 implementation: Extend the C API to Support Passing ... check-in: b5c47b5b2f user: jan.nijtmans tags: trunk, tip-456
2017-01-01
22:19
Make the code slightly more pleasing to the eyes. Closed-Leaf check-in: 3455fbea17 user: limeboy tags: tip-456
2016-12-20
12:35
Make options -reuseaddr/-reuseport forbidden without -server, no matter the value being true or fals... check-in: bffa5b51a0 user: jan.nijtmans tags: tip-456
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclIOCmd.c.

1614
1615
1616
1617
1618
1619
1620







1621

1622
1623
1624
1625
1626
1627
1628
1629
    if (!server && (reusea != -1 || reusep != -1)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj(
		"options -reuseaddr and -reuseport are only valid for servers",
		-1));
	return TCL_ERROR;
    }








    if (reusea!=0) flags |= TCL_TCPSERVER_REUSEADDR;

    if (reusep==1) flags |= TCL_TCPSERVER_REUSEPORT;

    // All the arguments should have been parsed by now, 'a' points to the last
    // one, the port number.
    if (a != objc-1) {
	goto wrongNumArgs;
    }







>
>
>
>
>
>
>
|
>
|







1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
    if (!server && (reusea != -1 || reusep != -1)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj(
		"options -reuseaddr and -reuseport are only valid for servers",
		-1));
	return TCL_ERROR;
    }

    // Set the options to their default value if the user didn't override their
    // value.
    if (reusep == -1) reusep = 0;
    if (reusea == -1) reusea = 1;

    // Build the bitset with the flags values.
    if (reusea)
	flags |= TCL_TCPSERVER_REUSEADDR;
    if (reusep)
	flags |= TCL_TCPSERVER_REUSEPORT;

    // All the arguments should have been parsed by now, 'a' points to the last
    // one, the port number.
    if (a != objc-1) {
	goto wrongNumArgs;
    }