VirtualBox

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/convert.py

    r15532 r63939  
    44# See the file LICENSE.txt for information on redistributing this software.
    55
     6from __future__ import print_function
    67import sys
    78
     
    1718apiutil.CopyrightC()
    1819
    19 print '''
     20print('''
    2021#include "state/cr_statetypes.h"
    2122
     
    2829    return d;
    2930}
    30 '''
     31''')
    3132
    32 for k in gltypes.keys():
     33for k in sorted(gltypes.keys()):
    3334        for i in range(1,5):
    34                 print 'static void __convert_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k]['type'])
     35                print('static void __convert_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k]['type']))
    3536                if k == 'd':
    3637                  for j in range(i-1):
    37                     print '\t*dst++ = (GLfloat) __read_double(src++);'
    38                   print '\t*dst = (GLfloat) __read_double(src);'
     38                    print('\t*dst++ = (GLfloat) __read_double(src++);')
     39                  print('\t*dst = (GLfloat) __read_double(src);')
    3940                else:
    4041                  for j in range(i-1):
    41                     print '\t*dst++ = (GLfloat) *src++;';
    42                   print '\t*dst = (GLfloat) *src;';
    43                 print '}\n';
     42                    print('\t*dst++ = (GLfloat) *src++;')
     43                  print('\t*dst = (GLfloat) *src;')
     44                print('}\n')
    4445
    4546scale = {
     
    5455}
    5556
    56 for k in gltypes.keys():
     57for k in sorted(gltypes.keys()):
    5758        if k != 'f' and k != 'd' and k != 'l':
    5859                if k[0:1] == "N":
     
    6162                        k2 = k
    6263                for i in range(1,5):
    63                         print 'static void __convert_rescale_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k2]['type'])
     64                        print('static void __convert_rescale_%s%d (GLfloat *dst, const %s *src) {' % (k,i,gltypes[k2]['type']))
    6465                        for j in range(i-1):
    65                                 print '\t*dst++ = ((GLfloat) *src++) / %s;' % scale[k2]
    66                         print '\t*dst = ((GLfloat) *src) / %s;' % scale[k2]
    67                         print '}\n'
     66                                print('\t*dst++ = ((GLfloat) *src++) / %s;' % scale[k2])
     67                        print('\t*dst = ((GLfloat) *src) / %s;' % scale[k2])
     68                        print('}\n')
    6869
    69 print '''
     70print('''
    7071
    7172static void __convert_boolean (GLboolean *dst, const GLboolean *src) {
    7273        *dst = *src;
    7374}
    74 '''
     75''')
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