From a5116095010d6f57d71f85e5ede9d534a5099179 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 22 Feb 2000 23:59:25 +0000 Subject: [PATCH] sort the offsets by number --- src/mesa/glapi/gloffsets.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/mesa/glapi/gloffsets.py b/src/mesa/glapi/gloffsets.py index 061d71b7e00..5cdc07b643d 100644 --- a/src/mesa/glapi/gloffsets.py +++ b/src/mesa/glapi/gloffsets.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# $Id: gloffsets.py,v 1.1 2000/02/22 22:45:20 brianp Exp $ +# $Id: gloffsets.py,v 1.2 2000/02/22 23:59:25 brianp Exp $ # Mesa 3-D graphics library # Version: 3.3 @@ -56,7 +56,7 @@ def PrintTail(): def GenerateDefine(name, offset): - s = '#define _gloffset_' + name + ' ' + offset + s = '#define _gloffset_' + name + ' ' + str(offset) return s; #enddef @@ -67,6 +67,9 @@ def PrintDefines(): funcName = '' + maxOffset = 0 + offsetInfo = { } + f = open('gl.spec') for line in f.readlines(): @@ -81,11 +84,18 @@ def PrintDefines(): if m[0] == 'param': paramName = m[1] if m[0] == 'offset': - funcOffset = m[1] + funcOffset = int(m[1]) + if funcOffset > maxOffset: + maxOffset = funcOffset s = GenerateDefine(funcName, funcOffset) - print s + offsetInfo[funcOffset] = s; #endif #endfor + + # Now print the #defines in order of dispatch offset + for i in range(0, maxOffset + 1): + print offsetInfo[i] + #enddef -- 2.30.2