- rcsim: fix compiler warning

This commit is contained in:
striper
2013-10-04 09:44:34 +02:00
committed by svenhoefer
parent 4ab9dd6cb2
commit 279c8d133c

View File

@@ -180,7 +180,7 @@ int main (int argc, char **argv){
int evd;
unsigned long sendcode=KEY_0;
unsigned int keys = sizeof(keyname)/sizeof(struct key);
unsigned long time=0;
unsigned long rctime=0;
unsigned long reptime=500;
unsigned int offset;
@@ -212,7 +212,7 @@ int main (int argc, char **argv){
}
if (argc>=3){
time=(atol (argv[2])*1000)/reptime;
rctime=(atol (argv[2])*1000)/reptime;
}
#ifdef HAVE_DBOX_HARDWARE
@@ -224,13 +224,13 @@ int main (int argc, char **argv){
#else
evd = -1; // close(-1) does not harm... ;)
#endif
printf ("sending key %s for %ld seconds\n",keyname[offset].name,(reptime*time)/1000);
printf ("sending key %s for %ld seconds\n",keyname[offset].name,(reptime*rctime)/1000);
if (push (evd,sendcode,KEY_PRESSED)<0){
perror ("writing 'key_pressed' event failed");
close (evd);
return 1;
}
while (time--){
while (rctime--){
usleep(reptime*1000);
if (push (evd,sendcode,KEY_AUTOREPEAT)<0){
perror ("writing 'key_autorepeat' event failed");