summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/sandglass-impl.h (renamed from src/sandglass_impl.h)0
-rw-r--r--src/sandglass.c5
-rw-r--r--src/timespec.c10
-rw-r--r--src/tsc.c2
5 files changed, 10 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b228b83..12ebf1a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,7 @@ lib_LTLIBRARIES = libsandglass.la
nobase_include_HEADERS = sandglass.h
libsandglass_la_SOURCES = sandglass.h \
- sandglass_impl.h \
+ sandglass-impl.h \
sandglass.c \
timespec.c
diff --git a/src/sandglass_impl.h b/src/sandglass-impl.h
index e10562f..e10562f 100644
--- a/src/sandglass_impl.h
+++ b/src/sandglass-impl.h
diff --git a/src/sandglass.c b/src/sandglass.c
index 0710788..a056980 100644
--- a/src/sandglass.c
+++ b/src/sandglass.c
@@ -18,7 +18,7 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
-#include "sandglass_impl.h"
+#include "sandglass-impl.h"
#include "sandglass.h"
#include <unistd.h>
#include <time.h>
@@ -164,7 +164,8 @@ sandglass_real_gettime(sandglass_t *sandglass)
break;
case SANDGLASS_SYSTEM:
- if ((clock_ticks = clock()) == -1)
+ clock_ticks = clock();
+ if (clock_ticks == -1)
return -1;
sandglass->grains = clock_ticks;
break;
diff --git a/src/timespec.c b/src/timespec.c
index c077f8b..1353076 100644
--- a/src/timespec.c
+++ b/src/timespec.c
@@ -18,7 +18,7 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
-#include "sandglass_impl.h"
+#include "sandglass-impl.h"
#include "sandglass.h"
#include <time.h>
#include <unistd.h>
@@ -75,18 +75,18 @@ sandglass_timespec_sub(struct timespec *ts, const struct timespec *d)
int
sandglass_timespec_cmp(const struct timespec *a, const struct timespec *b)
{
- if (a->tv_sec > b->tv_sec)
+ if (a->tv_sec > b->tv_sec) {
return 1;
- else if (a->tv_sec == b->tv_sec) {
+ } else if (a->tv_sec == b->tv_sec) {
if (a->tv_nsec > b->tv_nsec)
return 1;
else if (a->tv_nsec == b->tv_nsec)
return 0;
else
return -1;
- }
- else
+ } else {
return -1;
+ }
}
/* Spins for the time interval specified by ts */
diff --git a/src/tsc.c b/src/tsc.c
index 713008c..ae31701 100644
--- a/src/tsc.c
+++ b/src/tsc.c
@@ -18,7 +18,7 @@
* <http://www.gnu.org/licenses/>. *
*************************************************************************/
-#include "sandglass_impl.h"
+#include "sandglass-impl.h"
#include "sandglass.h"
#include <time.h>
#include <unistd.h>