VirtualBox

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

最後變更 在這個檔案從53480是 37392,由 vboxsync 提交於 14 年 前

OpenGL/error/error.py: moved ERROR_UNUSED to the top of the function to prevent dozens of warnigs about dead code in Fortify

  • 屬性 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
7import sys
8
9import apiutil
10
11apiutil.CopyrightC()
12
13
14print """#include <stdio.h>
15#include "cr_error.h"
16#include "cr_spu.h"
17#include "state/cr_statetypes.h"
18
19#if defined(WINDOWS)
20#define ERROR_APIENTRY __stdcall
21#else
22#define ERROR_APIENTRY
23#endif
24
25#define ERROR_UNUSED(x) ((void)x)"""
26
27
28keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
29
30for func_name in keys:
31 return_type = apiutil.ReturnType(func_name)
32 params = apiutil.Parameters(func_name)
33 print '\nstatic %s ERROR_APIENTRY error%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params ))
34 print '{'
35 # Handle the void parameter list
36 for (name, type, vecSize) in params:
37 print '\tERROR_UNUSED(%s);' % name
38 print '\tcrError( "ERROR SPU: Unsupported function gl%s called!" );' % func_name
39 if return_type != "void":
40 print '\treturn (%s)0;' % return_type
41 print '}'
42
43print 'SPUNamedFunctionTable _cr_error_table[] = {'
44for index in range(len(keys)):
45 func_name = keys[index]
46 print '\t{ "%s", (SPUGenericFunction) error%s },' % (func_name, func_name )
47print '\t{ NULL, NULL }'
48print '};'
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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