Module Name:    src
Committed By:   christos
Date:           Wed Aug 31 16:32:48 UTC 2011

Modified Files:
        src/usr.sbin/moused: moused.c

Log Message:
don't truncate time_t


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/moused/moused.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/moused/moused.c
diff -u src/usr.sbin/moused/moused.c:1.21 src/usr.sbin/moused/moused.c:1.22
--- src/usr.sbin/moused/moused.c:1.21	Wed Aug 31 04:15:08 2011
+++ src/usr.sbin/moused/moused.c	Wed Aug 31 12:32:48 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: moused.c,v 1.21 2011/08/31 08:15:08 gson Exp $ */
+/* $NetBSD: moused.c,v 1.22 2011/08/31 16:32:48 christos Exp $ */
 /**
  ** Copyright (c) 1995 Michael Smith, All rights reserved.
  **
@@ -48,7 +48,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: moused.c,v 1.21 2011/08/31 08:15:08 gson Exp $");
+__RCSID("$NetBSD: moused.c,v 1.22 2011/08/31 16:32:48 christos Exp $");
 #endif /* not lint */
 
 #include <ctype.h>
@@ -70,6 +70,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/socket.h>
+#include <stdint.h>
 #include <sys/un.h>
 #include <poll.h>
 #include <unistd.h>
@@ -2152,7 +2153,7 @@
     tv2.tv_sec = rodent.clickthreshold/1000;
     tv2.tv_usec = (rodent.clickthreshold%1000)*1000;
     timersub(&tv1, &tv2, &tv); 
-    debug("tv:  %ld %ld", (long)tv.tv_sec, (long)tv.tv_usec);
+    debug("tv:  %jd %jd", (intmax_t)tv.tv_sec, (intmax_t)tv.tv_usec);
 
     /* 3 button emulation timeout */
     tv2.tv_sec = rodent.button2timeout/1000;
@@ -2164,8 +2165,9 @@
         if (mask & 1) {
             if (act->button & button) {
                 /* the button is down */
-    		debug("  :  %ld %ld", 
-		    (long)bstate[i].tv.tv_sec, (long)bstate[i].tv.tv_usec);
+    		debug("  :  %jd %jd", 
+		    (intmax_t)bstate[i].tv.tv_sec,
+		    (intmax_t)bstate[i].tv.tv_usec);
 		if (timercmp(&tv, &bstate[i].tv, >)) {
                     bstate[i].count = 1;
                 } else {

Reply via email to