VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/error/error.py@ 66940

最後變更 在這個檔案從66940是 63942,由 vboxsync 提交於 8 年 前

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

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.2 KB
 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6
7from __future__ import print_function
8import sys
9
10import apiutil
11
12apiutil.CopyrightC()
13
14
15print("""#include <stdio.h>
16#include "cr_error.h"
17#include "cr_spu.h"
18#include "state/cr_statetypes.h"
19
20#if defined(WINDOWS)
21#define ERROR_APIENTRY __stdcall
22#else
23#define ERROR_APIENTRY
24#endif
25
26#define ERROR_UNUSED(x) ((void)x)""")
27
28
29keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
30
31for func_name in keys:
32 return_type = apiutil.ReturnType(func_name)
33 params = apiutil.Parameters(func_name)
34 print('\nstatic %s ERROR_APIENTRY error%s(%s)' % (return_type, func_name, apiutil.MakeDeclarationString(params )))
35 print('{')
36 # Handle the void parameter list
37 for (name, type, vecSize) in params:
38 print('\tERROR_UNUSED(%s);' % name)
39 print('\tcrError("ERROR SPU: Unsupported function gl%s called!");' % func_name)
40 if return_type != "void":
41 print('\treturn (%s)0;' % return_type)
42 print('}')
43
44print('SPUNamedFunctionTable _cr_error_table[] = {')
45for index in range(len(keys)):
46 func_name = keys[index]
47 print('\t{ "%s", (SPUGenericFunction) error%s },' % (func_name, func_name ))
48print('\t{ NULL, NULL }')
49print('};')
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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