Tcl Source Code

Check-in [8302182f6c]
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:Fix gcc warnings: variable set but not used
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 8302182f6c9acd0275dd97e4e9a3ca0d8cfa47fd
User & Date: jan.nijtmans 2011-03-08 22:14:44
Context
2011-03-09
15:49
* doc/tclvars.n: Formatting fix. Thanks to Pat Thotys.
check-in: a0de7bf8eb user: patthoyts tags: core-8-5-branch
14:56
* generic/tclNamesp.c: Tighten the detector of nested [namespace code] * tests/nam...
Closed-Leaf check-in: ac4c249ecf user: dgp tags: bug-3202171
2011-03-08
22:14
Fix gcc warnings: variable set but not used check-in: 8302182f6c user: jan.nijtmans tags: core-8-5-branch
21:40
Fix gcc warnings: variable set but not used check-in: 2da8478b61 user: jan.nijtmans tags: core-8-4-branch
19:24
* generic/tclInt.h: Remove TclMarkList() routine, an experimental * generic/tclU...
check-in: 43662324d4 user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19



2011-03-08  Don Porter  <[email protected]>

	* generic/tclInt.h:	Remove TclMarkList() routine, an experimental
	* generic/tclUtil.c:	dead-end from the 8.5 alpha days.

	* generic/tclResult.c (ResetObjResult):	Correct failure to clear
	invalid intrep.  Thanks to Colin McDonald. [Bug 3202905]

2011-03-07  Jan Nijtmans  <[email protected]>

	* unix/tclUnixInit: 

2011-03-06  Don Porter  <[email protected]>

	* generic/tclBasic.c:	More replacements of Tcl_UtfBackslash() calls
	* generic/tclCompile.c:	with TclParseBackslash() where possible.
	* generic/tclParse.c:
	* generic/tclUtil.c:

>
>
>
>








<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12




13
14
15
16
17
18
19
2011-03-08  Jan Nijtmans  <[email protected]>

	* generic/tclBasic.c: Fix gcc warnings: variable set but not used

2011-03-08  Don Porter  <[email protected]>

	* generic/tclInt.h:	Remove TclMarkList() routine, an experimental
	* generic/tclUtil.c:	dead-end from the 8.5 alpha days.

	* generic/tclResult.c (ResetObjResult):	Correct failure to clear
	invalid intrep.  Thanks to Colin McDonald. [Bug 3202905]





2011-03-06  Don Porter  <[email protected]>

	* generic/tclBasic.c:	More replacements of Tcl_UtfBackslash() calls
	* generic/tclCompile.c:	with TclParseBackslash() where possible.
	* generic/tclParse.c:
	* generic/tclUtil.c:

Changes to generic/tclBasic.c.

3660
3661
3662
3663
3664
3665
3666

3667
3668
3669
3670
3671
3672
3673
....
3678
3679
3680
3681
3682
3683
3684

3685
3686
3687
3688
3689
3690
3691
....
3752
3753
3754
3755
3756
3757
3758

3759
3760
3761
3762
3763
3764

3765
3766
3767
3768
3769
3770
3771
	    if (commandPtr) {
		Tcl_DecrRefCount(commandPtr);
	    }
	    goto reparseBecauseOfTraces;
	}
    }


    if (TCL_DTRACE_CMD_ARGS_ENABLED()) {
	char *a[10];
	int i = 0;

	while (i < 10) {
	    a[i] = i < objc ? TclGetString(objv[i]) : NULL; i++;
	}
................................................................................
	Tcl_Obj *info = TclInfoFrame(interp, iPtr->cmdFramePtr);
	char *a[4]; int i[2];

	TclDTraceInfo(info, a, i);
	TCL_DTRACE_CMD_INFO(a[0], a[1], a[2], a[3], i[0], i[1]);
	TclDecrRefCount(info);
    }


    /*
     * Finally, invoke the command's Tcl_ObjCmdProc.
     */

    cmdPtr->refCount++;
    iPtr->cmdCount++;
