1 |
hd_brummy 11/01/28 21:46:49 |
2 |
|
3 |
Added: vdr-exec-0.0.3_compile-warnings.diff |
4 |
Log: |
5 |
version bump; eapi=3; cleanup |
6 |
|
7 |
(Portage version: 2.1.9.25/cvs/Linux i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 media-plugins/vdr-exec/files/vdr-exec-0.0.3_compile-warnings.diff |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-exec/files/vdr-exec-0.0.3_compile-warnings.diff?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-exec/files/vdr-exec-0.0.3_compile-warnings.diff?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: vdr-exec-0.0.3_compile-warnings.diff |
16 |
=================================================================== |
17 |
fix compile warnings depend on asprintf |
18 |
|
19 |
Signed-of-by: Joerg Bornkessel <hd_brummy@××××××.or> (28 Jan 2011) |
20 |
|
21 |
diff -Naur exec-0.0.3.orig/compat.c exec-0.0.3/compat.c |
22 |
--- exec-0.0.3.orig/compat.c 2011-01-28 21:51:24.000000000 +0100 |
23 |
+++ exec-0.0.3/compat.c 2011-01-28 21:56:00.000000000 +0100 |
24 |
@@ -76,7 +76,7 @@ |
25 |
char res[1024]; /* have to fix this later! Risk */ |
26 |
|
27 |
memset(res,0,sizeof(res)); |
28 |
- asprintf(&buf, "%s; echo $?", Command); |
29 |
+ (0 < asprintf(&buf, "%s; echo $?", Command)); |
30 |
if(pipe.Open(buf,"r")) { |
31 |
while (fscanf (pipe,"%s",res) != EOF) { |
32 |
/* searching for last arg only. */ |
33 |
diff -Naur exec-0.0.3.orig/exec.c exec-0.0.3/exec.c |
34 |
--- exec-0.0.3.orig/exec.c 2011-01-28 21:51:24.000000000 +0100 |
35 |
+++ exec-0.0.3/exec.c 2011-01-28 21:58:18.000000000 +0100 |
36 |
@@ -100,7 +100,7 @@ |
37 |
bool cPluginExec::Start(void) |
38 |
{ |
39 |
// Start any background activities the plugin shall perform. |
40 |
- asprintf(&confdir, ConfigDirectory()); |
41 |
+ (0 < asprintf(&confdir, ConfigDirectory())); |
42 |
ExecTimers.Load(AddDirectory(confdir, "exectimers.conf")); |
43 |
ExecTimers.Modified(myState); /* sync myState to ExecTimers.state */ |
44 |
ExecLog.Load("/var/log/exec.log"); |
45 |
@@ -236,7 +236,7 @@ |
46 |
ReplyCode=501; /* syntax err */ |
47 |
return "invalid timer"; |
48 |
} |
49 |
- asprintf(&buf, "%s\n",*et->ToSVDRDescr()); |
50 |
+ (0 < asprintf(&buf, "%s\n",*et->ToSVDRDescr())); |
51 |
ReplyCode=250; /* success */ |
52 |
return cString(buf, true); |
53 |
} |
54 |
@@ -248,9 +248,9 @@ |
55 |
cExecTimer *et = ExecTimers.Get(index); |
56 |
if (et) { |
57 |
if (! buf) |
58 |
- asprintf(&buf,"%s\n", *et->ToSVDRDescr()); |
59 |
+ (0 < asprintf(&buf,"%s\n", *et->ToSVDRDescr())); |
60 |
else |
61 |
- asprintf(&buf,"%s%s\n", buf, *et->ToSVDRDescr()); |
62 |
+ (0 < asprintf(&buf,"%s%s\n", buf, *et->ToSVDRDescr())); |
63 |
} |
64 |
else { /* should never happen. */ |
65 |
log(0, "cPluginExec::SVDRPCommand(%s, %s)", Command, Option); |
66 |
@@ -317,9 +317,9 @@ |
67 |
cExecTimer *et = ExecTimers.GetNextActiveTimer(); |
68 |
ReplyCode=250; |
69 |
if (et) |
70 |
- asprintf(&buf,"next active timer %s", *et->ToSVDRDescr()); |
71 |
+ (0 < asprintf(&buf,"next active timer %s", *et->ToSVDRDescr())); |
72 |
else |
73 |
- asprintf(&buf,"no active timers."); |
74 |
+ (0 < asprintf(&buf,"no active timers.")); |
75 |
return buf; |
76 |
} |
77 |
|
78 |
@@ -328,9 +328,9 @@ |
79 |
cExecTimer *et = ExecTimers.GetNextWakeupTimer(); |
80 |
ReplyCode=250; |
81 |
if (et) |
82 |
- asprintf(&buf,"next wakeup timer %s", *et->ToSVDRDescr()); |
83 |
+ (0 < asprintf(&buf,"next wakeup timer %s", *et->ToSVDRDescr())); |
84 |
else |
85 |
- asprintf(&buf,"no wakeup timers."); |
86 |
+ (0 < asprintf(&buf,"no wakeup timers.")); |
87 |
return buf; |
88 |
} |
89 |
|
90 |
diff -Naur exec-0.0.3.orig/exectimer.c exec-0.0.3/exectimer.c |
91 |
--- exec-0.0.3.orig/exectimer.c 2011-01-28 21:51:24.000000000 +0100 |
92 |
+++ exec-0.0.3/exectimer.c 2011-01-28 22:02:28.000000000 +0100 |
93 |
@@ -66,8 +66,8 @@ |
94 |
|
95 |
cExecTimer::cExecTimer(time_t StartTime, const char * Command, int TimeOut) { |
96 |
startTime=StartTime; |
97 |
- asprintf(&command,Command); |
98 |
- asprintf(&wd_str,"AAAAAAA"); |
99 |
+ (0 < asprintf(&command,Command)); |
100 |
+ (0 < asprintf(&wd_str,"AAAAAAA")); |
101 |
timeout = TimeOut; |
102 |
active = true; |
103 |
running = false; |
104 |
@@ -146,47 +146,47 @@ |
105 |
case ET_WARNING : Action=4; break; |
106 |
default: Action=1; |
107 |
} |
108 |
- asprintf(&buffer,"%s:%s:%d:%d:%d:%d:%d:%s ", |
109 |
+ (0 < asprintf(&buffer,"%s:%s:%d:%d:%d:%d:%d:%s ", |
110 |
*PrintWeekdays(), *PrintTime(false), timeout, active?1:0, |
111 |
Action, (flags & ET_WAKEUP)?1:0, (flags & ET_BACKGROUND)?1:0, |
112 |
- command); |
113 |
+ command)); |
114 |
return cString(buffer, true); |
115 |
} |
116 |
|
117 |
cString cExecTimer::PrintWeekdays() const { |
118 |
char *buffer; |
119 |
if (weekdays == WD_IGNORED) |
120 |
- asprintf(&buffer, "%s", *PrintDay()); |
121 |
+ (0 < asprintf(&buffer, "%s", *PrintDay())); |
122 |
else |
123 |
- asprintf(&buffer, "%s%s%s%s%s%s%s", |
124 |
+ (0 < asprintf(&buffer, "%s%s%s%s%s%s%s", |
125 |
(weekdays & WD_MONDAY)? "M":"-", |
126 |
(weekdays & WD_TUESDAY)? "T":"-", |
127 |
(weekdays & WD_WEDNESDAY)? "W":"-", |
128 |
(weekdays & WD_THURSDAY)? "T":"-", |
129 |
(weekdays & WD_FRIDAY)? "F":"-", |
130 |
(weekdays & WD_SATURDAY)? "S":"-", |
131 |
- (weekdays & WD_SUNDAY)? "S":"-"); |
132 |
+ (weekdays & WD_SUNDAY)? "S":"-")); |
133 |
return cString(buffer, true); |
134 |
} |
135 |
|
136 |
cString cExecTimer::PrintDay() const { |
137 |
char *buffer; |
138 |
if (weekdays == WD_IGNORED) |
139 |
- asprintf(&buffer, "%04d-%02d-%02d", |
140 |
+ (0 < asprintf(&buffer, "%04d-%02d-%02d", |
141 |
Day / 10000, |
142 |
(Day % 10000) / 100, |
143 |
- (Day % 10000) % 100); |
144 |
+ (Day % 10000) % 100)); |
145 |
else |
146 |
- asprintf(&buffer, "----:--:--"); |
147 |
+ (0 < asprintf(&buffer, "----:--:--")); |
148 |
return cString(buffer, true); |
149 |
} |
150 |
|
151 |
cString cExecTimer::PrintTime(bool colon) const { |
152 |
char *buffer; |
153 |
- asprintf(&buffer, "%02d%s%02d", |
154 |
+ (0 < asprintf(&buffer, "%02d%s%02d", |
155 |
Time / 100, |
156 |
colon?":":"", |
157 |
- Time % 100); |
158 |
+ Time % 100)); |
159 |
return cString(buffer, true); |
160 |
} |
161 |
|
162 |
@@ -202,7 +202,7 @@ |
163 |
|
164 |
cString cExecTimer::Command() const { |
165 |
char *buffer; |
166 |
- asprintf(&buffer, "%s", command); |
167 |
+ (0 < asprintf(&buffer, "%s", command)); |
168 |
return cString(buffer, true); |
169 |
} |
170 |
|
171 |
@@ -276,7 +276,7 @@ |
172 |
return false; |
173 |
} |
174 |
if (command) free(command); |
175 |
- asprintf(&command,"%s", CmdStr); |
176 |
+ (0 < asprintf(&command,"%s", CmdStr)); |
177 |
weekdays = WD_IGNORED; |
178 |
switch (strlen(DayStr)) { |
179 |
case 10: /* YYYY-MM-DD */ |
180 |
@@ -466,7 +466,7 @@ |
181 |
*****************************************************************************/ |
182 |
|
183 |
cExecLogLine::cExecLogLine(const char * Str) { |
184 |
- asprintf(&str,Str); |
185 |
+ (0 < asprintf(&str,Str)); |
186 |
} |
187 |
|
188 |
cExecLogLine::~cExecLogLine() { |
189 |
@@ -475,13 +475,13 @@ |
190 |
|
191 |
cString cExecLogLine::Text(void) const { |
192 |
char *buffer; |
193 |
- asprintf(&buffer, "%s", str); |
194 |
+ (0 < asprintf(&buffer, "%s", str)); |
195 |
return cString(buffer, true); |
196 |
} |
197 |
|
198 |
bool cExecLogLine::Parse(const char * s) { |
199 |
if (str) free(str); |
200 |
- asprintf(&str,"%s", s); |
201 |
+ (0 < asprintf(&str,"%s", s)); |
202 |
return true; |
203 |
} |
204 |
|
205 |
diff -Naur exec-0.0.3.orig/exectimer.h exec-0.0.3/exectimer.h |
206 |
--- exec-0.0.3.orig/exectimer.h 2011-01-28 21:51:24.000000000 +0100 |
207 |
+++ exec-0.0.3/exectimer.h 2011-01-28 22:03:35.000000000 +0100 |
208 |
@@ -127,7 +127,7 @@ |
209 |
cString PrintTime (bool colon = false) const; |
210 |
cString Command () const; |
211 |
void SetCommand (const char *cmd) |
212 |
- { asprintf(&command,"%s",cmd); }; |
213 |
+ { (0 < asprintf(&command,"%s",cmd)); }; |
214 |
bool Execute (); |
215 |
}; |
216 |
|
217 |
diff -Naur exec-0.0.3.orig/menu.c exec-0.0.3/menu.c |
218 |
--- exec-0.0.3.orig/menu.c 2011-01-28 21:51:24.000000000 +0100 |
219 |
+++ exec-0.0.3/menu.c 2011-01-28 22:05:23.000000000 +0100 |
220 |
@@ -46,7 +46,7 @@ |
221 |
} |
222 |
if (toLog) { |
223 |
char *msg; |
224 |
- asprintf(&msg, "%s %s", timeStr, t); |
225 |
+ (0 < asprintf(&msg, "%s %s", timeStr, t)); |
226 |
ExecLog.AddToLog(msg); |
227 |
free(msg); |
228 |
} |
229 |
@@ -102,7 +102,7 @@ |
230 |
|
231 |
void cMenuExecAbout::AddText(const char * s, const char * t) { |
232 |
char * buf=NULL; |
233 |
- asprintf(&buf, "%s %s", s, t); |
234 |
+ (0 < asprintf(&buf, "%s %s", s, t)); |
235 |
cOsdItem * osditem = new cOsdItem(buf); |
236 |
Add(osditem); |
237 |
free(buf); |
238 |
@@ -111,7 +111,7 @@ |
239 |
cMenuExecAbout::cMenuExecAbout() { |
240 |
char * buf=NULL; |
241 |
|
242 |
- asprintf(&buf, "%s-%s", "exec", ExecVersion()); |
243 |
+ (0 < asprintf(&buf, "%s-%s", "exec", ExecVersion())); |
244 |
AddText(tr("Plugin:") , buf); |
245 |
free(buf); |
246 |
AddText(tr("Author:") , "Winfried Koehler"); |
247 |
@@ -140,7 +140,7 @@ |
248 |
|
249 |
void cMenuExecLog::AddText(const char * s) { |
250 |
char * buf=NULL; |
251 |
- asprintf(&buf, "%s", s); |
252 |
+ (0 < asprintf(&buf, "%s", s)); |
253 |
cOsdItem * osditem = new cOsdItem(buf); |
254 |
Add(osditem); |
255 |
free(buf); |
256 |
@@ -149,7 +149,7 @@ |
257 |
cMenuExecLog::cMenuExecLog() { |
258 |
char * buf=NULL; |
259 |
for (cExecLogLine *line = ExecLog.First(); line; line = ExecLog.Next(line)) { |
260 |
- asprintf(&buf, line->Text()); |
261 |
+ (0 < asprintf(&buf, line->Text())); |
262 |
AddText(buf); |
263 |
free(buf); |
264 |
} |
265 |
@@ -239,7 +239,7 @@ |
266 |
|
267 |
void cMenuExecTimerItem::Set(void) { |
268 |
char *buffer = NULL; |
269 |
- asprintf(&buffer, "%c\t%s\t%s\t%s\t%s", |
270 |
+ (0 < asprintf(&buffer, "%c\t%s\t%s\t%s\t%s", |
271 |
! et->isActive()?' ':et->isRunning()?'#':'>', |
272 |
*et->PrintWeekdays(), |
273 |
*et->PrintTime(), |
274 |
@@ -247,7 +247,7 @@ |
275 |
(et->Flags() & ET_SHUTDOWN)?"shutdown": |
276 |
(et->Flags() & ET_MESSAGE)?"message": |
277 |
(et->Flags() & ET_WARNING)?"warning":"unknown", |
278 |
- *et->Command()); |
279 |
+ *et->Command())); |
280 |
SetText(buffer, false); |
281 |
} |