root/src/VM/cil/cilVMILPool.cpp

Revision 195, 2.0 kB (checked in by hak, 1 year ago)

Ver.0.91.0.137
- Added OSX/GCC support!
- Can compile in XCode 3.1/GCC 4.0.1 & Visual Studio 2005.
- Runs in OSX 10.5.4 & Windows XP/Vista
- Number::toString support a radix.
- BRFALSE bug fix
- Minor code clean up

Line 
1 /****************************************************************************
2  *
3  * CRI Middleware SDK
4  *
5  * Copyright (c) 2008 CRI Middleware, Inc. All rights reserved.
6  *
7  * Use, modification and distribution are subject to the CRI Script Software
8  * License, Version 1.0(see accompanying file "CriScript_License_1_0.txt" or
9  * copy at www.criscript.com/trac/wiki/CRI%20Script%20Software%20License%201.0 ).
10  *
11  *
12  * Library  : CRIScript
13  * Module   : cil Virtual Machine
14  * File     : CCilVmILPool.cpp
15  * Date     :
16  * Version  :
17  *
18  ****************************************************************************/
19
20 /***************************************************************************
21  *      Include file
22  ***************************************************************************/
23 #include "stdafx.h"
24 #include "cilVm.h"
25 namespace cri {
26 /***************************************************************************
27  *      Variables
28  ***************************************************************************/
29
30 /***************************************************************************
31  *      Methods
32  ***************************************************************************/
33
34 /***************************************************************************
35  *      Initialize string pool
36  ***************************************************************************/
37 bool CCilVm::setILPool( const vector<uint8_t> & vecIL)
38 {
39         if( m_status != VM_EXECUTE_INITIALIZING ) return false;
40
41         ILFRAGMENTINFO ilInfo;
42         ilInfo.ILPool = vecIL;
43         m_CurrentILPool = ilInfo;
44
45         m_pCurrentInstruction = &m_CurrentILPool.ILPool[ 0 ];
46
47         return true;
48 }
49
50 bool CCilVm::setILPool( const uint8_t* pILPool, const size_t size )
51 {
52         if( m_status != VM_EXECUTE_INITIALIZING ) return false;
53        
54         ILFRAGMENTINFO ilInfo;
55         m_CurrentILPool = ilInfo;
56        
57         for( uint32_t i = 0; i < size; ++i )
58                 m_CurrentILPool.ILPool.push_back( *pILPool++ );
59        
60         m_pCurrentInstruction = &m_CurrentILPool.ILPool[ 0 ];
61        
62         return true;
63 }
64
65 } //namespace CRI
Note: See TracBrowser for help on using the browser.