VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/spu_loader/spucopy.py@ 68057

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

Build/scripts (bugref:6627): Python build scripts updated to generate the same code when used with Python 2 and 3.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.6 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
6from __future__ import print_function
7import sys
8import apiutil
9
10
11apiutil.CopyrightC()
12
13print("""
14
15/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY spucopy.py SCRIPT */
16
17#include "cr_spu.h"
18#include "cr_mem.h"
19
20void crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src )
21{
22""")
23
24keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
25for func_name in keys:
26 print('\tdst->%s = src->%s;' % (func_name, func_name))
27
28# if the destination is already a copy of something, we'd better make sure
29# that we take it off its source's copy list first.
30
31print("""
32 if (dst->copy_of != NULL)
33 {
34 /*
35 * dst was already a copy, go back to the original,
36 * and remove dst from the original's copyList.
37 */
38 struct _copy_list_node *temp, *prior = NULL;
39 for (temp = dst->copy_of->copyList; temp; prior = temp, temp = temp->next)
40 {
41 if (temp->copy == dst)
42 {
43 if (prior)
44 {
45 prior->next = temp->next;
46 }
47 else
48 {
49 dst->copy_of->copyList = temp->next;
50 }
51 crFree( temp );
52 break;
53 }
54 }
55 }
56 /*
57 * Now that dst->copy_of is unused, set it to point to our
58 * new original.
59 */
60 if (src->copy_of)
61 {
62 dst->copy_of = src->copy_of;
63 }
64 else
65 {
66 dst->copy_of = src;
67 }
68 /*
69 * Create a new copy node, so the src can keep track of the
70 * new copy (i.e. dst).
71 */
72 {
73 struct _copy_list_node *copynode;
74 copynode = (struct _copy_list_node*)crAlloc( sizeof( *copynode ) );
75 copynode->copy = dst;
76 copynode->next = src->copyList;
77 src->copyList = copynode;
78 }
79}
80""")
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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