diff options
author | amy <[email protected]> | 2023-05-03 12:42:12 +0000 |
---|---|---|
committer | amy <[email protected]> | 2023-05-03 12:42:12 +0000 |
commit | d3c131db7b22e916d0b5aaa097ca8750a4063e93 (patch) | |
tree | 34e03468f6140f5aaf2dd8cf650f3d815e42fade /src/util.h | |
parent | 5beb66fd85d7a4ccaa8ce7c22662afe1932cb8d7 (diff) |
cleaning stuff
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -1,15 +1,24 @@ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> +#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 |