about summary refs log tree commit homepage
path: root/ext/unicorn_http/c_util.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-02-18 18:53:03 -0800
committerEric Wong <normalperson@yhbt.net>2010-02-18 19:30:51 -0800
commitace625cfb1aa1b3c2f06890fb1f97900059bf226 (patch)
tree7102ee0510ef6a931e0122c4cbf35c6f2077a64a /ext/unicorn_http/c_util.h
parent4ee6275918cf15c1c380e0adc46e2516433d76fa (diff)
downloadunicorn-ace625cfb1aa1b3c2f06890fb1f97900059bf226.tar.gz
Not fun, but maybe this can help us spot _real_ problems
more easily in the future.
Diffstat (limited to 'ext/unicorn_http/c_util.h')
-rw-r--r--ext/unicorn_http/c_util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/unicorn_http/c_util.h b/ext/unicorn_http/c_util.h
index 9e674fa..8542b3d 100644
--- a/ext/unicorn_http/c_util.h
+++ b/ext/unicorn_http/c_util.h
@@ -30,6 +30,19 @@
 #endif /* SIZEOF_OFF_T check */
 
 /*
+ * ragel enforces fpc as a const, and merely casting can make picky
+ * compilers unhappy, so we have this little helper do our dirty work
+ */
+static inline void *deconst(const void *in)
+{
+  union { const void *in; void *out; } tmp;
+
+  tmp.in = in;
+
+  return tmp.out;
+}
+
+/*
  * capitalizes all lower-case ASCII characters and converts dashes
  * to underscores for HTTP headers.  Locale-agnostic.
  */