summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-03-03 23:54:10 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-03-03 23:54:10 (GMT)
commite3cc01895622b0949e83b829d84a4cb1fbedce4f (patch)
tree2150e64df587ef3521125c107097d1e3a3d81c9d
parenta072beb6c3788ba0416b47a505dddd7b73744535 (diff)
downloadtk-e3cc01895622b0949e83b829d84a4cb1fbedce4f.zip
tk-e3cc01895622b0949e83b829d84a4cb1fbedce4f.tar.gz
tk-e3cc01895622b0949e83b829d84a4cb1fbedce4f.tar.bz2
Backported some fixes for uninitialized variables identified by das using clang analysis.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tkFileFilter.c4
-rw-r--r--generic/tkFont.c4
-rw-r--r--generic/tkListbox.c7
4 files changed, 14 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 33ed7ce..bacee82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkFileFilter.c: Backported some fixes for uninitialized
+ * generic/tkFont.c: variables identified by das using clang
+ * generic/tkListbox.c: analysis.
+
2009-02-27 Pat Thoyts <patthoyts@users.sourceforge.net>
* generic/tkWindow.c: [Bug 2645457] check for dead windows after
diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c
index 06e63d6..21e6a93 100644
--- a/generic/tkFileFilter.c
+++ b/generic/tkFileFilter.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkFileFilter.c,v 1.10 2007/05/09 12:51:30 das Exp $
+ * RCS: @(#) $Id: tkFileFilter.c,v 1.10.4.1 2009/03/03 23:54:11 patthoyts Exp $
*/
#include "tkInt.h"
@@ -338,7 +338,7 @@ AddClause(
globPtr->next = NULL;
}
}
- if (ostypeCount > 0 && ostypeList != NULL) {
+ if (ostypeList != NULL && ostypeCount > 0) {
if (macRoman == NULL) {
macRoman = Tcl_GetEncoding(NULL, "macRoman");
}
diff --git a/generic/tkFont.c b/generic/tkFont.c
index f2d2441..e48a0d5 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkFont.c,v 1.42 2007/12/13 15:24:14 dgp Exp $
+ * RCS: @(#) $Id: tkFont.c,v 1.42.2.1 2009/03/03 23:54:11 patthoyts Exp $
*/
#include "tkInt.h"
@@ -2561,7 +2561,7 @@ Tk_CharBbox(
{
TextLayout *layoutPtr;
LayoutChunk *chunkPtr;
- int i, x, w;
+ int i, x = 0, w;
Tk_Font tkfont;
TkFont *fontPtr;
const char *end;
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index d7c339c..1edeff5 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkListbox.c,v 1.44.2.2 2008/10/09 21:20:45 dgp Exp $
+ * RCS: @(#) $Id: tkListbox.c,v 1.44.2.3 2009/03/03 23:54:11 patthoyts Exp $
*/
#include "default.h"
@@ -1343,8 +1343,6 @@ ListboxYviewSubCmd(
} else {
type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count);
switch (type) {
- case TK_SCROLL_ERROR:
- return TCL_ERROR;
case TK_SCROLL_MOVETO:
index = (int) (listPtr->nElements*fraction + 0.5);
break;
@@ -1358,6 +1356,9 @@ ListboxYviewSubCmd(
case TK_SCROLL_UNITS:
index = listPtr->topIndex + count;
break;
+ case TK_SCROLL_ERROR:
+ default:
+ return TCL_ERROR;
}
ChangeListboxView(listPtr, index);
}