--- a/timertest.c +++ b/timertest.c @@ -38,6 +38,9 @@ #include #include "dahdi_tools_version.h" +#define TIME_T_FMT "lld" +#define TIME_T_CAST(x) ((long long)(x)) + int main(int argc, char *argv[]) { int fd; @@ -72,7 +75,7 @@ int main(int argc, char *argv[]) exit(1); } gettimeofday(&now, NULL); - printf("Timer Expired (%ld ms)!\n", (now.tv_sec - orig.tv_sec) * 1000 + (now.tv_usec - orig.tv_usec) / 1000); + printf("Timer Expired (%" TIME_T_FMT " ms)!\n", TIME_T_CAST((now.tv_sec - orig.tv_sec) * 1000 + (now.tv_usec - orig.tv_usec) / 1000)); } exit(0); }