................................................................................
     * reset the string result.
     */

    if (*(iPtr->result) != 0) {
	(void) Tcl_GetObjResult(interp);
    }


    if (TCL_DTRACE_CMD_RESULT_ENABLED()) {
	Tcl_Obj *r;

	r = Tcl_GetObjResult(interp);
	TCL_DTRACE_CMD_RESULT(TclGetString(objv[0]), code, TclGetString(r),r);
    }


  done:
    if (savedVarFramePtr) {
	iPtr->varFramePtr = savedVarFramePtr;
    }
    return code;







>







 







>







 







>






>







3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
....
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
....
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
	    if (commandPtr) {
		Tcl_DecrRefCount(commandPtr);
	    }
	    goto reparseBecauseOfTraces;
	}
    }

#ifdef USE_DTRACE
    if (TCL_DTRACE_CMD_ARGS_ENABLED()) {
	char *a[10];
	int i = 0;

	while (i < 10) {
	    a[i] = i < objc ? TclGetString(objv[i]) : NULL; i++;
	}
................................................................................
	Tcl_Obj *info = TclInfoFrame(interp, iPtr->cmdFramePtr);
	char *a[4]; int i[2];

	TclDTraceInfo(info, a, i);
	TCL_DTRACE_CMD_INFO(a[0], a[1], a[2], a[3], i[0], i[1]);
	TclDecrRefCount(info);
    }
#endif /* USE_DTRACE */

    /*
     * Finally, invoke the command's Tcl_ObjCmdProc.
     */

    cmdPtr->refCount++;
    iPtr->cmdCount++;
................................................................................
     * reset the string result.
     */

    if (*(iPtr->result) != 0) {
	(void) Tcl_GetObjResult(interp);
    }

#ifdef USE_DTRACE
    if (TCL_DTRACE_CMD_RESULT_ENABLED()) {
	Tcl_Obj *r;

	r = Tcl_GetObjResult(interp);
	TCL_DTRACE_CMD_RESULT(TclGetString(objv[0]), code, TclGetString(r),r);
    }
#endif /* USE_DTRACE */

  done:
    if (savedVarFramePtr) {
	iPtr->varFramePtr = savedVarFramePtr;
    }
    return code;

Changes to generic/tclProc.c.

1708
1709
1710
1711
1712
1713
1714

1715
1716
1717
1718
1719
1720
1721
....
1728
1729
1730
1731
1732
1733
1734

1735
1736
1737
1738
1739
1740
1741
....
1743
1744
1745
1746
1747
1748
1749

1750
1751
1752
1753
1754
1755
1756
1757

1758
1759
1760
1761
1762
1763
1764
....
1821
1822
1823
1824
1825
1826
1827

1828
1829
1830
1831
1832
1833
1834

1835
1836
1837
1838
1839
1840
1841
	    fprintf(stdout, " ");
	}
	fprintf(stdout, "\n");
	fflush(stdout);
    }
