VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/pack/pack.py@ 63942

Last change on this file since 63942 was 63942, checked in by vboxsync, 8 years ago

OpenGL: fixed the most annoying coding style flaws, mainly removing spaces after '(' and before ')', no semantic change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6from __future__ import print_function
7import sys
8
9import apiutil
10
11
12keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
13
14
15apiutil.CopyrightC()
16
17print("""
18/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY pack.py SCRIPT */
19#include <stdio.h>
20#include "cr_string.h"
21#include "cr_spu.h"
22#include "packspu.h"
23#include "cr_packfunctions.h"
24#include "packspu_proto.h"
25""")
26
27num_funcs = len(keys) - len(apiutil.AllSpecials('packspu_unimplemented'))
28print('SPUNamedFunctionTable _cr_pack_table[%d];' % (num_funcs+1))
29
30print("""
31static void __fillin(int offset, char *name, SPUGenericFunction func)
32{
33 _cr_pack_table[offset].name = crStrdup(name);
34 _cr_pack_table[offset].fn = func;
35}""")
36
37pack_specials = []
38
39for func_name in keys:
40 if ("get" in apiutil.Properties(func_name) or
41 apiutil.FindSpecial( "packspu", func_name ) or
42 apiutil.FindSpecial( "packspu_flush", func_name ) or
43 apiutil.FindSpecial( "packspu_vertex", func_name )):
44 pack_specials.append( func_name )
45
46print('\nvoid packspuCreateFunctions( void )')
47print('{')
48for index in range(len(keys)):
49 func_name = keys[index]
50 if apiutil.FindSpecial( "packspu_unimplemented", func_name ):
51 continue
52 if func_name in pack_specials:
53 print('\t__fillin(%3d, "%s", (SPUGenericFunction) packspu_%s);' % (index, func_name, func_name ))
54 else:
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('}')
Note: See TracBrowser for help on using the repository browser.

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