diff options
| author | Simon <simon@hardwired.org.uk> | 2010-08-27 12:01:20 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2010-08-27 12:01:20 (GMT) |
| commit | 07ade7ed72face5ece3408e953198b5ebcf1170c (patch) | |
| tree | f735724507f4aed5574bda71900c27d3f53437f6 /misc.c | |
| parent | 0d25cae647b2d0827c366165257c5e812a8d8ddb (diff) | |
| download | powder-07ade7ed72face5ece3408e953198b5ebcf1170c.zip powder-07ade7ed72face5ece3408e953198b5ebcf1170c.tar.gz | |
More work
Diffstat (limited to 'misc.c')
| -rw-r--r-- | misc.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -1,10 +1,12 @@ +#include <stdlib.h> +#include <string.h> #include "misc.h" //Signum function #ifdef WIN32 -_inline int sign(float i) +_inline int isign(float i) #else -inline int sign(float i) +inline int isign(float i) #endif { if (i<0) @@ -38,4 +40,16 @@ inline float restrict_flt(float f, float min, float max) if(f>max) return max; return f; +} + +char *mystrdup(char *s) +{ + char *x; + if(s) + { + x = malloc(strlen(s)+1); + strcpy(x, s); + return x; + } + return s; }
\ No newline at end of file |
