Mesa (master): util: Add a func_to_pointer util function too.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Jun 14 09:12:14 PDT 2010


Module: Mesa
Branch: master
Commit: 91bbe466c7a149d1f9d1cc9bd27f8aedb45b9d2e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=91bbe466c7a149d1f9d1cc9bd27f8aedb45b9d2e

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Jun 10 16:22:49 2010 +0100

util: Add a func_to_pointer util function too.

---

 src/gallium/auxiliary/util/u_pointer.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_pointer.h b/src/gallium/auxiliary/util/u_pointer.h
index ae6f43b..cce0c74 100644
--- a/src/gallium/auxiliary/util/u_pointer.h
+++ b/src/gallium/auxiliary/util/u_pointer.h
@@ -111,6 +111,17 @@ pointer_to_func( void *p )
    return pf.f;
 }
 
+static INLINE void *
+func_to_pointer( func_pointer f )
+{
+   union {
+      void *p;
+      func_pointer f;
+   } pf;
+   pf.f = f;
+   return pf.p;
+}
+
 
 #ifdef __cplusplus
 }



More information about the mesa-commit mailing list