#endif /*TCL_COMPILE_DEBUG*/


    if (TCL_DTRACE_PROC_ARGS_ENABLED()) {
	char *a[10];
	int i = 0;
	int l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;

	while (i < 10) {
	    a[i] = (l < iPtr->varFramePtr->objc ?
................................................................................
	Tcl_Obj *info = TclInfoFrame(interp, iPtr->cmdFramePtr);
	char *a[4]; int i[2];

	TclDTraceInfo(info, a, i);
	TCL_DTRACE_PROC_INFO(a[0], a[1], a[2], a[3], i[0], i[1]);
	TclDecrRefCount(info);
    }


    /*
     * Invoke the commands in the procedure's body.
     */

    procPtr->refCount++;
    iPtr->numLevels++;
................................................................................
    if (TclInterpReady(interp) == TCL_ERROR) {
	result = TCL_ERROR;
    } else {
	register ByteCode *codePtr =
		procPtr->bodyPtr->internalRep.otherValuePtr;

	codePtr->refCount++;

	if (TCL_DTRACE_PROC_ENTRY_ENABLED()) {
	    int l;

	    l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 2 : 1;
	    TCL_DTRACE_PROC_ENTRY(TclGetString(procNameObj),
		    iPtr->varFramePtr->objc - l,
		    (Tcl_Obj **)(iPtr->varFramePtr->objv + l));
	}

	result = TclExecuteByteCode(interp, codePtr);
	if (TCL_DTRACE_PROC_RETURN_ENABLED()) {
	    TCL_DTRACE_PROC_RETURN(TclGetString(procNameObj), result);
	}
	codePtr->refCount--;
	if (codePtr->refCount <= 0) {
	    TclCleanupByteCode(codePtr);
................................................................................
	 * and neatly. Who knows how well they are handled by third-party code
	 * though...
	 */

	(void) 0;		/* do nothing */
    }


    if (TCL_DTRACE_PROC_RESULT_ENABLED()) {
	Tcl_Obj *r;

	r = Tcl_GetObjResult(interp);
	TCL_DTRACE_PROC_RESULT(TclGetString(procNameObj), result,
		TclGetString(r), r);
    }


  procDone:
    /*
     * Free the stack-allocated compiled locals and CallFrame. It is important
     * to pop the call frame without freeing it first: the compiledLocals
     * cannot be freed before the frame is popped, as the local variables must
     * be deleted. But the compiledLocals must be freed first, as they were






>







 







>







 







>








>







 







>







>







1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
....
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
....
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
....
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
	    fprintf(stdout, " ");
	}
	fprintf(stdout, "\n");
	fflush(stdout);
    }
#endif /*TCL_COMPILE_DEBUG*/

#ifdef USE_DTRACE
    if (TCL_DTRACE_PROC_ARGS_ENABLED()) {
	char *a[10];
	int i = 0;
	int l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;

	while (i < 10) {
	    a[i] = (l < iPtr->varFramePtr->objc ?
................................................................................
	Tcl_Obj *info = TclInfoFrame(interp, iPtr->cmdFramePtr);
	char *a[4]; int i[2];

	TclDTraceInfo(info, a, i);
	TCL_DTRACE_PROC_INFO(a[0], a[1], a[2], a[3], i[0], i[1]);
	TclDecrRefCount(info);
    }
#endif /* USE_DTRACE */

    /*
     * Invoke the commands in the procedure's body.
     */

    procPtr->refCount++;
    iPtr->numLevels++;
................................................................................
    if (TclInterpReady(interp) == TCL_ERROR) {
	result = TCL_ERROR;
    } else {
	register ByteCode *codePtr =
		procPtr->bodyPtr->internalRep.otherValuePtr;

	codePtr->refCount++;
#ifdef USE_DTRACE
	if (TCL_DTRACE_PROC_ENTRY_ENABLED()) {
	    int l;

	    l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 2 : 1;
	    TCL_DTRACE_PROC_ENTRY(TclGetString(procNameObj),
		    iPtr->varFramePtr->objc - l,
		    (Tcl_Obj **)(iPtr->varFramePtr->objv + l));
	}
#endif /* USE_DTRACE */
	result = TclExecuteByteCode(interp, codePtr);
	if (TCL_DTRACE_PROC_RETURN_ENABLED()) {
	    TCL_DTRACE_PROC_RETURN(TclGetString(procNameObj), result);
	}
	codePtr->refCount--;
	if (codePtr->refCount <= 0) {
	    TclCleanupByteCode(codePtr);
................................................................................
	 * and neatly. Who knows how well they are handled by third-party code
	 * though...
	 */

	(void) 0;		/* do nothing */
    }

#ifdef USE_DTRACE
    if (TCL_DTRACE_PROC_RESULT_ENABLED()) {
	Tcl_Obj *r;

	r = Tcl_GetObjResult(interp);
	TCL_DTRACE_PROC_RESULT(TclGetString(procNameObj), result,
		TclGetString(r), r);
    }
#endif /* USE_DTRACE */

  procDone:
    /*
     * Free the stack-allocated compiled locals and CallFrame. It is important
     * to pop the call frame without freeing it first: the compiledLocals
     * cannot be freed before the frame is popped, as the local variables must
     * be deleted. But the compiledLocals must be freed first, as they were