1 --- Reusable-Cluster-Components-glue--glue-1.0.11/lib/clplumbing/longclock.c~ 2012-10-15 13:58:55.000000000 +0000
2 +++ Reusable-Cluster-Components-glue--glue-1.0.11/lib/clplumbing/longclock.c 2015-01-04 11:29:17.659862030 +0000
4 # define TIMES_PARAM &dummy_longclock_tms_struct
9 cl_times(void) /* Make times(2) behave rationally on Linux */
13 * because of sign extension.
14 * We do expect sizeof(clock_t) <= sizeof(long), however.
16 - BUILD_BUG_ON(sizeof(clock_t) > sizeof(unsigned long));
17 -#define CLOCK_T_MAX (~0UL >> (8*(sizeof(unsigned long) - sizeof(clock_t))))
18 - return (unsigned long)ret & CLOCK_T_MAX;
19 + BUILD_BUG_ON(sizeof(clock_t) > sizeof(unsigned long long));
20 +#define CLOCK_T_MAX (~0UL >> (8*(sizeof(unsigned long long) - sizeof(clock_t))))
21 + return (unsigned long long)ret & CLOCK_T_MAX;
24 #ifdef CLOCK_T_IS_LONG_ENOUGH
26 * because then this can recurse infinitely; that is why the
27 * cl_log call is where it is; found by Simon Graham. */
28 static gboolean calledbefore = FALSE;
29 - static unsigned long lasttimes = 0L;
30 - static unsigned long callcount = 0L;
31 + static unsigned long long lasttimes = 0L;
32 + static unsigned long long callcount = 0L;
33 static longclock_t lc_wrapcount = 0L;
34 - unsigned long timesval;
35 + unsigned long long timesval;
39 timesval = cl_times();
41 if (calledbefore && timesval < lasttimes) {
42 - unsigned long jumpbackby = lasttimes - timesval;
43 + unsigned long long jumpbackby = lasttimes - timesval;
45 if (jumpbackby < MINJUMP) {
46 /* Kernel weirdness */
48 , "%s: old value was %lu"
49 ", new value is %lu, diff is %lu, callcount %lu"
51 - , (unsigned long)lasttimes
52 - , (unsigned long)timesval
53 - , (unsigned long)jumpbackby
54 + , (unsigned long long)lasttimes
55 + , (unsigned long long)timesval
56 + , (unsigned long long)jumpbackby
58 /* Assume jump back was the error and ignore it */
59 /* (i.e., hope it goes away) */
61 #endif /* ! CLOCK_T_IS_LONG_ENOUGH */
64 -msto_longclock(unsigned long ms)
65 +msto_longclock(unsigned long long ms)
67 - unsigned long secs = ms / 1000UL;
68 - unsigned long msec = ms % 1000;
69 + unsigned long long secs = ms / 1000UL;
70 + unsigned long long msec = ms % 1000;
73 (void)(Hz == 0 && hz_longclock());
78 -secsto_longclock(unsigned long Secs)
79 +secsto_longclock(unsigned long long Secs)
81 longclock_t secs = Secs;
89 longclockto_ms(longclock_t t)
91 (void)(Hz == 0 && hz_longclock());
96 - return (unsigned long) ((t*1000UL)/Lc_Hz);
97 + return (unsigned long long) ((t*1000UL)/Lc_Hz);
99 #ifndef CLOCK_T_IS_LONG_ENOUGH
102 longclockto_long(longclock_t t)
104 - return ((long)(t));
105 + return ((long long)(t));
109 --- Reusable-Cluster-Components-glue--glue-1.0.11/include/clplumbing/longclock.h~ 2012-10-15 13:58:55.000000000 +0000
110 +++ Reusable-Cluster-Components-glue--glue-1.0.11/include/clplumbing/longclock.h 2015-01-04 11:31:06.843191511 +0000
113 * extern const longclock_t zero_longclock;
115 -extern unsigned long cl_times(void);
116 +extern unsigned long long cl_times(void);
118 #ifdef CLOCK_T_IS_LONG_ENOUGH
119 # ifndef HAVE_LONGCLOCK_ARITHMETIC
121 extern const longclock_t zero_longclock;
123 unsigned hz_longclock(void);
124 -longclock_t secsto_longclock(unsigned long);
125 +longclock_t secsto_longclock(unsigned long long);
126 longclock_t dsecsto_longclock(double);
127 -longclock_t msto_longclock(unsigned long);
128 -unsigned long longclockto_ms(longclock_t); /* Can overflow! */
129 -long longclockto_long(longclock_t); /* May overflow! */
130 +longclock_t msto_longclock(unsigned long long);
131 +unsigned long long longclockto_ms(longclock_t); /* Can overflow! */
132 +long long longclockto_long(longclock_t); /* May overflow! */
135 #ifndef HAVE_LONGCLOCK_ARITHMETIC
138 #else /* We HAVE_LONGCLOCK_ARITHMETIC */
140 -# define longclockto_long(lc) ((long)(lc))
141 +# define longclockto_long(lc) ((long long)(lc))
143 # define add_longclock(l,r) \
144 ((longclock_t)(l) + (longclock_t)(r))
147 /* N.B: Possibly not the best place for this, but it will do for now */
148 /* This is consistent with OpenBSD, and is a good choice anyway */
149 -#define TIME_T unsigned long
150 -#define TIME_F "%lu"
151 -#define TIME_X "%lx"
152 +#define TIME_T unsigned long long
153 +#define TIME_F "%llu"
154 +#define TIME_X "%llx"
157 --- Reusable-Cluster-Components-glue--glue-1.0.11/include/clplumbing/cl_log.h~ 2012-10-15 13:58:55.000000000 +0000
158 +++ Reusable-Cluster-Components-glue--glue-1.0.11/include/clplumbing/cl_log.h 2015-01-04 11:32:27.326522006 +0000
163 -#define TIME_T unsigned long
164 +#define TIME_T unsigned long long
167 #define MAXLINE (512*10)