r1228: use int64_t instead of long long
authorStefan Metzmacher <metze@samba.org>
Wed, 23 Jun 2004 15:22:41 +0000 (15:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:56:45 +0000 (12:56 -0500)
(jra: please use: void, char int, uint_t, [u]int<8|16|32|64>_t types in new code)

metze
(This used to be commit 626bb153c45405f93a96bc5019241af506fac163)

source4/lib/time.c
source4/torture/basic/denytest.c
source4/torture/torture.c

index 9d906af2fae8d5ae24999776ba6555f8db4f5e20..bd8d7ddb30e731c071f53a97ed8e7b227dc18476 100644 (file)
@@ -410,9 +410,9 @@ NTTIME nttime_from_string(const char *s)
        return strtoull(s, NULL, 0);
 }
 
-long long usec_time_diff(struct timeval *larget, struct timeval *smallt)
+int64_t usec_time_diff(struct timeval *larget, struct timeval *smallt)
 {
-       long long sec_diff = larget->tv_sec - smallt->tv_sec;
-       return (sec_diff * 1000000) + (long long)(larget->tv_usec - smallt->tv_usec);
+       int64_t sec_diff = larget->tv_sec - smallt->tv_sec;
+       return (sec_diff * 1000000) + (int64_t)(larget->tv_usec - smallt->tv_usec);
 }
 
index 13cb38633c6fcc66dc1130bf38c39425f49f732b..ec4a8352404475fa6f6213f663275f0103c1fa76 100644 (file)
@@ -1464,7 +1464,7 @@ BOOL torture_denytest1(int dummy)
                }
 
                if (torture_showall || res != denytable1[i].result) {
-                       long long tdif;
+                       int64_t tdif;
                        GetTimeOfDay(&tv);
                        tdif = usec_time_diff(&tv, &tv_start);
                        tdif /= 1000;
@@ -1558,7 +1558,7 @@ BOOL torture_denytest2(int dummy)
                }
 
                if (torture_showall || res != denytable2[i].result) {
-                       long long tdif;
+                       int64_t tdif;
                        GetTimeOfDay(&tv);
                        tdif = usec_time_diff(&tv, &tv_start);
                        tdif /= 1000;
index 2bb68fcce83aca43bfdb9a0b478a355d6035f060..1610445d72caef886d97e451264b77a12ee367d0 100644 (file)
@@ -1790,11 +1790,11 @@ static BOOL run_deferopen(struct cli_state *cli, int dummy)
                        GetTimeOfDay(&tv_end);
                        if (NT_STATUS_EQUAL(cli_nt_error(cli->tree),NT_STATUS_SHARING_VIOLATION)) {
                                /* Sharing violation errors need to be 1 second apart. */
-                               long long tdif = usec_time_diff(&tv_end, &tv_start);
+                               int64_t tdif = usec_time_diff(&tv_end, &tv_start);
                                if (tdif < 500000 || tdif > 1500000) {
                                        fprintf(stderr,"Timing incorrect %lld.%lld for share violation\n",
-                                               tdif / (long long)1000000, 
-                                               tdif % (long long)1000000);
+                                               tdif / (int64_t)1000000, 
+                                               tdif % (int64_t)1000000);
                                }
                        }
                } while (NT_STATUS_EQUAL(cli_nt_error(cli->tree),NT_STATUS_SHARING_VIOLATION));