devmouse: produce signed msec timestamp in /dev/mouse, accept unsigned on write
This commit is contained in:
parent
34c7af22c1
commit
d07fb3261f
2 changed files with 3 additions and 3 deletions
|
@ -291,7 +291,7 @@ mouseread(Chan *c, void *va, long n, vlong off)
|
|||
b = 16;
|
||||
else if (b == 16)
|
||||
b = 8;
|
||||
sprint(buf, "m%11d %11d %11d %11lud ",
|
||||
sprint(buf, "m%11d %11d %11d %11ld ",
|
||||
m.xy.x, m.xy.y, b, m.msec);
|
||||
|
||||
mouse.lastcounter = m.counter;
|
||||
|
@ -448,7 +448,7 @@ mousewrite(Chan *c, void *va, long n, vlong)
|
|||
if(*p == 0)
|
||||
error(Eshort);
|
||||
b = strtol(p, &p, 0);
|
||||
msec = strtol(p, 0, 0);
|
||||
msec = (ulong)strtoll(p, 0, 0);
|
||||
if(msec == 0)
|
||||
msec = TK2MS(MACHP(0)->ticks);
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ mouseread(Chan *c, void *va, long n, vlong off)
|
|||
m = mouse.Mousestate;
|
||||
unlock(&mouse);
|
||||
|
||||
sprint(buf, "m%11d %11d %11d %11lud ",
|
||||
sprint(buf, "m%11d %11d %11d %11ld ",
|
||||
m.xy.x, m.xy.y, m.buttons, m.msec);
|
||||
|
||||
mouse.lastcounter = m.counter;
|
||||
|
|
Loading…
Reference in a new issue