Tk Source Code

Check-in [c026b784]
Login

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

Overview
Comment:[Bug 3565533]: Purge use of variable that was only ever checked once immediately afterwards, except for one (buggy) case where it was checked without assignment.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c026b78479aebd50e598ec8a0243966a59d9b410
User & Date: dkf 2012-09-07 13:40:24
Context
2012-09-11
09:05
fix <Up> and <Down> binding in windows console check-in: 6249d7ae user: jan.nijtmans tags: trunk
2012-09-07
13:52
merge trunk check-in: f64ddbb3 user: dgp tags: core-8-6-b3-rc
13:40
[Bug 3565533]: Purge use of variable that was only ever checked once immediately afterwards, except for one (buggy) case where it was checked without assignment. check-in: c026b784 user: dkf tags: trunk
2012-08-30
19:18
Update changes for 8.6b3 check-in: dd090c36 user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2012-08-30  Andreas Kupries  <[email protected]>

	* generic/tkCanvWind.c (CanvasPsWindow): Unbreak AIX, replaced use
	of C99 comments in commit [961ae24a3f] (2012-08-27) with C89-style.
	* win/tkWinDialog.c: Unbreak windows problems with commit [961ae24a3f]
	* win/tkWinMenu.c: as well.
	* win/tkWinSend.c:
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2012-09-07  Donal K. Fellows  <[email protected]>

	* generic/tkCanvPs.c (TkCanvPostscriptCmd): [Bug 3565533]: Purge use
	of variable that was only ever checked once immediately afterwards,
	except for one (buggy) case where it was checked without assignment.

2012-08-30  Andreas Kupries  <[email protected]>

	* generic/tkCanvWind.c (CanvasPsWindow): Unbreak AIX, replaced use
	of C99 comments in commit [961ae24a3f] (2012-08-27) with C89-style.
	* win/tkWinDialog.c: Unbreak windows problems with commit [961ae24a3f]
	* win/tkWinMenu.c: as well.
	* win/tkWinSend.c:

Changes to generic/tkCanvPs.c.

166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    const char **argv)		/* Argument strings. Caller has already parsed
				 * this command enough to know that argv[1] is
				 * "postscript". */
{
    TkPostscriptInfo psInfo, *psInfoPtr = &psInfo;
    Tk_PostscriptInfo oldInfoPtr;
    int result;
    int written;
    Tk_Item *itemPtr;
#define STRING_LENGTH 400
    const char *p;
    time_t now;
    size_t length;
    Tk_Window tkwin = canvasPtr->tkwin;
    Tcl_HashSearch search;







<







166
167
168
169
170
171
172

173
174
175
176
177
178
179
    const char **argv)		/* Argument strings. Caller has already parsed
				 * this command enough to know that argv[1] is
				 * "postscript". */
{
    TkPostscriptInfo psInfo, *psInfoPtr = &psInfo;
    Tk_PostscriptInfo oldInfoPtr;
    int result;

    Tk_Item *itemPtr;
#define STRING_LENGTH 400
    const char *p;
    time_t now;
    size_t length;
    Tk_Window tkwin = canvasPtr->tkwin;
    Tcl_HashSearch search;
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
	/*
	 * Insert the prolog
	 */

	Tcl_AppendObjToObj(psObj, preambleObj);

	if (psInfo.chan != NULL) {
	    written = Tcl_WriteObj(psInfo.chan, psObj);
	    if (written == -1) {
	    channelWriteFailed:
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"problem writing postscript data to channel: %s",
			Tcl_PosixError(interp)));
		result = TCL_ERROR;
		goto cleanup;
	    }







|
<







487
488
489
490
491
492
493
494

495
496
497
498
499
500
501
	/*
	 * Insert the prolog
	 */

	Tcl_AppendObjToObj(psObj, preambleObj);

	if (psInfo.chan != NULL) {
	    if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {

	    channelWriteFailed:
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"problem writing postscript data to channel: %s",
			Tcl_PosixError(interp)));
		result = TCL_ERROR;
		goto cleanup;
	    }
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
		psInfo.x2, Tk_PostscriptY((double)psInfo.y,
			(Tk_PostscriptInfo)psInfoPtr),
		psInfo.x2, Tk_PostscriptY((double)psInfo.y2,
			(Tk_PostscriptInfo)psInfoPtr),
		psInfo.x, Tk_PostscriptY((double)psInfo.y2,
			(Tk_PostscriptInfo)psInfoPtr));
	if (psInfo.chan != NULL) {
	    written = Tcl_WriteObj(psInfo.chan, psObj);
	    if (written == -1) {
		goto channelWriteFailed;
	    }
	    Tcl_DecrRefCount(psObj);
	    psObj = Tcl_NewObj();
	}
    }








|
<







541
542
543
544
545
546
547
548

549
550
551
552
553
554
555
		psInfo.x2, Tk_PostscriptY((double)psInfo.y,
			(Tk_PostscriptInfo)psInfoPtr),
		psInfo.x2, Tk_PostscriptY((double)psInfo.y2,
			(Tk_PostscriptInfo)psInfoPtr),
		psInfo.x, Tk_PostscriptY((double)psInfo.y2,
			(Tk_PostscriptInfo)psInfoPtr));
	if (psInfo.chan != NULL) {
	    if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {

		goto channelWriteFailed;
	    }
	    Tcl_DecrRefCount(psObj);
	    psObj = Tcl_NewObj();
	}
    }

586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
	}

	Tcl_AppendToObj(psObj, "gsave\n", -1);
	Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
	Tcl_AppendToObj(psObj, "grestore\n", -1);

	if (psInfo.chan != NULL) {
	    written = Tcl_WriteObj(psInfo.chan, psObj);
	    if (written == -1) {
		goto channelWriteFailed;
	    }
	    Tcl_DecrRefCount(psObj);
	    psObj = Tcl_NewObj();
	}
    }

    /*
     * Output page-end information, such as commands to print the page and
     * document trailer stuff.
     */

    if (psInfo.prolog) {
	Tcl_AppendToObj(psObj,
		"restore showpage\n\n"
		"%%Trailer\n"
		"end\n"
		"%%EOF\n", -1);

	if (psInfo.chan != NULL) {
	    Tcl_WriteObj(psInfo.chan, psObj);
	    if (written == -1) {
		goto channelWriteFailed;
	    }
	}
    }

    if (psInfo.chan == NULL) {
	Tcl_SetObjResult(interp, psObj);







|
<




















|
<







583
584
585
586
587
588
589
590

591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611

612
613
614
615
616
617
618
	}

	Tcl_AppendToObj(psObj, "gsave\n", -1);
	Tcl_AppendObjToObj(psObj, Tcl_GetObjResult(interp));
	Tcl_AppendToObj(psObj, "grestore\n", -1);

	if (psInfo.chan != NULL) {
	    if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {

		goto channelWriteFailed;
	    }
	    Tcl_DecrRefCount(psObj);
	    psObj = Tcl_NewObj();
	}
    }

    /*
     * Output page-end information, such as commands to print the page and
     * document trailer stuff.
     */

    if (psInfo.prolog) {
	Tcl_AppendToObj(psObj,
		"restore showpage\n\n"
		"%%Trailer\n"
		"end\n"
		"%%EOF\n", -1);

	if (psInfo.chan != NULL) {
	    if (Tcl_WriteObj(psInfo.chan, psObj) == -1) {

		goto channelWriteFailed;
	    }
	}
    }

    if (psInfo.chan == NULL) {
	Tcl_SetObjResult(interp, psObj);