From d3c131db7b22e916d0b5aaa097ca8750a4063e93 Mon Sep 17 00:00:00 2001 From: amy Date: Wed, 3 May 2023 12:42:12 +0000 Subject: cleaning stuff --- src/util.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index aadf4fe..2a78785 100644 --- a/src/util.h +++ b/src/util.h @@ -1,15 +1,24 @@ #include #include #include +#include "string.h" #ifndef __util__ #define __util__ -#include "string.h" +static const double FL_DIS = 1e-10; +static const double NaN = 0.0f/0.0f; + #define greater(a,b) ((a)>(b)?(a):(b)) #define lesser(a,b) ((a)>(b)?(b):(a)) #define diff(a,b) ((a)>(b)?(a)-(b):(b)-(a)) #define malloc(X) malloc(X); mmalloc(); -void mmalloc(); #define free(X) free(X); ffree(); +#define err(s,f,...) err_m(s,f,__FILE__,__LINE__,##__VA_ARGS__); +#define warn(s) warn_m(s,__FILE__,__LINE__); +#define info(s) info_m(s,__FILE__,__LINE__); +#define logm(s) log_m(s,__FILE__,__LINE__); + +double binomial(int n, int k); +void mmalloc(); void ffree(); void err_m(char*,void (*)(int),char*,int); void warn_m(char*,char*,int ,...); @@ -21,9 +30,4 @@ unsigned int_len(const unsigned n); char* force_ca_length(char*inp,int len); void pexit(int s); -#define err(s,f,...) err_m(s,f,__FILE__,__LINE__,##__VA_ARGS__); -#define warn(s) warn_m(s,__FILE__,__LINE__); -#define info(s) info_m(s,__FILE__,__LINE__); -#define logm(s) log_m(s,__FILE__,__LINE__); - #endif -- cgit v1.2.3