glapi: Remove support for "short string" mode
C89 has a fairly short minimum-maximum string length. To support compilers limited by the C89 limits, this script had a mode where it would generate a character array instead of a giant string. These were functionally the same, but the code generated for the character array is HUGE and difficult to read. As far as I can tell, nothing in Mesa uses '-m short' any more. The generated files used to be tracked in revision control, but I think we stopped using '-m short' when we stopped tracking the generated files. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Tested-by: Brian Paul <brianp@vmware.com> Tested-by: Lu Hua <huax.lu@intel.com> Cc: Vinson Lee <vlee@freedesktop.org>
This commit is contained in:
@@ -30,11 +30,10 @@ import gl_XML, glX_XML
|
||||
import sys, getopt
|
||||
|
||||
class PrintGlProcs(gl_XML.gl_print_base):
|
||||
def __init__(self, long_strings, es=False):
|
||||
def __init__(self, es=False):
|
||||
gl_XML.gl_print_base.__init__(self)
|
||||
|
||||
self.es = es
|
||||
self.long_strings = long_strings
|
||||
self.name = "gl_procs.py (from Mesa)"
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
@@ -74,22 +73,11 @@ typedef struct {
|
||||
return
|
||||
|
||||
def printFunctionString(self, name):
|
||||
if self.long_strings:
|
||||
print ' "gl%s\\0"' % (name)
|
||||
else:
|
||||
print " 'g','l',",
|
||||
for c in name:
|
||||
print "'%s'," % (c),
|
||||
|
||||
print "'\\0',"
|
||||
|
||||
print ' "gl%s\\0"' % (name)
|
||||
|
||||
def printBody(self, api):
|
||||
print ''
|
||||
if self.long_strings:
|
||||
print 'static const char gl_string_table[] ='
|
||||
else:
|
||||
print 'static const char gl_string_table[] = {'
|
||||
print 'static const char gl_string_table[] ='
|
||||
|
||||
base_offset = 0
|
||||
table = []
|
||||
@@ -119,11 +107,7 @@ typedef struct {
|
||||
base_offset += len(n) + 3
|
||||
|
||||
|
||||
if self.long_strings:
|
||||
print ' ;'
|
||||
else:
|
||||
print '};'
|
||||
|
||||
print ' ;'
|
||||
print ''
|
||||
print ''
|
||||
print "#ifdef USE_MGL_NAMESPACE"
|
||||
@@ -178,38 +162,25 @@ typedef struct {
|
||||
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0]
|
||||
print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0]
|
||||
print "-c Enable compatibility with OpenGL ES."
|
||||
print "-m mode mode can be one of:"
|
||||
print " long - Create code for compilers that can handle very"
|
||||
print " long string constants. (default)"
|
||||
print " short - Create code for compilers that can only handle"
|
||||
print " ANSI C89 string constants."
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:c")
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:c")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
long_string = 1
|
||||
es = False
|
||||
for (arg,val) in args:
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
elif arg == "-m":
|
||||
if val == "short":
|
||||
long_string = 0
|
||||
elif val == "long":
|
||||
long_string = 1
|
||||
else:
|
||||
show_usage()
|
||||
elif arg == "-c":
|
||||
es = True
|
||||
|
||||
api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
|
||||
printer = PrintGlProcs(long_string, es)
|
||||
printer = PrintGlProcs(es)
|
||||
printer.Print(api)
|
||||
|
||||
Reference in New Issue
Block a user