VirtualBox

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

Last change on this file since 58139 was 37392, checked in by vboxsync, 14 years ago

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

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.2 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
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 '};'
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