summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-08-27 12:01:20 (GMT)
committer Simon <simon@hardwired.org.uk>2010-08-27 12:01:20 (GMT)
commit07ade7ed72face5ece3408e953198b5ebcf1170c (patch)
treef735724507f4aed5574bda71900c27d3f53437f6 /misc.c
parent0d25cae647b2d0827c366165257c5e812a8d8ddb (diff)
downloadpowder-07ade7ed72face5ece3408e953198b5ebcf1170c.zip
powder-07ade7ed72face5ece3408e953198b5ebcf1170c.tar.gz
More work
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index fe50b32..ade3c3c 100644
--- a/misc.c
+++ b/misc.c
@@ -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