VirtualBox

Changeset 63939 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Sep 22, 2016 7:58:05 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110825
Message:

Build/scripts (bugref:6627): Python build scripts updated to generate the same code when used with Python 2 and 3.

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/DD_glc.py

    r62521 r63939  
    1 print """
     1from __future__ import print_function
     2print("""
    23/** @file
    34 * VBox OpenGL chromium functions header
     
    1516 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1617 */
    17 """
     18""")
    1819# Copyright (c) 2001, Stanford University
    1920# All rights reserved.
     
    2728apiutil.CopyrightC()
    2829
    29 print """
     30print("""
    3031/* DO NOT EDIT - THIS FILE GENERATED BY THE DD_gl.py SCRIPT */
    3132
     
    3637#include "dri_drv.h"
    3738#include "cr_gl.h"
    38 """
     39""")
    3940
    4041commoncall_special = [
     
    122123
    123124    if func_name in commoncall_special:
    124         print "%s vboxDD_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) )
     125        print("%s vboxDD_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) ))
    125126    else:
    126127        if apiutil.MakeDeclarationString(params)=="void":
    127             print "%s vboxDD_gl%s( GLcontext *ctx )" % (return_type, func_name )
     128            print("%s vboxDD_gl%s( GLcontext *ctx )" % (return_type, func_name ))
    128129        else:
    129             print "%s vboxDD_gl%s( GLcontext *ctx, %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) )
    130     print "{"
     130            print("%s vboxDD_gl%s( GLcontext *ctx, %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) ))
     131    print("{")
    131132
    132133    if return_type != "void":
    133         print "\treturn ",
     134        print("\treturn ", end=' ')
    134135
    135     print "\tcr_gl%s( %s );" % (func_name, apiutil.MakeCallString(params))
    136     print "}"
    137     print ""
     136    print("\tcr_gl%s( %s );" % (func_name, apiutil.MakeCallString(params)))
     137    print("}")
     138    print("")
    138139
  • trunk/src/VBox/Additions/common/crOpenGL/DD_glh.py

    r62521 r63939  
    1 print """
     1from __future__ import print_function
     2print("""
    23/** @file
    34 * VBox OpenGL chromium functions header
     
    1516 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1617 */
    17 """
     18""")
    1819# Copyright (c) 2001, Stanford University
    1920# All rights reserved.
     
    2728apiutil.CopyrightC()
    2829
    29 print """
     30print("""
    3031/* DO NOT EDIT - THIS FILE GENERATED BY THE DD_gl.py SCRIPT */
    3132#ifndef __DD_GL_H__
     
    3738#include "stub.h"
    3839
    39 """
     40""")
    4041
    4142commoncall_special = [
     
    124125
    125126    if func_name in commoncall_special:
    126         print "extern %s vboxDD_gl%s( %s );" % (return_type, func_name,
    127                                                 apiutil.MakeDeclarationString( params ))
     127        print("extern %s vboxDD_gl%s( %s );" % (return_type, func_name,
     128                                                apiutil.MakeDeclarationString( params )))
    128129    else:
    129130        if apiutil.MakeDeclarationString(params)=="void":
    130             print "extern %s vboxDD_gl%s( GLcontext *ctx );" % (return_type, func_name)
     131            print("extern %s vboxDD_gl%s( GLcontext *ctx );" % (return_type, func_name))
    131132        else:
    132             print "extern %s vboxDD_gl%s( GLcontext *ctx, %s );" % (return_type, func_name,
    133                                                                     apiutil.MakeDeclarationString( params ))
     133            print("extern %s vboxDD_gl%s( GLcontext *ctx, %s );" % (return_type, func_name,
     134                                                                    apiutil.MakeDeclarationString( params )))
    134135
    135 print "#endif /* __DD_GL_H__ */"
     136print("#endif /* __DD_GL_H__ */")
  • trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_exports.py

    r30457 r63939  
    55
    66
     7from __future__ import print_function
    78import sys
    89
     
    1718    # The order is very important - it must match cr_opcodes.h
    1819    # and spu_dispatch_table.h
    19     print '%include "iprt/asmdefs.mac"'
    20     print ""
    21     print "%ifdef RT_ARCH_AMD64"
    22     print "extern glim"
    23     print "%else ; X86"
    24     print "extern glim"
    25     print "%endif"
    26     print ""
     20    print('%include "iprt/asmdefs.mac"')
     21    print("")
     22    print("%ifdef RT_ARCH_AMD64")
     23    print("extern glim")
     24    print("%else ; X86")
     25    print("extern glim")
     26    print("%endif")
     27    print("")
    2728
    2829    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    3536            continue
    3637
    37         print "BEGINPROC_EXPORTED gl%s" % func_name
    38         print "%ifdef RT_ARCH_AMD64"
    39         print "\tmov \trax, qword glim+%d" % (8*index)
    40         print "\tjmp \t[rax]"
    41         print "%else ; X86"
    42         print "\tmov \teax, dword glim+%d" % (4*index)
    43         print "\tjmp \t[eax]"
    44         print "%endif"
    45         print "ENDPROC gl%s" % func_name
    46         print ""
     38        print("BEGINPROC_EXPORTED gl%s" % func_name)
     39        print("%ifdef RT_ARCH_AMD64")
     40        print("\tmov \trax, qword glim+%d" % (8*index))
     41        print("\tjmp \t[rax]")
     42        print("%else ; X86")
     43        print("\tmov \teax, dword glim+%d" % (4*index))
     44        print("\tjmp \t[eax]")
     45        print("%endif")
     46        print("ENDPROC gl%s" % func_name)
     47        print("")
    4748
    4849
    49     print ';'
    50     print '; Aliases'
    51     print ';'
     50    print(';')
     51    print('; Aliases')
     52    print(';')
    5253
    5354    # Now loop over all the functions and take care of any aliases
     
    6667            # this dict lookup should never fail (raise an exception)!
    6768            index = keys.index(alias)
    68             print "BEGINPROC_EXPORTED gl%s" % func_name
    69             print "%ifdef RT_ARCH_AMD64"
    70             print "\tmov \trax, qword glim+%d" % (8*index)
    71             print "\tjmp \t[rax]"
    72             print "%else ; X86"
    73             print "\tmov \teax, dword glim+%d" % (4*index)
    74             print "\tjmp \t[eax]"
    75             print "%endif"
    76             print "ENDPROC gl%s" % func_name
    77             print ""
     69            print("BEGINPROC_EXPORTED gl%s" % func_name)
     70            print("%ifdef RT_ARCH_AMD64")
     71            print("\tmov \trax, qword glim+%d" % (8*index))
     72            print("\tjmp \t[rax]")
     73            print("%else ; X86")
     74            print("\tmov \teax, dword glim+%d" % (4*index))
     75            print("\tjmp \t[eax]")
     76            print("%endif")
     77            print("ENDPROC gl%s" % func_name)
     78            print("")
    7879
    7980
    80     print ';'
    81     print '; No-op stubs'
    82     print ';'
     81    print(';')
     82    print('; No-op stubs')
     83    print(';')
    8384
    8485    # Now generate no-op stub functions
    8586    for func_name in allkeys:
    8687        if "stub" in apiutil.ChromiumProps(func_name):
    87             print "BEGINPROC_EXPORTED gl%s" % func_name
    88             print "\tleave"
    89             print "\tret"
    90             print "ENDPROC gl%s" % func_name
    91             print ""
     88            print("BEGINPROC_EXPORTED gl%s" % func_name)
     89            print("\tleave")
     90            print("\tret")
     91            print("ENDPROC gl%s" % func_name)
     92            print("")
    9293
    9394
  • trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_exports_dri.py

    r30457 r63939  
    55
    66
     7from __future__ import print_function
    78import sys
    89
     
    1718    # The order is very important - it must match cr_opcodes.h
    1819    # and spu_dispatch_table.h
    19     print '%include "iprt/asmdefs.mac"'
    20     print ""
    21     print "%ifdef RT_ARCH_AMD64"
    22     print "extern glim"
    23     print "%else ; X86"
    24     print "extern glim"
    25     print "%endif"
    26     print ""
     20    print('%include "iprt/asmdefs.mac"')
     21    print("")
     22    print("%ifdef RT_ARCH_AMD64")
     23    print("extern glim")
     24    print("%else ; X86")
     25    print("extern glim")
     26    print("%endif")
     27    print("")
    2728
    2829    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    3536            continue
    3637
    37         print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    38         print "%ifdef RT_ARCH_AMD64"
    39         print "\tmov \trax, qword glim+%d" % (8*index)
    40         print "\tjmp \t[rax]"
    41         print "%else ; X86"
    42         print "\tmov \teax, dword glim+%d" % (4*index)
    43         print "\tjmp \t[eax]"
    44         print "%endif"
    45         print "ENDPROC cr_gl%s" % func_name
    46         print ""
     38        print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     39        print("%ifdef RT_ARCH_AMD64")
     40        print("\tmov \trax, qword glim+%d" % (8*index))
     41        print("\tjmp \t[rax]")
     42        print("%else ; X86")
     43        print("\tmov \teax, dword glim+%d" % (4*index))
     44        print("\tjmp \t[eax]")
     45        print("%endif")
     46        print("ENDPROC cr_gl%s" % func_name)
     47        print("")
    4748
    4849
    49     print ';'
    50     print '; Aliases'
    51     print ';'
     50    print(';')
     51    print('; Aliases')
     52    print(';')
    5253
    5354    # Now loop over all the functions and take care of any aliases
     
    6667            # this dict lookup should never fail (raise an exception)!
    6768            index = keys.index(alias)
    68             print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    69             print "%ifdef RT_ARCH_AMD64"
    70             print "\tmov \trax, qword glim+%d" % (8*index)
    71             print "\tjmp \t[rax]"
    72             print "%else ; X86"
    73             print "\tmov \teax, dword glim+%d" % (4*index)
    74             print "\tjmp \t[eax]"
    75             print "%endif"
    76             print "ENDPROC cr_gl%s" % func_name
    77             print ""
     69            print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     70            print("%ifdef RT_ARCH_AMD64")
     71            print("\tmov \trax, qword glim+%d" % (8*index))
     72            print("\tjmp \t[rax]")
     73            print("%else ; X86")
     74            print("\tmov \teax, dword glim+%d" % (4*index))
     75            print("\tjmp \t[eax]")
     76            print("%endif")
     77            print("ENDPROC cr_gl%s" % func_name)
     78            print("")
    7879
    7980
    80     print ';'
    81     print '; No-op stubs'
    82     print ';'
     81    print(';')
     82    print('; No-op stubs')
     83    print(';')
    8384
    8485    # Now generate no-op stub functions
    8586    for func_name in allkeys:
    8687        if "stub" in apiutil.ChromiumProps(func_name):
    87             print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    88             print "\tleave"
    89             print "\tret"
    90             print "ENDPROC cr_gl%s" % func_name
    91             print ""
     88            print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     89            print("\tleave")
     90            print("\tret")
     91            print("ENDPROC cr_gl%s" % func_name)
     92            print("")
    9293
    9394
  • trunk/src/VBox/Additions/common/crOpenGL/Linux_i386_glxapi_exports.py

    r62520 r63939  
    1111"""
    1212
     13from __future__ import print_function
    1314import sys
    1415
     
    8081];
    8182
    82 print '%include "iprt/asmdefs.mac"'
    83 print ""
    84 print "%ifdef RT_ARCH_AMD64"
    85 print "extern glxim"
    86 print "%else ; X86"
    87 print "extern glxim"
    88 print "%endif"
    89 print ""
     83print('%include "iprt/asmdefs.mac"')
     84print("")
     85print("%ifdef RT_ARCH_AMD64")
     86print("extern glxim")
     87print("%else ; X86")
     88print("extern glxim")
     89print("%endif")
     90print("")
    9091
    9192for index in range(len(glx_functions)):
    9293    func_name = glx_functions[index]
    9394
    94     print "BEGINPROC_EXPORTED vbox_glX%s" % func_name
    95     print "%ifdef RT_ARCH_AMD64"
    96     print "\tmov \trax, qword glxim+%d" % (8*index)
    97     print "\tjmp \t[rax]"
    98     print "%else ; X86"
    99     print "\tmov \teax, dword glxim+%d" % (4*index)
    100     print "\tjmp \t[eax]"
    101     print "%endif"
    102     print "ENDPROC vbox_glX%s" % func_name
    103     print ""
     95    print("BEGINPROC_EXPORTED vbox_glX%s" % func_name)
     96    print("%ifdef RT_ARCH_AMD64")
     97    print("\tmov \trax, qword glxim+%d" % (8*index))
     98    print("\tjmp \t[rax]")
     99    print("%else ; X86")
     100    print("\tmov \teax, dword glxim+%d" % (4*index))
     101    print("\tjmp \t[eax]")
     102    print("%endif")
     103    print("ENDPROC vbox_glX%s" % func_name)
     104    print("")
    104105
  • trunk/src/VBox/Additions/common/crOpenGL/NULLfuncs.py

    r16381 r63939  
    55
    66
     7from __future__ import print_function
    78import sys
    89
     
    1314apiutil.CopyrightC()
    1415
    15 print """
     16print("""
    1617/* DO NOT EDIT - THIS FILE GENERATED BY THE NULLfuncs.py SCRIPT */
    1718
    1819#include "cr_error.h"
    1920#include "stub.h"
    20 """
     21""")
    2122
    2223for func_name in keys:
     
    2425        params = apiutil.Parameters(func_name)
    2526
    26         print "static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    27         print "{"
    28         print "\t/* do nothing */"
    29         print "\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name
     27        print("static %s SPULOAD_APIENTRY NULL_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     28        print("{")
     29        print("\t/* do nothing */")
     30        print("\tcrWarning(\"YOU ARE CALLING A NULLED FUNCTION (%s)\");" % func_name)
    3031        for (name, type, vecSize) in params:
    31                 print "\t(void) %s;" % name
     32                print("\t(void) %s;" % name)
    3233        if return_type != "void":
    33                 print "\treturn 0;"
    34         print "}"
    35         print ""
     34                print("\treturn 0;")
     35        print("}")
     36        print("")
    3637
    3738
    38 print "DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {"
     39print("DECLEXPORT(SPUDispatchTable) stubNULLDispatch = {")
    3940for func_name in keys:
    40         print "\tNULL_%s," % (func_name)
    41 print "\tNULL,  /* copyList */"
    42 print "\tNULL,  /* copy_of */"
    43 print "\t0,     /* mark */"
    44 print "\tNULL   /* server */"
    45 print "};"
     41        print("\tNULL_%s," % (func_name))
     42print("\tNULL,  /* copyList */")
     43print("\tNULL,  /* copy_of */")
     44print("\t0,     /* mark */")
     45print("\tNULL   /* server */")
     46print("};")
    4647
    47 print ""
    48 print "/* Declare and initialize the glim dispatch table here so that we */"
    49 print "/* can initialize all entries to no-op routines. */"
    50 print "SPUDispatchTable glim = {"
     48print("")
     49print("/* Declare and initialize the glim dispatch table here so that we */")
     50print("/* can initialize all entries to no-op routines. */")
     51print("SPUDispatchTable glim = {")
    5152for func_name in keys:
    52         print "\tNULL_%s," % (func_name)
    53 print "\tNULL,  /* copyList */"
    54 print "\tNULL,  /* copy_of */"
    55 print "\t0,     /* mark */"
    56 print "\tNULL   /* server */"
    57 print "};"
     53        print("\tNULL_%s," % (func_name))
     54print("\tNULL,  /* copyList */")
     55print("\tNULL,  /* copy_of */")
     56print("\t0,     /* mark */")
     57print("\tNULL   /* server */")
     58print("};")
  • trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports.py

    r62521 r63939  
    1111"""
    1212
     13from __future__ import print_function
    1314import sys
    1415
     
    2324    # The order is very important - it must match cr_opcodes.h
    2425    # and spu_dispatch_table.h
    25     print '%include "iprt/asmdefs.mac"'
    26     print ""
    27     print "%ifdef RT_ARCH_AMD64"
    28     print "extern glim"
    29     print "%else ; X86"
    30     print "extern glim"
    31     print "%endif"
    32     print ""
     26    print('%include "iprt/asmdefs.mac"')
     27    print("")
     28    print("%ifdef RT_ARCH_AMD64")
     29    print("extern glim")
     30    print("%else ; X86")
     31    print("extern glim")
     32    print("%endif")
     33    print("")
    3334
    3435    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    4142            continue
    4243
    43         print "BEGINPROC_EXPORTED gl%s" % func_name
    44         print "%ifdef RT_ARCH_AMD64"
    45         print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
    46         print "%else ; X86"
    47         print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)
    48         print "%endif"
    49         print "ENDPROC gl%s" % func_name
    50         print ""
     44        print("BEGINPROC_EXPORTED gl%s" % func_name)
     45        print("%ifdef RT_ARCH_AMD64")
     46        print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index))
     47        print("%else ; X86")
     48        print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index))
     49        print("%endif")
     50        print("ENDPROC gl%s" % func_name)
     51        print("")
    5152
    5253
    53     print ';'
    54     print '; Aliases'
    55     print ';'
     54    print(';')
     55    print('; Aliases')
     56    print(';')
    5657
    5758    # Now loop over all the functions and take care of any aliases
     
    7071            # this dict lookup should never fail (raise an exception)!
    7172            index = keys.index(alias)
    72             print "BEGINPROC_EXPORTED gl%s" % func_name
    73             print "%ifdef RT_ARCH_AMD64"
    74             print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
    75             print "%else ; X86"
    76             print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)
    77             print "%endif"
    78             print "ENDPROC gl%s" % func_name
    79             print ""
     73            print("BEGINPROC_EXPORTED gl%s" % func_name)
     74            print("%ifdef RT_ARCH_AMD64")
     75            print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index))
     76            print("%else ; X86")
     77            print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index))
     78            print("%endif")
     79            print("ENDPROC gl%s" % func_name)
     80            print("")
    8081
    8182
    82     print ';'
    83     print '; No-op stubs'
    84     print ';'
     83    print(';')
     84    print('; No-op stubs')
     85    print(';')
    8586
    8687    # Now generate no-op stub functions
    8788    for func_name in allkeys:
    8889        if "stub" in apiutil.ChromiumProps(func_name):
    89             print "BEGINPROC_EXPORTED gl%s" % func_name
    90             print "\tleave"
    91             print "\tret"
    92             print "ENDPROC gl%s" % func_name
    93             print ""
     90            print("BEGINPROC_EXPORTED gl%s" % func_name)
     91            print("\tleave")
     92            print("\tret")
     93            print("ENDPROC gl%s" % func_name)
     94            print("")
    9495
    9596
  • trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_exports_dri.py

    r62521 r63939  
    1111"""
    1212
     13from __future__ import print_function
    1314import sys
    1415
     
    2324    # The order is very important - it must match cr_opcodes.h
    2425    # and spu_dispatch_table.h
    25     print '%include "iprt/asmdefs.mac"'
    26     print ""
    27     print "%ifdef RT_ARCH_AMD64"
    28     print "extern glim"
    29     print "%else ; X86"
    30     print "extern glim"
    31     print "%endif"
    32     print ""
     26    print('%include "iprt/asmdefs.mac"')
     27    print("")
     28    print("%ifdef RT_ARCH_AMD64")
     29    print("extern glim")
     30    print("%else ; X86")
     31    print("extern glim")
     32    print("%endif")
     33    print("")
    3334
    3435    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    4142            continue
    4243
    43         print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    44         print "%ifdef RT_ARCH_AMD64"
    45         print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
    46         print "%else ; X86"
    47         print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)
    48         print "%endif"
    49         print "ENDPROC cr_gl%s" % func_name
    50         print ""
     44        print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     45        print("%ifdef RT_ARCH_AMD64")
     46        print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index))
     47        print("%else ; X86")
     48        print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index))
     49        print("%endif")
     50        print("ENDPROC cr_gl%s" % func_name)
     51        print("")
    5152
    5253
    53     print ';'
    54     print '; Aliases'
    55     print ';'
     54    print(';')
     55    print('; Aliases')
     56    print(';')
    5657
    5758    # Now loop over all the functions and take care of any aliases
     
    7071            # this dict lookup should never fail (raise an exception)!
    7172            index = keys.index(alias)
    72             print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    73             print "%ifdef RT_ARCH_AMD64"
    74             print "\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index)
    75             print "%else ; X86"
    76             print "\tjmp \t[glim+%d wrt ..gotpc]" % (4*index)
    77             print "%endif"
    78             print "ENDPROC cr_gl%s" % func_name
    79             print ""
     73            print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     74            print("%ifdef RT_ARCH_AMD64")
     75            print("\tjmp \t[glim+%d wrt rip wrt ..gotpcrel]" % (8*index))
     76            print("%else ; X86")
     77            print("\tjmp \t[glim+%d wrt ..gotpc]" % (4*index))
     78            print("%endif")
     79            print("ENDPROC cr_gl%s" % func_name)
     80            print("")
    8081
    8182
    82     print ';'
    83     print '; No-op stubs'
    84     print ';'
     83    print(';')
     84    print('; No-op stubs')
     85    print(';')
    8586
    8687    # Now generate no-op stub functions
    8788    for func_name in allkeys:
    8889        if "stub" in apiutil.ChromiumProps(func_name):
    89             print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    90             print "\tleave"
    91             print "\tret"
    92             print "ENDPROC cr_gl%s" % func_name
    93             print ""
     90            print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     91            print("\tleave")
     92            print("\tret")
     93            print("ENDPROC cr_gl%s" % func_name)
     94            print("")
    9495
    9596
  • trunk/src/VBox/Additions/common/crOpenGL/SunOS_i386_glxapi_exports.py

    r62521 r63939  
    1111"""
    1212
     13from __future__ import print_function
    1314import sys
    1415
     
    8081];
    8182
    82 print '%include "iprt/asmdefs.mac"'
    83 print ""
    84 print "%ifdef RT_ARCH_AMD64"
    85 print "extern glxim"
    86 print "%else ; X86"
    87 print "extern glxim"
    88 print "%endif"
    89 print ""
     83print('%include "iprt/asmdefs.mac"')
     84print("")
     85print("%ifdef RT_ARCH_AMD64")
     86print("extern glxim")
     87print("%else ; X86")
     88print("extern glxim")
     89print("%endif")
     90print("")
    9091
    9192for index in range(len(glx_functions)):
    9293    func_name = glx_functions[index]
    9394
    94     print "BEGINPROC_EXPORTED vbox_glX%s" % func_name
    95     print "%ifdef RT_ARCH_AMD64"
    96     print "\tjmp \t[glxim+%d wrt rip wrt ..gotpcrel]" % (8*index)
    97     print "%else ; X86"
    98     print "\tjmp \t[glxim+%d wrt ..gotpc]" % (4*index)
    99     print "%endif"
    100     print "ENDPROC vbox_glX%s" % func_name
    101     print ""
     95    print("BEGINPROC_EXPORTED vbox_glX%s" % func_name)
     96    print("%ifdef RT_ARCH_AMD64")
     97    print("\tjmp \t[glxim+%d wrt rip wrt ..gotpcrel]" % (8*index))
     98    print("%else ; X86")
     99    print("\tjmp \t[glxim+%d wrt ..gotpc]" % (4*index))
     100    print("%endif")
     101    print("ENDPROC vbox_glX%s" % func_name)
     102    print("")
    102103
  • trunk/src/VBox/Additions/common/crOpenGL/cr_gl.py

    r62521 r63939  
    1 print """
     1from __future__ import print_function
     2print("""
    23/** @file
    34 * VBox OpenGL chromium functions header
     
    1516 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1617 */
    17 """
     18""")
    1819# Copyright (c) 2001, Stanford University
    1920# All rights reserved.
     
    2728apiutil.CopyrightC()
    2829
    29 print """
     30print("""
    3031/* DO NOT EDIT - THIS FILE GENERATED BY THE cr_gl.py SCRIPT */
    3132#ifndef __CR_GL_H__
     
    4142#endif
    4243
    43 """
     44""")
    4445
    4546
     
    5960        params = apiutil.Parameters(func_name)
    6061
    61         print "extern %s cr_gl%s( %s );" % (return_type, func_name,
    62                                                                   apiutil.MakeDeclarationString( params ))
     62        print("extern %s cr_gl%s( %s );" % (return_type, func_name,
     63                                                                  apiutil.MakeDeclarationString( params )))
    6364
    64 print "#endif /* __CR_GL_H__ */"
     65print("#endif /* __CR_GL_H__ */")
  • trunk/src/VBox/Additions/common/crOpenGL/defs.py

    r48999 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1314#print "LIBRARY VBoxOGL"
    1415#print "DESCRIPTION \"\"" - warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
    15 print "EXPORTS"
     16print("EXPORTS")
    1617
    1718# XXX can't these values be automatically computed by analyzing parameters?
     
    424425        continue
    425426    try:
    426         print "gl%s@%d = cr_gl%s" % (func_name,stack_sizes[func_name],func_name)
     427        print("gl%s@%d = cr_gl%s" % (func_name,stack_sizes[func_name],func_name))
    427428    except KeyError:
    428429        pass
     
    456457           "wglGetPixelFormatAttribfvEXT",
    457458           "wglGetExtensionsStringEXT"):
    458     print "%s = %s_prox" % (func_name,func_name)
     459    print("%s = %s_prox" % (func_name,func_name))
    459460
    460461"""
     
    475476"""
    476477
    477 print """DrvCopyContext
     478print("""DrvCopyContext
    478479DrvCreateContext
    479480DrvCreateLayerContext
     
    491492DrvSetContext@12 = DrvSetContext
    492493DrvValidateVersion@4 = DrvValidateVersion
    493 DrvSetPixelFormat@8 = DrvSetPixelFormat"""
    494 
    495 print """crCreateContext
     494DrvSetPixelFormat@8 = DrvSetPixelFormat""")
     495
     496print("""crCreateContext
    496497crMakeCurrent
    497498crSwapBuffers
     
    501502VBoxGetWindowId
    502503VBoxGetContextId
    503 VBoxFlushToHost"""
     504VBoxFlushToHost""")
    504505#print "DllMain"
  • trunk/src/VBox/Additions/common/crOpenGL/defs64.py

    r48999 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1213#print "LIBRARY VBoxOGL"
    1314#print "DESCRIPTION \"\"" - warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
    14 print "EXPORTS"
     15print("EXPORTS")
    1516
    1617# XXX can't these values be automatically computed by analyzing parameters?
     
    423424        continue
    424425    if func_name in exports_special:
    425         print "gl%s = cr_gl%s" % (func_name,func_name)
     426        print("gl%s = cr_gl%s" % (func_name,func_name))
    426427
    427428for func_name in ( "wglChoosePixelFormat",
     
    453454           "wglGetPixelFormatAttribfvEXT",
    454455           "wglGetExtensionsStringEXT"):
    455     print "%s = %s_prox" % (func_name,func_name)
    456 
    457 print """DrvCopyContext
     456    print("%s = %s_prox" % (func_name,func_name))
     457
     458print("""DrvCopyContext
    458459DrvCreateContext
    459460DrvCreateLayerContext
     
    471472DrvSetContext = DrvSetContext
    472473DrvValidateVersion = DrvValidateVersion
    473 DrvSetPixelFormat = DrvSetPixelFormat"""
    474 
    475 print """crCreateContext
     474DrvSetPixelFormat = DrvSetPixelFormat""")
     475
     476print("""crCreateContext
    476477crMakeCurrent
    477478crSwapBuffers
     
    481482VBoxGetWindowId
    482483VBoxGetContextId
    483 VBoxFlushToHost"""
     484VBoxFlushToHost""")
    484485#print "DllMain"
  • trunk/src/VBox/Additions/common/crOpenGL/entrypoints.py

    r63205 r63939  
    1111
    1212
     13from __future__ import print_function
    1314import sys
    1415
     
    2324    apiutil.CopyrightC()
    2425
    25     print '#define GL_GLEXT_PROTOTYPES'
    26     print '#include <stdio.h>'
    27     print '#include <stdlib.h>'
    28     print '#include <GL/gl.h>'
    29     print '#include "chromium.h"'
    30     print '#include "stub.h"'
    31     print '#include "dri_glx.h"'
    32     print ''
    33     print '#ifdef __GNUC__';
    34     print '# if (__GNUC__ << 16) + __GNUC_MINOR__ >= 0x40002';
    35     print '#  pragma GCC diagnostic ignored "-Wunused-parameter"';
    36     print '# endif';
    37     print '#endif';
     26    print('#define GL_GLEXT_PROTOTYPES')
     27    print('#include <stdio.h>')
     28    print('#include <stdlib.h>')
     29    print('#include <GL/gl.h>')
     30    print('#include "chromium.h"')
     31    print('#include "stub.h"')
     32    print('#include "dri_glx.h"')
     33    print('')
     34    print('#ifdef __GNUC__')
     35    print('# if (__GNUC__ << 16) + __GNUC_MINOR__ >= 0x40002')
     36    print('#  pragma GCC diagnostic ignored "-Wunused-parameter"')
     37    print('# endif')
     38    print('#endif')
    3839
    3940
     
    5354
    5455        if func_name in hacks:
    55             print "/* hacked entrypoint: %s */" % func_name
     56            print("/* hacked entrypoint: %s */" % func_name)
    5657            if func_name == "TexImage3D":
    5758                # Pretty common: internalformat is GLenum, not GLint
    58                 print "void glTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels )"
    59                 print "{"
    60                 print "\tglim.TexImage3D( target, level, (GLint) internalformat, width, height, depth, border, format, type, pixels );"
    61                 print "}"
     59                print("void glTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels )")
     60                print("{")
     61                print("\tglim.TexImage3D( target, level, (GLint) internalformat, width, height, depth, border, format, type, pixels );")
     62                print("}")
    6263            elif func_name == "TexImage2D":
    6364                # Pretty common: internalformat is GLenum, not GLint
    64                 print "void glTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )"
    65                 print "{"
    66                 print "\tglim.TexImage2D( target, level, (GLint) internalformat, width, height, border, format, type, pixels );"
    67                 print "}"
     65                print("void glTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )")
     66                print("{")
     67                print("\tglim.TexImage2D( target, level, (GLint) internalformat, width, height, border, format, type, pixels );")
     68                print("}")
    6869            elif func_name == "TexImage1D":
    6970                # Pretty common: internalformat is GLenum, not GLint
    70                 print "void glTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels )"
    71                 print "{"
    72                 print "\tglim.TexImage1D( target, level, (GLint) internalformat, width, border, format, type, pixels );"
    73                 print "}"
     71                print("void glTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels )")
     72                print("{")
     73                print("\tglim.TexImage1D( target, level, (GLint) internalformat, width, border, format, type, pixels );")
     74                print("}")
    7475            elif func_name == "EdgeFlagPointer":
    7576                # second arg is GLboolean instead of GLvoid
    76                 print "void glEdgeFlagPointer( GLsizei stride, const GLboolean *pointer )"
    77                 print "{"
    78                 print "\tglim.EdgeFlagPointer( stride, pointer );"
    79                 print "}"
     77                print("void glEdgeFlagPointer( GLsizei stride, const GLboolean *pointer )")
     78                print("{")
     79                print("\tglim.EdgeFlagPointer( stride, pointer );")
     80                print("}")
    8081            elif func_name == "ProgramParameters4fvNV":
    81                 print "void glProgramParameters4fvNV( GLenum target, GLuint index, GLuint num, const GLfloat *params )"
    82                 print "{"
    83                 print "\tglim.ProgramParameters4fvNV( target, index, num, params );"
    84                 print "}"
     82                print("void glProgramParameters4fvNV( GLenum target, GLuint index, GLuint num, const GLfloat *params )")
     83                print("{")
     84                print("\tglim.ProgramParameters4fvNV( target, index, num, params );")
     85                print("}")
    8586            elif func_name == "MultiDrawElementsEXT":
    86                 print "void glMultiDrawElementsEXT(GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)"
    87                 print "{"
    88                 print "\tglim.MultiDrawElementsEXT(mode, count,type, indices, primcount);"
    89                 print "}"
     87                print("void glMultiDrawElementsEXT(GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)")
     88                print("{")
     89                print("\tglim.MultiDrawElementsEXT(mode, count,type, indices, primcount);")
     90                print("}")
    9091            elif func_name == "ProgramParameters4dvNV":
    91                 print "void glProgramParameters4dvNV( GLenum target, GLuint index, GLuint num, const GLdouble *params )"
    92                 print "{"
    93                 print "\tglim.ProgramParameters4dvNV( target, index, num, params );"
    94                 print "}"
     92                print("void glProgramParameters4dvNV( GLenum target, GLuint index, GLuint num, const GLdouble *params )")
     93                print("{")
     94                print("\tglim.ProgramParameters4dvNV( target, index, num, params );")
     95                print("}")
    9596        else:
    9697            # the usual path
    97             print "%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    98             print ""
    99             print "%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    100             print "{"
    101             print "\t",
     98            print("%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     99            print("")
     100            print("%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     101            print("{")
     102            print("\t", end="")
    102103            if return_type != "void":
    103                 print "return ",
    104             print "glim.%s( %s );" % (func_name, apiutil.MakeCallString(params))
    105             print "}"
    106             print ""
     104                print("return ", end=" ")
     105            print("glim.%s( %s );" % (func_name, apiutil.MakeCallString(params)))
     106            print("}")
     107            print("")
    107108
    108     print '/*'
    109     print '* Aliases'
    110     print '*/'
     109    print('/*')
     110    print('* Aliases')
     111    print('*/')
    111112
    112113    # Now loop over all the functions and take care of any aliases
     
    124125        if alias:
    125126            if func_name in hacks:
    126                 print "/* hacked entrypoint: %s */" % func_name
     127                print("/* hacked entrypoint: %s */" % func_name)
    127128                if func_name == "MultiDrawArrays":
    128                     print "void glMultiDrawArrays( GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount )"
    129                     print "{"
    130                     print "\tglim.MultiDrawArraysEXT( mode, (GLint*)first, (GLsizei*)count, primcount );"
    131                     print "}"
     129                    print("void glMultiDrawArrays( GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount )")
     130                    print("{")
     131                    print("\tglim.MultiDrawArraysEXT( mode, (GLint*)first, (GLsizei*)count, primcount );")
     132                    print("}")
    132133                elif func_name == "BufferData":
    133                     print "void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)"
    134                     print "{"
    135                     print "\tglim.BufferDataARB(target, size, data, usage);"
    136                     print "}"
     134                    print("void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)")
     135                    print("{")
     136                    print("\tglim.BufferDataARB(target, size, data, usage);")
     137                    print("}")
    137138                elif func_name == "BufferSubData":
    138                     print "void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)"
    139                     print "{"
    140                     print "\tglim.BufferSubDataARB(target, offset, size, data);"
    141                     print "}"
     139                    print("void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)")
     140                    print("{")
     141                    print("\tglim.BufferSubDataARB(target, offset, size, data);")
     142                    print("}")
    142143                elif func_name == "GetBufferSubData":
    143                     print "void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)"
    144                     print "{"
    145                     print "\tglim.GetBufferSubDataARB(target, offset, size, data);"
    146                     print "}"
     144                    print("void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data)")
     145                    print("{")
     146                    print("\tglim.GetBufferSubDataARB(target, offset, size, data);")
     147                    print("}")
    147148            else:
    148149                return_type = apiutil.ReturnType(func_name)
    149150                params = apiutil.Parameters(func_name)
    150                 print "%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    151                 print ""
    152                 print "%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    153                 print "{"
    154                 print "\t",
     151                print("%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     152                print("")
     153                print("%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     154                print("{")
     155                print("\t", end="")
    155156                if return_type != "void":
    156                     print "return ",
    157                 print "glim.%s( %s );" % (alias, apiutil.MakeCallString(params))
    158                 print "}"
    159                 print ""
     157                    print("return ", end=" ")
     158                print("glim.%s( %s );" % (alias, apiutil.MakeCallString(params)))
     159                print("}")
     160                print("")
    160161
    161     print '/*'
    162     print '* No-op stubs'
    163     print '*/'
     162    print('/*')
     163    print('* No-op stubs')
     164    print('*/')
    164165
    165166    # Now generate no-op stub functions
     
    169170            params = apiutil.Parameters(func_name)
    170171
    171             print "%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    172             print ""
    173             print "%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    174             print "{"
     172            print("%s VBOXGLTAG(gl%s)( %s );" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     173            print("")
     174            print("%s VBOXGLTAG(gl%s)( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     175            print("{")
    175176            if return_type != "void":
    176                 print "return (%s) 0" % return_type
    177             print "}"
    178             print ""
     177                print("return (%s) 0" % return_type)
     178            print("}")
     179            print("")
    179180
    180181
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback.py

    r17269 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - generated by feedback.py */
    1516#include <stdio.h>
     
    2021#include "cr_glstate.h"
    2122
    22 """
     23""")
    2324
    2425keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    2829        params = apiutil.Parameters(func_name)
    2930        if apiutil.FindSpecial( "feedback", func_name ):
    30                 print 'static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )
    31                 print '{'
    32                 print '\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )
    33                 print '}'
    34 
    35 
    36 
    37 print """
     31                print('static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) ))
     32                print('{')
     33                print('\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) ))
     34                print('}')
     35
     36
     37
     38print("""
    3839#define CHANGE( name, func ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) func) )
    3940#define CHANGESWAP( name, swapfunc, regfunc ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) (feedback_spu.swap ? swapfunc: regfunc )) )
     
    4142static void __loadFeedbackAPI( void )
    4243{
    43 """
     44""")
    4445for func_name in keys:
    4546        return_type = apiutil.ReturnType(func_name)
    4647        params = apiutil.Parameters(func_name)
    4748        if apiutil.FindSpecial( "feedback", func_name ):
    48                 print '\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name )
    49 print """
     49                print('\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name ))
     50print("""
    5051}
    5152
    5253static void __loadSelectAPI( void )
    5354{
    54 """
     55""")
    5556for func_name in keys:
    5657        if apiutil.FindSpecial( "select", func_name ):
    57                 print '\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name )
     58                print('\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name ))
    5859        elif apiutil.FindSpecial( "feedback", func_name ):
    59                 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )
    60 print """
     60                print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name ))
     61print("""
    6162}
    6263
    6364static void __loadRenderAPI( void )
    6465{
    65 """
     66""")
    6667
    6768for func_name in keys:
    6869        return_type = apiutil.ReturnType(func_name)
    6970        if apiutil.FindSpecial( "feedback", func_name ) or apiutil.FindSpecial( "select", func_name ):
    70                 print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )
    71 print """
    72 }
    73 """
    74 
    75 print """
     71                print('\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name ))
     72print("""
     73}
     74""")
     75
     76print("""
    7677static GLint FEEDBACKSPU_APIENTRY feedbackspu_RenderMode ( GLenum mode )
    7778{
     
    211212
    212213SPUNamedFunctionTable _cr_feedback_table[] = {
    213 """
     214""")
    214215
    215216for func_name in keys:
    216217        if apiutil.FindSpecial( "feedback_state", func_name ):
    217                 print '\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name )
    218 print """
     218                print('\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name ))
     219print("""
    219220        { "GetBooleanv", (SPUGenericFunction) feedbackspu_GetBooleanv },
    220221        { "GetDoublev", (SPUGenericFunction) feedbackspu_GetDoublev },
     
    267268        { NULL, NULL }
    268269};
    269 """
     270""")
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_funcs.py

    r17269 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY feedback_funcs.py SCRIPT */
    1516#ifndef CR_STATE_FEEDBACK_FUNCS_H
     
    2425#endif
    2526
    26 #define STATE_UNUSED(x) ((void)x)"""
     27#define STATE_UNUSED(x) ((void)x)""")
    2728
    2829keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    3132        return_type = apiutil.ReturnType(func_name)
    3233        params = apiutil.Parameters(func_name)
    33         print '%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
     34        print('%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
    3435
    3536for func_name in apiutil.AllSpecials( "select" ):
    3637        return_type = apiutil.ReturnType(func_name)
    3738        params = apiutil.Parameters(func_name)
    38         print '%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
    39 print '\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */'
     39        print('%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     40print('\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */')
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedback_state.py

    r42499 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415#include "cr_server.h"
    1516#include "feedbackspu.h"
    1617#include "feedbackspu_proto.h"
    17 """
     18""")
    1819custom = ["CreateContext", "VBoxCreateContext", "MakeCurrent", "DestroyContext"]
    1920
     
    2627        return_type = apiutil.ReturnType(func_name)
    2728        params = apiutil.Parameters(func_name)
    28         print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))
    29         print '{'
    30         print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))
    31         print ''
    32         print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))
    33         print '}'
     29        print('%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     30        print('{')
     31        print('\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params)))
     32        print('')
     33        print('\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params)))
     34        print('}')
  • trunk/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_proto.py

    r17269 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - generated by feedback.py */
    1516
     
    1920#include "feedbackspu.h"
    2021
    21 """
     22""")
    2223
    2324keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    2728                return_type = apiutil.ReturnType(func_name)
    2829                params = apiutil.Parameters(func_name)
    29                 print 'extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
     30                print('extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params)))
    3031
    3132
    32 print """
     33print("""
    3334#endif
    34 """
     35""")
  • trunk/src/VBox/Additions/common/crOpenGL/getprocaddress.py

    r51200 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1011apiutil.CopyrightC()
    1112
    12 print """
     13print("""
    1314/* DO NOT EDIT - THIS FILE GENERATED BY THE getprocaddress.py SCRIPT */
    1415
     
    3031
    3132static struct name_address functions[] = {
    32 """
     33""")
    3334
    3435
     
    4849        address = "VBOXGLTAG(gl" + func_name + ")"
    4950        if wrap:
    50                 print '#ifdef CR_%s' % wrap
    51         print '\t{ "%s", (CR_PROC) %s },' % (name, address)
     51                print('#ifdef CR_%s' % wrap)
     52        print('\t{ "%s", (CR_PROC) %s },' % (name, address))
    5253        if wrap:
    53                 print '#endif'
     54                print('#endif')
    5455
    5556
    56 print "\t/* Chromium binding/glue functions */"
     57print("\t/* Chromium binding/glue functions */")
    5758
    5859for func_name in keys:
     
    6364                continue
    6465        if apiutil.Category(func_name) == "Chromium":
    65                 print '\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)
     66                print('\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name))
    6667
    6768
    68 print """
     69print("""
    6970        { NULL, NULL }
    7071};
     
    102103}
    103104
    104 """
     105""")
    105106
    106107
  • trunk/src/VBox/Additions/common/crOpenGL/pack/pack.py

    r20083 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1415apiutil.CopyrightC()
    1516
    16 print """
     17print("""
    1718/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY pack.py SCRIPT */
    1819#include <stdio.h>
     
    2223#include "cr_packfunctions.h"
    2324#include "packspu_proto.h"
    24 """
     25""")
    2526
    2627num_funcs = len(keys) - len(apiutil.AllSpecials('packspu_unimplemented'))
    27 print 'SPUNamedFunctionTable _cr_pack_table[%d];' % (num_funcs+1)
     28print('SPUNamedFunctionTable _cr_pack_table[%d];' % (num_funcs+1))
    2829
    29 print """
     30print("""
    3031static void __fillin( int offset, char *name, SPUGenericFunction func )
    3132{
    3233    _cr_pack_table[offset].name = crStrdup( name );
    3334    _cr_pack_table[offset].fn = func;
    34 }"""
     35}""")
    3536
    3637pack_specials = []
     
    4344      pack_specials.append( func_name )
    4445
    45 print '\nvoid packspuCreateFunctions( void )'
    46 print '{'
     46print('\nvoid packspuCreateFunctions( void )')
     47print('{')
    4748for index in range(len(keys)):
    4849    func_name = keys[index]
     
    5051        continue
    5152    if func_name in pack_specials:
    52         print '\t__fillin( %3d, "%s", (SPUGenericFunction) packspu_%s );' % (index, func_name, func_name )
     53        print('\t__fillin( %3d, "%s", (SPUGenericFunction) packspu_%s );' % (index, func_name, func_name ))
    5354    else:
    54         print '\t__fillin( %3d, "%s", (SPUGenericFunction) (pack_spu.swap ? crPack%sSWAP : crPack%s) );' % (index, func_name, func_name, func_name )
    55 print '\t__fillin( %3d, NULL, NULL );' % num_funcs
    56 print '}'
     55        print('\t__fillin( %3d, "%s", (SPUGenericFunction) (pack_spu.swap ? crPack%sSWAP : crPack%s) );' % (index, func_name, func_name, func_name ))
     56print('\t__fillin( %3d, NULL, NULL );' % num_funcs)
     57print('}')
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_beginend.py

    r63206 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """/* DO NOT EDIT - AUTOMATICALLY GENERATED BY packspu_beginend.py */
     14print("""/* DO NOT EDIT - AUTOMATICALLY GENERATED BY packspu_beginend.py */
    1415#include "packspu.h"
    1516#include "assert.h"
     
    157158    DoVertex();
    158159}
    159 """
     160""")
    160161
    161162keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    163164for func_name in apiutil.AllSpecials( "packspu_vertex" ):
    164165    params = apiutil.Parameters(func_name)
    165     print 'void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params) )
    166     print '{'
    167     print '\tif (pack_spu.swap)'
    168     print '\t{'
    169     print '\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ) )
    170     print '\t}'
    171     print '\telse'
    172     print '\t{'
    173     print '\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ) )
    174     print '\t}'
    175     print '\tRunState();'
    176     print '}'
     166    print('void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params) ))
     167    print('{')
     168    print('\tif (pack_spu.swap)')
     169    print('\t{')
     170    print('\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ) ))
     171    print('\t}')
     172    print('\telse')
     173    print('\t{')
     174    print('\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ) ))
     175    print('\t}')
     176    print('\tRunState();')
     177    print('}')
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py

    r20083 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - this file generated by packspu_flush.py script */
    1516
     
    2122#include "packspu.h"
    2223#include "packspu_proto.h"
    23 """
     24""")
    2425
    2526keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    2728for func_name in apiutil.AllSpecials( "packspu_flush" ):
    2829    params = apiutil.Parameters(func_name)
    29     print 'void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params))
    30     print '{'
    31     print '\tGET_THREAD(thread);'
    32     print '\tif (pack_spu.swap)'
    33     print '\t{'
    34     print '\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ) )
    35     print '\t}'
    36     print '\telse'
    37     print '\t{'
    38     print '\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ) )
    39     print '\t}'
    40     print '\tpackspuFlush( (void *) thread );'
    41     print '}\n'
     30    print('void PACKSPU_APIENTRY packspu_%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params)))
     31    print('{')
     32    print('\tGET_THREAD(thread);')
     33    print('\tif (pack_spu.swap)')
     34    print('\t{')
     35    print('\t\tcrPack%sSWAP( %s );' % ( func_name, apiutil.MakeCallString( params ) ))
     36    print('\t}')
     37    print('\telse')
     38    print('\t{')
     39    print('\t\tcrPack%s( %s );' % ( func_name, apiutil.MakeCallString( params ) ))
     40    print('\t}')
     41    print('\tpackspuFlush( (void *) thread );')
     42    print('}\n')
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_get.py

    r63206 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY packspu_get.py SCRIPT */
    1516#include "packspu.h"
     
    1819#include "cr_mem.h"
    1920#include "packspu_proto.h"
    20 """
    21 
    22 print """
     21""")
     22
     23print("""
    2324static GLboolean crPackIsPixelStoreParm(GLenum pname)
    2425{
     
    4647    return GL_FALSE;
    4748}
    48 """
     49""")
    4950
    5051from get_sizes import *
     
    8586
    8687    if "get" in apiutil.Properties(func_name):
    87         print '%s PACKSPU_APIENTRY packspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString( params ) )
    88         print '{'
    89         print '\tGET_THREAD(thread);'
    90         print '\tint writeback = 1;'
     88        print('%s PACKSPU_APIENTRY packspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString( params ) ))
     89        print('{')
     90        print('\tGET_THREAD(thread);')
     91        print('\tint writeback = 1;')
    9192        if return_type != 'void':
    92             print '\t%s return_val = (%s) 0;' % (return_type, return_type)
     93            print('\t%s return_val = (%s) 0;' % (return_type, return_type))
    9394            params.append( ("&return_val", "foo", 0) )
    94         if (func_name in easy_swaps.keys() and easy_swaps[func_name] != '0') or func_name in simple_funcs or func_name in hard_funcs.keys():
    95             print '\tunsigned int i;'
    96         print '\tif (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))'
    97         print '\t{'
    98         print '\t\tcrError( "packspu_%s doesn\'t work when there\'s no actual network involved!\\nTry using the simplequery SPU in your chain!" );' % func_name
    99         print '\t}'
     95        if (func_name in easy_swaps and easy_swaps[func_name] != '0') or func_name in simple_funcs or func_name in hard_funcs:
     96            print('\tunsigned int i;')
     97        print('\tif (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))')
     98        print('\t{')
     99        print('\t\tcrError( "packspu_%s doesn\'t work when there\'s no actual network involved!\\nTry using the simplequery SPU in your chain!" );' % func_name)
     100        print('\t}')
    100101        if func_name in simple_funcs:
    101             print """
     102            print("""
    102103    if (crPackIsPixelStoreParm(pname)
    103104        || pname == GL_DRAW_BUFFER
     
    162163           
    163164        }
    164             """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name)
     165            """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name))
    165166           
    166167        if func_name in vertattr_get_funcs:
    167             print """
     168            print("""
    168169    if (pname != GL_CURRENT_VERTEX_ATTRIB_ARB)
    169170    {
     
    189190        return;
    190191    }
    191             """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name)
     192            """ % (params[-1][1], params[-1][1], func_name, func_name, apiutil.MakeCallString(params), func_name, func_name))
    192193
    193194        params.append( ("&writeback", "foo", 0) )
    194         print '\tif (pack_spu.swap)'
    195         print '\t{'
    196         print '\t\tcrPack%sSWAP( %s );' % (func_name, apiutil.MakeCallString( params ) )
    197         print '\t}'
    198         print '\telse'
    199         print '\t{'
    200         print '\t\tcrPack%s( %s );' % (func_name, apiutil.MakeCallString( params ) )
    201         print '\t}'
    202         print '\tpackspuFlush( (void *) thread );'
    203         print '\tCRPACKSPU_WRITEBACK_WAIT(thread, writeback);'
     195        print('\tif (pack_spu.swap)')
     196        print('\t{')
     197        print('\t\tcrPack%sSWAP( %s );' % (func_name, apiutil.MakeCallString( params ) ))
     198        print('\t}')
     199        print('\telse')
     200        print('\t{')
     201        print('\t\tcrPack%s( %s );' % (func_name, apiutil.MakeCallString( params ) ))
     202        print('\t}')
     203        print('\tpackspuFlush( (void *) thread );')
     204        print('\tCRPACKSPU_WRITEBACK_WAIT(thread, writeback);')
    204205
    205206
     
    207208        lastParamName = params[-2][0]
    208209        if return_type != 'void':
    209             print '\tif (pack_spu.swap)'
    210             print '\t{'
    211             print '\t\treturn_val = (%s) SWAP32(return_val);' % return_type
    212             print '\t}'
    213             print '\treturn return_val;'
    214         if func_name in easy_swaps.keys() and easy_swaps[func_name] != '0':
     210            print('\tif (pack_spu.swap)')
     211            print('\t{')
     212            print('\t\treturn_val = (%s) SWAP32(return_val);' % return_type)
     213            print('\t}')
     214            print('\treturn return_val;')
     215        if func_name in easy_swaps and easy_swaps[func_name] != '0':
    215216            limit = easy_swaps[func_name]
    216             print '\tif (pack_spu.swap)'
    217             print '\t{'
    218             print '\t\tfor (i = 0 ; i < %s ; i++)' % limit
    219             print '\t\t{'
     217            print('\tif (pack_spu.swap)')
     218            print('\t{')
     219            print('\t\tfor (i = 0 ; i < %s ; i++)' % limit)
     220            print('\t\t{')
    220221            if params[-2][1].find( "double" ) > -1:
    221                 print '\t\t\t%s[i] = SWAPDOUBLE(%s[i]);' % (lastParamName, lastParamName)
     222                print('\t\t\t%s[i] = SWAPDOUBLE(%s[i]);' % (lastParamName, lastParamName))
    222223            else:
    223                 print '\t\t\t%s[i] = SWAP32(%s[i]);' % (lastParamName, lastParamName)
    224             print '\t\t}'
    225             print '\t}'
     224                print('\t\t\t%s[i] = SWAP32(%s[i]);' % (lastParamName, lastParamName))
     225            print('\t\t}')
     226            print('\t}')
    226227        for index in range(len(simple_funcs)):
    227228            if simple_funcs[index] == func_name:
    228                 print '\tif (pack_spu.swap)'
    229                 print '\t{'
    230                 print '\t\tfor (i = 0 ; i < __numValues( pname ) ; i++)'
    231                 print '\t\t{'
     229                print('\tif (pack_spu.swap)')
     230                print('\t{')
     231                print('\t\tfor (i = 0 ; i < __numValues( pname ) ; i++)')
     232                print('\t\t{')
    232233                if simple_swaps[index] == 'SWAPDOUBLE':
    233                     print '\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName)
     234                    print('\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName))
    234235                else:
    235                     print '\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName)
    236                 print '\t\t}'
    237                 print '\t}'
    238         if func_name in hard_funcs.keys():
    239             print '\tif (pack_spu.swap)'
    240             print '\t{'
    241             print '\t\tfor (i = 0 ; i < crStateHlpComponentsCount(pname) ; i++)'
    242             print '\t\t{'
     236                    print('\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, simple_swaps[index], lastParamName))
     237                print('\t\t}')
     238                print('\t}')
     239        if func_name in hard_funcs:
     240            print('\tif (pack_spu.swap)')
     241            print('\t{')
     242            print('\t\tfor (i = 0 ; i < crStateHlpComponentsCount(pname) ; i++)')
     243            print('\t\t{')
    243244            if hard_funcs[func_name] == 'SWAPDOUBLE':
    244                 print '\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName)
     245                print('\t\t\t%s[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName))
    245246            else:
    246                 print '\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName)
    247             print '\t\t}'
    248             print '\t}'
    249         print '}\n'
     247                print('\t\t\t((GLuint *) %s)[i] = %s(%s[i]);' % (lastParamName, hard_funcs[func_name], lastParamName))
     248            print('\t\t}')
     249            print('\t}')
     250        print('}\n')
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_proto.py

    r20083 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1011apiutil.CopyrightC()
    1112
    12 print """
     13print("""
    1314/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY packspu_proto.py SCRIPT */
    1415
     
    2122#include "packspu.h"
    2223#include "cr_packfunctions.h"
    23 """
     24""")
    2425
    2526
     
    4243        return_type = apiutil.ReturnType(func_name)
    4344        params = apiutil.Parameters(func_name)
    44         print 'extern %s PACKSPU_APIENTRY packspu_%s( %s );' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )
     45        print('extern %s PACKSPU_APIENTRY packspu_%s( %s );' % ( return_type, func_name, apiutil.MakeDeclarationString(params) ))
    4546
    4647
    47 print """
     48print("""
    4849#endif
    49 """
     50""")
  • trunk/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py

    r15532 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """#include <stdio.h>
     14print("""#include <stdio.h>
    1415#include "cr_error.h"
    1516#include "cr_string.h"
    1617#include "cr_spu.h"
    1718#include "passthroughspu.h"
    18 """
     19""")
    1920
    2021keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
    2122
    2223
    23 print 'SPUNamedFunctionTable _cr_passthrough_table[%d];' % ( len(keys) + 1 )
     24print('SPUNamedFunctionTable _cr_passthrough_table[%d];' % ( len(keys) + 1 ))
    2425
    25 print """
     26print("""
    2627static void __fillin( int offset, char *name, SPUGenericFunction func )
    2728{
     
    3132
    3233void BuildPassthroughTable( SPU *child )
    33 {"""
     34{""")
    3435
    3536for index in range(len(keys)):
    3637        func_name = keys[index]
    37         print '\t__fillin( %3d, "%s", (SPUGenericFunction) child->dispatch_table.%s );' % (index, func_name, func_name )
    38 print '\t__fillin( %3d, NULL, NULL );' % len(keys)
    39 print '}'
     38        print('\t__fillin( %3d, "%s", (SPUGenericFunction) child->dispatch_table.%s );' % (index, func_name, func_name ))
     39print('\t__fillin( %3d, NULL, NULL );' % len(keys))
     40print('}')
  • trunk/src/VBox/Additions/common/crOpenGL/stub_common.py

    r15532 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78curver = sys.version_info[0] + sys.version_info[1]/10.0
    89if curver < 2.2:
    9         print >>sys.stderr, "Your python is version %g.  Chromium requires at least"%(curver)
    10         print >>sys.stderr, "version 2.2.  Please upgrade your python installation."
     10        print("Your python is version %g.  Chromium requires at least"%(curver), file=sys.stderr)
     11        print("version 2.2.  Please upgrade your python installation.", file=sys.stderr)
    1112        sys.exit(1)
    1213
     
    1516
    1617def CopyrightC( ):
    17         print """/* Copyright (c) 2001, Stanford University
     18        print("""/* Copyright (c) 2001, Stanford University
    1819        All rights reserved.
    1920
    2021        See the file LICENSE.txt for information on redistributing this software. */
    21         """
     22        """)
    2223
    2324def CopyrightDef( ):
    24         print """; Copyright (c) 2001, Stanford University
     25        print("""; Copyright (c) 2001, Stanford University
    2526        ; All rights reserved.
    2627        ;
    2728        ; See the file LICENSE.txt for information on redistributing this software.
    28         """
     29        """)
    2930
    3031def DecoderName( glName ):
     
    101102                return []
    102103
    103         keys = subtable.keys()
    104         keys.sort()
    105         return keys
     104        return sorted(subtable.keys())
    106105
    107106def FindAnnotation( filename, key, subkey ):
     
    167166                table = LoadSpecials( filename )
    168167       
    169         keys = table.keys()
    170         keys.sort()
    171         return keys
     168        return sorted(table.keys())
    172169
    173170def AllSpecials( table_file ):
     
    180177                table = LoadSpecials(filename)
    181178       
    182         ret = table.keys()
    183         ret.sort()
    184         return ret
     179        return sorted(table.keys())
    185180       
    186181def NumSpecials( table_file ):
  • trunk/src/VBox/Additions/common/crOpenGL/tsfuncs.py

    r15532 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1112apiutil.CopyrightC()
    1213
    13 print """
     14print("""
    1415/* DO NOT EDIT - THIS FILE GENERATED BY THE tsfuncs.py SCRIPT */
    1516
    1617#include "stub.h"
    17 """
     18""")
    1819
    1920keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
     
    2324        params = apiutil.Parameters(func_name)
    2425
    25         print "static %s SPULOAD_APIENTRY ts_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) )
    26         print "{"
    27         print "\tSPUDispatchTable *tab = (SPUDispatchTable *) crGetTSD(&stub.dispatchTSD);"
     26        print("static %s SPULOAD_APIENTRY ts_%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params) ))
     27        print("{")
     28        print("\tSPUDispatchTable *tab = (SPUDispatchTable *) crGetTSD(&stub.dispatchTSD);")
    2829
    2930        if return_type != "void":
    30                 print "\treturn ",
     31                print("\treturn ", end=" ")
    3132
    32         print "\ttab->%s( %s );" % (func_name, apiutil.MakeCallString(params))
    33         print "}"
    34         print ""
     33        print("\ttab->%s( %s );" % (func_name, apiutil.MakeCallString(params)))
     34        print("}")
     35        print("")
    3536
    3637
    37 print "SPUDispatchTable stubThreadsafeDispatch = {"
     38print("SPUDispatchTable stubThreadsafeDispatch = {")
    3839
    3940for func_name in keys:
    40         print "\tts_%s," % func_name
     41        print("\tts_%s," % func_name)
    4142
    42 print "\tNULL,  /* copyList */"
    43 print "\tNULL,  /* copy_of */"
    44 print "\t0,     /* mark */"
    45 print "\tNULL   /* server */"
    46 print "};"
     43print("\tNULL,  /* copyList */")
     44print("\tNULL,  /* copy_of */")
     45print("\t0,     /* mark */")
     46print("\tNULL   /* server */")
     47print("};")
  • trunk/src/VBox/Additions/common/crOpenGL/windows_exports.py

    r30457 r63939  
    55
    66
     7from __future__ import print_function
    78import sys
    89
     
    1415        apiutil.CopyrightC()
    1516
    16         print '#include "chromium.h"'
    17         print '#include "stub.h"'
    18         print ''
    19         print '#define NAKED __declspec(naked)'
    20         print '#define UNUSED(x) ((void)(x))'
    21         print ''
     17        print('#include "chromium.h"')
     18        print('#include "stub.h"')
     19        print('')
     20        print('#define NAKED __declspec(naked)')
     21        print('#define UNUSED(x) ((void)(x))')
     22        print('')
    2223
    2324
     
    3738                params = apiutil.Parameters(func_name)
    3839
    39                 print "NAKED %s cr_gl%s( %s )" % (return_type, func_name,
    40                                                                           apiutil.MakeDeclarationString( params ))
    41                 print "{"
    42                 print "\t__asm jmp [glim.%s]" % func_name
     40                print("NAKED %s cr_gl%s( %s )" % (return_type, func_name,
     41                                                                          apiutil.MakeDeclarationString( params )))
     42                print("{")
     43                print("\t__asm jmp [glim.%s]" % func_name)
    4344                for (name, type, vecSize) in params:
    44                         print "\tUNUSED( %s );" % name
    45                 print "}"
    46                 print ""
     45                        print("\tUNUSED( %s );" % name)
     46                print("}")
     47                print("")
    4748
    48         print '/*'
    49         print '* Aliases'
    50         print '*/'
     49        print('/*')
     50        print('* Aliases')
     51        print('*/')
    5152
    5253        # Now loop over all the functions and take care of any aliases
     
    6566                        return_type = apiutil.ReturnType(func_name)
    6667                        params = apiutil.Parameters(func_name)
    67                         print "NAKED %s cr_gl%s( %s )" % (return_type, func_name,
    68                                                                 apiutil.MakeDeclarationString( params ))
    69                         print "{"
    70                         print "\t__asm jmp [glim.%s]" % alias
     68                        print("NAKED %s cr_gl%s( %s )" % (return_type, func_name,
     69                                                                apiutil.MakeDeclarationString( params )))
     70                        print("{")
     71                        print("\t__asm jmp [glim.%s]" % alias)
    7172                        for (name, type, vecSize) in params:
    72                                 print "\tUNUSED( %s );" % name
    73                         print "}"
    74                         print ""
     73                                print("\tUNUSED( %s );" % name)
     74                        print("}")
     75                        print("")
    7576
    7677
    77         print '/*'
    78         print '* No-op stubs'
    79         print '*/'
     78        print('/*')
     79        print('* No-op stubs')
     80        print('*/')
    8081
    8182        # Now generate no-op stub functions
     
    8485                        return_type = apiutil.ReturnType(func_name)
    8586                        params = apiutil.Parameters(func_name)
    86                         print "NAKED %s cr_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params))
    87                         print "{"
     87                        print("NAKED %s cr_gl%s( %s )" % (return_type, func_name, apiutil.MakeDeclarationString(params)))
     88                        print("{")
    8889                        if return_type != "void":
    89                                 print "return (%s) 0" % return_type
    90                         print "}"
    91                         print ""
     90                                print("return (%s) 0" % return_type)
     91                        print("}")
     92                        print("")
    9293
    9394
  • trunk/src/VBox/Additions/common/crOpenGL/windows_getprocaddress.py

    r51200 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1011apiutil.CopyrightC()
    1112
    12 print """
     13print("""
    1314/* DO NOT EDIT - THIS FILE GENERATED BY THE getprocaddress.py SCRIPT */
    1415#include "chromium.h"
     
    2425#endif
    2526
    26 """
     27""")
    2728
    28 print """
     29print("""
    2930struct name_address {
    3031  const char *name;
     
    3536
    3637static struct name_address functions[] = {
    37 """
     38""")
    3839
    3940
     
    6061    address = "cr_gl" + proc_name
    6162    if wrap:
    62         print '#ifdef CR_%s' % wrap
    63     print '\t{ "%s", (CR_PROC) %s },' % (name, address)
     63        print('#ifdef CR_%s' % wrap)
     64    print('\t{ "%s", (CR_PROC) %s },' % (name, address))
    6465    if wrap:
    65         print '#endif'
     66        print('#endif')
    6667
    6768
    68 print "\t/* Chromium binding/glue functions */"
     69print("\t/* Chromium binding/glue functions */")
    6970
    7071for func_name in keys:
     
    7576        continue
    7677    if apiutil.Category(func_name) == "Chromium":
    77         print '\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name)
     78        print('\t{ "cr%s", (CR_PROC) cr%s },' % (func_name, func_name))
    7879
    79 print "\t/* Windows ICD functions */"
     80print("\t/* Windows ICD functions */")
    8081
    8182for func_name in ( "CopyContext",
     
    9596    "SetContext",
    9697    "ValidateVersion"):
    97     print '\t{ "Drv%s", (CR_PROC) Drv%s },' % (func_name, func_name)
     98    print('\t{ "Drv%s", (CR_PROC) Drv%s },' % (func_name, func_name))
    9899
    99 print '\t{ "DrvGetProcAddress", (CR_PROC) wglGetProcAddress_prox },'
     100print('\t{ "DrvGetProcAddress", (CR_PROC) wglGetProcAddress_prox },')
    100101
    101 print """
     102print("""
    102103    { NULL, NULL }
    103104};
     
    149150}
    150151
    151 """
     152""")
    152153
    153154
  • trunk/src/VBox/Additions/common/crOpenGL/windows_i386_exports.py

    r30457 r63939  
    55
    66
     7from __future__ import print_function
    78import sys
    89
     
    1314
    1415        #apiutil.CopyrightC()
    15         print '%include "iprt/asmdefs.mac"'
    16         print ""
    17         print "%ifdef RT_ARCH_AMD64"
    18         print "extern glim"
    19         print "%else ; X86"
    20         print "extern _glim"
    21         print "%endif"
    22         print ""
     16        print('%include "iprt/asmdefs.mac"')
     17        print("")
     18        print("%ifdef RT_ARCH_AMD64")
     19        print("extern glim")
     20        print("%else ; X86")
     21        print("extern _glim")
     22        print("%endif")
     23        print("")
    2324
    2425        # Get sorted list of dispatched functions.
     
    3435                        continue
    3536
    36                 print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    37                 print "%ifdef RT_ARCH_AMD64"
    38                 print "\tmov \trax, qword glim+%d" % (8*index)
    39                 print "\tjmp \t[rax]"
    40                 print "%else ; X86"
    41                 print "\tmov \teax, dword _glim+%d" % (4*index)
    42                 print "\tjmp \t[eax]"
    43                 print "%endif"
    44                 print "ENDPROC cr_gl%s" % func_name
    45                 print ""
     37                print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     38                print("%ifdef RT_ARCH_AMD64")
     39                print("\tmov \trax, qword glim+%d" % (8*index))
     40                print("\tjmp \t[rax]")
     41                print("%else ; X86")
     42                print("\tmov \teax, dword _glim+%d" % (4*index))
     43                print("\tjmp \t[eax]")
     44                print("%endif")
     45                print("ENDPROC cr_gl%s" % func_name)
     46                print("")
    4647
    4748
    48         print ';'
    49         print '; Aliases'
    50         print ';'
     49        print(';')
     50        print('; Aliases')
     51        print(';')
    5152
    5253        # Now loop over all the functions and take care of any aliases
     
    6566                        # this dict lookup should never fail (raise an exception)!
    6667                        index = keys.index(alias)
    67                         print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    68                         print "%ifdef RT_ARCH_AMD64"
    69                         print "\tmov \trax, qword glim+%d" % (8*index)
    70                         print "\tjmp \t[rax]"
    71                         print "%else ; X86"
    72                         print "\tmov \teax, dword _glim+%d" % (4*index)
    73                         print "\tjmp \t[eax]"
    74                         print "%endif"
    75                         print "ENDPROC cr_gl%s" % func_name
    76                         print ""
     68                        print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     69                        print("%ifdef RT_ARCH_AMD64")
     70                        print("\tmov \trax, qword glim+%d" % (8*index))
     71                        print("\tjmp \t[rax]")
     72                        print("%else ; X86")
     73                        print("\tmov \teax, dword _glim+%d" % (4*index))
     74                        print("\tjmp \t[eax]")
     75                        print("%endif")
     76                        print("ENDPROC cr_gl%s" % func_name)
     77                        print("")
    7778
    7879
    79         print ';'
    80         print '; No-op stubs'
    81         print ';'
     80        print(';')
     81        print('; No-op stubs')
     82        print(';')
    8283
    8384        # Now generate no-op stub functions
    8485        for func_name in allkeys:
    8586                if "stub" in apiutil.ChromiumProps(func_name):
    86                         print "BEGINPROC_EXPORTED cr_gl%s" % func_name
    87                         print "\tleave"
    88                         print "\tret"
    89                         print "ENDPROC cr_gl%s" % func_name
    90                         print ""
     87                        print("BEGINPROC_EXPORTED cr_gl%s" % func_name)
     88                        print("\tleave")
     89                        print("\tret")
     90                        print("ENDPROC cr_gl%s" % func_name)
     91                        print("")
    9192
    9293
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette