]> rtime.felk.cvut.cz Git - can-utils.git/commitdiff
candump: use UINT32_MAX define from stdint.h
authorOliver Hartkopp <socketcan@hartkopp.net>
Sat, 24 May 2014 19:44:51 +0000 (21:44 +0200)
committerOliver Hartkopp <socketcan@hartkopp.net>
Sat, 24 May 2014 19:44:51 +0000 (21:44 +0200)
Use the UINT32_MAX define from stdint.h instead of writing it into a comment.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
candump.c

index b67f3f8ecdf460b324a5e6fc60930fbec1197098..a4e80d527c3f9e967c014b981c2b49f43d6fd2fa 100644 (file)
--- a/candump.c
+++ b/candump.c
@@ -43,6 +43,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <unistd.h>
 #include <string.h>
 #include <signal.h>
@@ -678,7 +679,7 @@ int main(int argc, char **argv)
                                        if (dropcnt[i] > last_dropcnt[i])
                                                frames = dropcnt[i] - last_dropcnt[i];
                                        else
-                                               frames = 4294967295U - last_dropcnt[i] + dropcnt[i]; /* 4294967295U == UINT32_MAX */
+                                               frames = UINT32_MAX - last_dropcnt[i] + dropcnt[i];
 
                                        if (silent != SILENT_ON)
                                                printf("DROPCOUNT: dropped %d CAN frame%s on '%s' socket (total drops %d)\n",