summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-10-10 15:10:00 -0700
committerPaul Berry <[email protected]>2012-10-16 12:03:56 -0700
commit4f6fc905c68fc1f7deab27d0b931f58e0558630e (patch)
tree0f4007993587c2cc2c1a0ae51c74c3fbafe720c9
parent77ed171f27de5c4f50720263b419e26d6715e621 (diff)
mapi_abi: Get rid of unnecessary copy.
Previously, _get_api_entries() would make a deep copy of each element in the entries table before modifying the 'hidden' and 'handcode' attributes. This was unnecessary, since the entries aren't used again after this function. Removing the copy simplifies the code, because it is no longer necessary to adjust the alias pointers to point to the copied entries. Tested-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r--src/mapi/mapi/mapi_abi.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/mapi/mapi/mapi_abi.py b/src/mapi/mapi/mapi_abi.py
index ce4e0473ea1..c2d9085ca82 100644
--- a/src/mapi/mapi/mapi_abi.py
+++ b/src/mapi/mapi/mapi_abi.py
@@ -36,7 +36,6 @@ import re
from optparse import OptionParser
import gl_XML
import glX_XML
-import copy
from gles_api import es1_api, es2_api
@@ -690,8 +689,8 @@ class GLAPIPrinter(ABIPrinter):
"""OpenGL API Printer"""
def __init__(self, entries, api=None):
- api_entries = self._get_api_entries(entries, api)
- super(GLAPIPrinter, self).__init__(api_entries)
+ self._override_for_api(entries, api)
+ super(GLAPIPrinter, self).__init__(entries)
self.api_defines = ['GL_GLEXT_PROTOTYPES']
self.api_headers = ['"GL/gl.h"', '"GL/glext.h"']
@@ -712,28 +711,16 @@ class GLAPIPrinter(ABIPrinter):
self.c_header = self._get_c_header()
- def _get_api_entries(self, entries, api):
+ def _override_for_api(self, entries, api):
"""Override the entry attributes according to API."""
# no override
if api is None:
return entries
- api_entries = {}
for ent in entries:
- ent = copy.copy(ent)
-
# override 'hidden' and 'handcode'
ent.hidden = ent.name not in api
ent.handcode = False
- if ent.alias:
- ent.alias = api_entries[ent.alias.name]
-
- api_entries[ent.name] = ent
-
- entries = api_entries.values()
- entries.sort()
-
- return entries
def _get_c_header(self):
header = """#ifndef _GLAPI_TMP_H_