File: remove_warnings.diff

package info (click to toggle)
asclock 2.0.12-37
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,480 kB
  • sloc: ansic: 1,229; sh: 179; makefile: 74
file content (208 lines) | stat: -rw-r--r-- 4,963 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# Description: Remove warnings
#  * Deal with unused return codes
#  * Comment out unused variables
# Author: Helge Kreutzmann <debian@helgefjell.de>
# Last-Update: 2020-04-25
Index: asclock-xlib-31/parser.c
===================================================================
--- asclock-xlib-31.orig/parser.c
+++ asclock-xlib-31/parser.c
@@ -14,39 +14,46 @@ static void buferr()
 
 int read_init(FILE *f)
 {
+  size_t readresult;
 
   file = f;
 
-  GETNEXT;
+  readresult=GETNEXT;
+  if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
 
   return TRUE;
 }
 
 int read_type(int *type) {
-  
+  size_t readresult;
+
   while(1) 
     {
       if(isalpha(next))
 	return TRUE;
 
-      GETNEXT;
+      readresult=GETNEXT;
 
       if(next=='*')
         while(1) {
-	  GETNEXT;
+	  readresult=GETNEXT;
+  	  if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
           if(next!='*') continue;
-          GETNEXT;
+          readresult=GETNEXT;
+  	  if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
           if(next=='/') break;
         }
       else if(next=='/') 
         while(1) {
-	  GETNEXT;
-	  if(next=='\n') { GETNEXT; break; }
+	  readresult=GETNEXT;
+  	  if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
+	  if(next=='\n') { readresult=GETNEXT; break; }
         }
 
       if(isalpha(next)) return TRUE;
 
-      GETNEXT;
+      readresult=GETNEXT;
+      if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
     }
   return TRUE;
 }
@@ -54,15 +61,21 @@ int read_type(int *type) {
 int read_token(char *str, int max)
 {
   int i;
+  size_t readresult;
+
   i = 0;
 
   while(isspace(next))
-    GETNEXT;
+  {
+    readresult=GETNEXT;
+    if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
+  }
 
   while( (isalnum(next) || (next=='_')) && (i<max)) 
     {
       str[i++] = next;
-      GETNEXT;
+      readresult=GETNEXT;
+      if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
     }
 
   if(i==max) buferr();
@@ -74,11 +87,16 @@ int read_token(char *str, int max)
 
 int read_assign() 
 {
+  size_t readresult;
 
   while(next!='=')
-    GETNEXT;
+  {
+    readresult=GETNEXT;
+    if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
+  }
 
-  GETNEXT;
+  readresult=GETNEXT;
+  if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
   
   return TRUE;
 }
@@ -86,15 +104,20 @@ int read_assign()
 int read_int(int *ret)
 {
   char buf[64];
+  size_t readresult;
   int i;
 
   while(isspace(next))
-    GETNEXT;
+  {
+    readresult=GETNEXT;
+    if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
+  }
 
   i = 0;
   while(isdigit(next) && (i<64)) {
     buf[i++]=next;
-    GETNEXT;
+    readresult=GETNEXT;
+    if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
   }
 
   if(i==64) buferr();
@@ -109,18 +132,16 @@ int read_int(int *ret)
 int read_semicolon() 
 {
 
+  size_t readresult;
+
   while(next!=';')
-    GETNEXT;
+  {
+    readresult=GETNEXT;
+    if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
+  }
 
-  GETNEXT;
+  readresult=GETNEXT;
+  if (readresult==0) { fprintf(stderr,"asclock: read zero characters instead of 1\n"); }
 
   return TRUE;
 }
-
-
-
-
-
-
-
-
Index: asclock-xlib-31/asclock.c
===================================================================
--- asclock-xlib-31.orig/asclock.c
+++ asclock-xlib-31/asclock.c
@@ -76,7 +76,7 @@ int main(int argc,char *argv[])
 {
   int i;
   int ret;
-  char themesdir[MAX_PATH_LEN] = "";
+  // char themesdir[MAX_PATH_LEN] = "";
   unsigned int borderwidth ;
   char *display_name = NULL; 
   char *wname = "asclock";
@@ -85,7 +85,7 @@ int main(int argc,char *argv[])
   XEvent Event;
   XTextProperty name;
   XClassHint classHint;
-  int hadArguments = 0;
+  // int hadArguments = 0;
   Geometry = "";
   
   /* Parse command line options */
@@ -246,7 +246,9 @@ int main(int argc,char *argv[])
 		RedrawWindow(&visible);
 	      break;
 	    case ButtonPress:
-	      system(exec_str);
+	      ret=system(exec_str);
+	      if (ret!=0)
+	      	{ fprintf(stderr,"asclock: System call failed\n"); }
 	      break;
 	    case DestroyNotify:
 	      /*
@@ -287,7 +289,7 @@ void nocolor(char *a, char *b)
 /* Konvertiere XPMIcons nach XImage */
 void GetXPM(void)
 {
-  XColor col;
+  // XColor col;
   XWindowAttributes attributes;
   int ret;
 
@@ -575,7 +577,7 @@ void swatch_beats(int beats_cnt)
 /****************************************************************************/
 void InsertTime()
 {
-  int thismonth, thisweekday, thisdate;
+  // int thismonth, thisweekday, thisdate;
 
   /* Zeit auslesen */
   actualtime = mytime();