simplify gl type name creation
authorAndy Wingo <wingo@pobox.com>
Fri, 1 Feb 2013 21:23:16 +0000 (22:23 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 1 Feb 2013 21:23:16 +0000 (22:23 +0100)
* figl/parse.scm (string->gl-type): Simplify.

* figl/glx/types.scm (const-GLXContext): Missing decl.

* figl/glx/low-level.scm: Regenerate.

figl/glx/low-level.scm
figl/glx/types.scm
figl/parse.scm

index bbf3402..8e94af7 100644 (file)
@@ -1261,7 +1261,7 @@ other than `GLX_USE_GL' is requested.")
 
 (define-foreign-procedure
   ((glXGetContextIDEXT
-     (ctx GLXContext)
+     (ctx const-GLXContext)
      ->
      GLXContextID))
   "Get the XID for a context..
index 705a9b8..37f972e 100644 (file)
@@ -28,6 +28,7 @@
             Display-*
             Font
             GLXContext
+            const-GLXContext
             GLXContextID
             GLXDrawable
             GLXFBConfig
@@ -55,6 +56,7 @@
 (define Display-* '*)
 (define Font unsigned-long)
 (define GLXContext '*)
+(define const-GLXContext '*)
 (define GLXContextID '*)
 (define GLXDrawable unsigned-long)
 (define GLXFBConfig '*)
index 0b47505..05104e4 100644 (file)
   (take-first (sxpath '(refentry (refsect1 (@ id (equal? "Copyright")))))))
 
 (define (string->gl-type str)
-  (let ((str (string-trim-both str)))
-    (cond
-     ((string-index str #\*)
-      (string->symbol
-       (string-join (string-split str #\space) "-")))
-     ((string-prefix? "const " str)
-      (string->gl-type (string-drop str (string-length "const "))))
-     (else
-      (string->symbol
-       (string-join (string-split str #\space) "-"))))))
+  (string->symbol
+   (string-join (string-split (string-trim-both str) #\space) "-")))
 
 (define (parse-prototypes sxml)
   (define all-names