aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/swrastwgl_dri/gen_gl_wrappers.py
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/swrastwgl_dri/gen_gl_wrappers.py')
-rwxr-xr-x[-rw-r--r--]xorg-server/hw/xwin/swrastwgl_dri/gen_gl_wrappers.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/xorg-server/hw/xwin/swrastwgl_dri/gen_gl_wrappers.py b/xorg-server/hw/xwin/swrastwgl_dri/gen_gl_wrappers.py
index cc66eb096..a9cffef78 100644..100755
--- a/xorg-server/hw/xwin/swrastwgl_dri/gen_gl_wrappers.py
+++ b/xorg-server/hw/xwin/swrastwgl_dri/gen_gl_wrappers.py
@@ -100,6 +100,8 @@ for line in tm :
continue
l = line.split(',')
+ if len(l)<4:
+ continue
typemap[l[0]] = l[3].strip()
# interestingly, * is not a C type
@@ -146,9 +148,8 @@ for line in glspec :
arglist_use = m1.group(2)
wrappers[function] = {}
- # near and far might be reserved words or macros so can't be used as formal parameter names
- arglist_use = arglist_use.replace('near','zNear')
- arglist_use = arglist_use.replace('far','zFar')
+ # ensure formal parameter names don't collide with reserved names or shadow global declarations
+ arglist_use = ',' .join([i.rstrip() + '_' for i in arglist_use.split(",")])
wrappers[function]['arglist_use'] = arglist_use
param_count = 0
@@ -217,9 +218,8 @@ for w in sorted(wrappers.keys()) :
if k.startswith('param') :
l = wrappers[w][k].split()
- # near and far might be reserved words or macros so can't be used as formal parameter names
- l[0] = l[0].replace('near','zNear')
- l[0] = l[0].replace('far','zFar')
+ # ensure formal parameter names don't collide with reserved names or shadow global declarations
+ l[0] = l[0] + '_'
if l[2] == 'in' :
if l[3] == 'array' :