Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] [PATCH] vdr-1.3.18 remote plugin
This seems to compile although I havnt had a chance to test it yet. There is a warning that I would
like to fix but am not sure really how:
remote.c:91: warning: comparison between signed and unsigned integer
expressions
remote.c:113: warning: comparison between signed and unsigned integer
expressions
remote.c:113: warning: comparison between signed and unsigned integer
expressions
--- vdr-1.3.17/PLUGINS/src/remote/remote.c.orig 2004-11-05 04:47:05.000000000 -0800
+++ vdr-1.3.18/PLUGINS/src/remote/remote.c 2005-01-09 08:32:41.000000000 -0800
@@ -67,7 +67,8 @@
void cRemoteGeneric::Action(void)
// ---------------------------------------------------------------------------
{
- int now, first = 0, last = 0;
+ cTimeMs FirstTime;
+ cTimeMs LastTime;
uint64 code, lastcode = INVALID_KEY;
bool repeat = false;
@@ -84,12 +85,10 @@
continue;
}
- now = time_ms();
-
if (keyPressed(code))
{
// key down
- if (now - last > repeattimeout)
+ if (LastTime.Elapsed() > repeattimeout)
{
if (repeat)
{
@@ -105,16 +104,17 @@
Put(code);
DSYSLOG("%s: press %016llx\n", device, code);
lastcode = code;
- last = first = now;
+ LastTime.Set();
+ FirstTime.Set();
repeat = false;
}
else
{
- if (now - first < repeatdelay || now - last < repeatfreq)
+ if (FirstTime.Elapsed() < repeatdelay || LastTime.Elapsed() < repeatfreq)
continue;
Put(code,true);
DSYSLOG("%s: repeat %016llx\n", device, code);
- last = now;
+ LastTime.Set();
repeat = true;
}
}
Home |
Main Index |
Thread Index