mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:35:06 -05:00
util: remove INLINE_UTILITIES support
This commit is contained in:
16
util.c
16
util.c
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
INLINE_STATIC void
|
void
|
||||||
UTI_TimevalToDouble(struct timeval *a, double *b)
|
UTI_TimevalToDouble(struct timeval *a, double *b)
|
||||||
{
|
{
|
||||||
*b = (double)(a->tv_sec) + 1.0e-6 * (double)(a->tv_usec);
|
*b = (double)(a->tv_sec) + 1.0e-6 * (double)(a->tv_usec);
|
||||||
@@ -43,7 +43,7 @@ UTI_TimevalToDouble(struct timeval *a, double *b)
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
INLINE_STATIC void
|
void
|
||||||
UTI_DoubleToTimeval(double a, struct timeval *b)
|
UTI_DoubleToTimeval(double a, struct timeval *b)
|
||||||
{
|
{
|
||||||
long int_part;
|
long int_part;
|
||||||
@@ -58,7 +58,7 @@ UTI_DoubleToTimeval(double a, struct timeval *b)
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
INLINE_STATIC int
|
int
|
||||||
UTI_CompareTimevals(struct timeval *a, struct timeval *b)
|
UTI_CompareTimevals(struct timeval *a, struct timeval *b)
|
||||||
{
|
{
|
||||||
if (a->tv_sec < b->tv_sec) {
|
if (a->tv_sec < b->tv_sec) {
|
||||||
@@ -78,7 +78,7 @@ UTI_CompareTimevals(struct timeval *a, struct timeval *b)
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
INLINE_STATIC void
|
void
|
||||||
UTI_NormaliseTimeval(struct timeval *x)
|
UTI_NormaliseTimeval(struct timeval *x)
|
||||||
{
|
{
|
||||||
/* Reduce tv_usec to within +-1000000 of zero. JGH */
|
/* Reduce tv_usec to within +-1000000 of zero. JGH */
|
||||||
@@ -97,7 +97,7 @@ UTI_NormaliseTimeval(struct timeval *x)
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
INLINE_STATIC void
|
void
|
||||||
UTI_DiffTimevals(struct timeval *result,
|
UTI_DiffTimevals(struct timeval *result,
|
||||||
struct timeval *a,
|
struct timeval *a,
|
||||||
struct timeval *b)
|
struct timeval *b)
|
||||||
@@ -114,7 +114,7 @@ UTI_DiffTimevals(struct timeval *result,
|
|||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
/* Calculate result = a - b and return as a double */
|
/* Calculate result = a - b and return as a double */
|
||||||
INLINE_STATIC void
|
void
|
||||||
UTI_DiffTimevalsToDouble(double *result,
|
UTI_DiffTimevalsToDouble(double *result,
|
||||||
struct timeval *a,
|
struct timeval *a,
|
||||||
struct timeval *b)
|
struct timeval *b)
|
||||||
@@ -125,7 +125,7 @@ UTI_DiffTimevalsToDouble(double *result,
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
INLINE_STATIC void
|
void
|
||||||
UTI_AddDoubleToTimeval(struct timeval *start,
|
UTI_AddDoubleToTimeval(struct timeval *start,
|
||||||
double increment,
|
double increment,
|
||||||
struct timeval *end)
|
struct timeval *end)
|
||||||
@@ -149,7 +149,7 @@ UTI_AddDoubleToTimeval(struct timeval *start,
|
|||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
/* Calculate the average and difference (as a double) of two timevals */
|
/* Calculate the average and difference (as a double) of two timevals */
|
||||||
INLINE_STATIC void
|
void
|
||||||
UTI_AverageDiffTimevals (struct timeval *earlier,
|
UTI_AverageDiffTimevals (struct timeval *earlier,
|
||||||
struct timeval *later,
|
struct timeval *later,
|
||||||
struct timeval *average,
|
struct timeval *average,
|
||||||
|
|||||||
7
util.h
7
util.h
@@ -127,11 +127,4 @@ extern int UTI_CheckNTPAuth(int hash_id, const unsigned char *key, int key_len,
|
|||||||
/* Decode password encoded in ASCII or HEX */
|
/* Decode password encoded in ASCII or HEX */
|
||||||
extern int UTI_DecodePasswordFromText(char *key);
|
extern int UTI_DecodePasswordFromText(char *key);
|
||||||
|
|
||||||
#if defined (INLINE_UTILITIES)
|
|
||||||
#define INLINE_STATIC inline static
|
|
||||||
#include "util.c"
|
|
||||||
#else
|
|
||||||
#define INLINE_STATIC
|
|
||||||
#endif /* defined (INLINE_UTILITIES) */
|
|
||||||
|
|
||||||
#endif /* GOT_UTIL_H */
|
#endif /* GOT_UTIL_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user