]> git.tdb.fi Git - gldbg.git/blobdiff - source/glprint.c
Fix things for 64-bit systems
[gldbg.git] / source / glprint.c
index 33d083d0d59a1e7c91aef8c6c02cae1ce7d73f7c..21f7fe5c65e962bf16ffad4ecfee42de3d149653 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of gldbg
-Copyright © 2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the GPL
-*/
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -107,9 +100,14 @@ static const char *print_array(const char *fmt, const void *data, unsigned elem_
                        *ptr++ = ' ';
                }
                memcpy(&element, (const char *)data+i*elem_size, elem_size);
-               if(type>='e' && type<='g' && elem_size==sizeof(float))
-                       *(double *)&element = *(float *)&element;
-               len = snprintf(ptr, buf_size, fmt, element);
+               if(type>='e' && type<='g')
+               {
+                       if(elem_size==sizeof(float))
+                               *(double *)&element = *(float *)&element;
+                       len = snprintf(ptr, buf_size, fmt, *(double *)&element);
+               }
+               else
+                       len = snprintf(ptr, buf_size, fmt, element);
                ptr += len;
                buf_size -= len;
        }