chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tree-wide: adjust fall through comments so that gcc is happy
[elogind.git]
/
src
/
basic
/
time-util.c
diff --git
a/src/basic/time-util.c
b/src/basic/time-util.c
index 2455636843f8e80b13c0fa8f73ff42aa17fe581d..ecb621ec44f4de7b1f4018abea83e806ccaf7470 100644
(file)
--- a/
src/basic/time-util.c
+++ b/
src/basic/time-util.c
@@
-315,7
+315,7
@@
static char *format_timestamp_internal(
if (n + 8 > l)
return NULL; /* Microseconds part doesn't fit. */
if (n + 8 > l)
return NULL; /* Microseconds part doesn't fit. */
- sprintf(buf + n, ".%06
llu", (unsigned long long) (t % USEC_PER_SEC)
);
+ sprintf(buf + n, ".%06
"PRI_USEC, t % USEC_PER_SEC
);
}
/* Append the timezone */
}
/* Append the timezone */
@@
-509,11
+509,11
@@
char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
if (j > 0) {
k = snprintf(p, l,
if (j > 0) {
k = snprintf(p, l,
- "%s"USEC_FMT".%0*
llu
%s",
+ "%s"USEC_FMT".%0*
"PRI_USEC"
%s",
p > buf ? " " : "",
a,
j,
p > buf ? " " : "",
a,
j,
-
(unsigned long long)
b,
+ b,
table[i].suffix);
t = 0;
table[i].suffix);
t = 0;
@@
-897,6
+897,7
@@
static char* extract_multiplier(char *p, usec_t *multiplier) {
{ "y", USEC_PER_YEAR },
{ "usec", 1ULL },
{ "us", 1ULL },
{ "y", USEC_PER_YEAR },
{ "usec", 1ULL },
{ "us", 1ULL },
+ { "µs", 1ULL },
};
unsigned i;
};
unsigned i;
@@
-1031,6
+1032,7
@@
int parse_nsec(const char *t, nsec_t *nsec) {
{ "y", NSEC_PER_YEAR },
{ "usec", NSEC_PER_USEC },
{ "us", NSEC_PER_USEC },
{ "y", NSEC_PER_YEAR },
{ "usec", NSEC_PER_USEC },
{ "us", NSEC_PER_USEC },
+ { "µs", NSEC_PER_USEC },
{ "nsec", 1ULL },
{ "ns", 1ULL },
{ "", 1ULL }, /* default is nsec */
{ "nsec", 1ULL },
{ "ns", 1ULL },
{ "", 1ULL }, /* default is nsec */
@@
-1287,7
+1289,7
@@
bool clock_supported(clockid_t clock) {
if (!clock_boottime_supported())
return false;
if (!clock_boottime_supported())
return false;
- /* fall through
, after checking the cached value for CLOCK_BOOTTIME.
*/
+ /* fall through */
default:
/* For everything else, check properly */
default:
/* For everything else, check properly */
@@
-1341,7
+1343,7
@@
unsigned long usec_to_jiffies(usec_t u) {
r = sysconf(_SC_CLK_TCK);
assert(r > 0);
r = sysconf(_SC_CLK_TCK);
assert(r > 0);
- hz =
(unsigned long)
r;
+ hz = r;
}
return DIV_ROUND_UP(u , USEC_PER_SEC / hz);
}
return DIV_ROUND_UP(u , USEC_PER_SEC / hz);