File: uninitialized.patch

package info (click to toggle)
blt 3.0~1%2B08570046%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 45,556 kB
  • sloc: ansic: 278,852; tcl: 96,434; sh: 3,410; makefile: 2,026; cpp: 374
file content (50 lines) | stat: -rw-r--r-- 1,523 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Description: Patch initializes all variables for which GCC gave warnings
    about unitialized or maybe unitialized variables.
Author: Sergei Golovan
Last-Modified: Sun, 18 May 2025 11:38:09 +0300

--- a/src/bltUnixPainter.c
+++ b/src/bltUnixPainter.c
@@ -1656,7 +1656,7 @@
                                          * completely contained by the
                                          * drawable. */
 {
-    Pict *destPtr;
+    Pict *destPtr = NULL;
 
     if (x < 0) {
         w += x;
--- a/src/bltPictGif.c
+++ b/src/bltPictGif.c
@@ -977,7 +977,10 @@
     lzwPtr->max_dataVal = (1 << codeSize) - 1;
     lzwPtr->clear_code = lzwPtr->max_dataVal + 1;
     lzwPtr->end_code = lzwPtr->max_dataVal + 2;
-    
+
+    lzwPtr->firstcode = -1;
+    lzwPtr->prevcode = -1;
+
     /* 
      * The entries in the translation table for true data codes are constant
      * throughout the stream.  We set them now and they never change.
--- a/src/bltUnixWindow.c
+++ b/src/bltUnixWindow.c
@@ -299,13 +299,17 @@
 void
 Blt_InitFeaturesArray(Tcl_Interp *interp) 
 {
+#if defined(HAVE_XRRQUERYEXTENSION) || defined(HAVE_XSHMQUERYEXTENSION) || defined(HAVE_XRENDERQUERYEXTENSION)
     Tk_Window tkwin;
     Display *display;
+#endif
     Tcl_Obj *objPtr;
     int state;
 
+#if defined(HAVE_XRRQUERYEXTENSION) || defined(HAVE_XSHMQUERYEXTENSION) || defined(HAVE_XRENDERQUERYEXTENSION)
     tkwin = Tk_MainWindow(interp);
     display = Tk_Display(tkwin);
+#endif
 #ifdef HAVE_XRRQUERYEXTENSION
     {
         int majorNum, minorNum;