Skip to content

Commit

Permalink
Fixed node class and std.os.device constant definitions for newer ver…
Browse files Browse the repository at this point in the history
…sions of GCC .
  • Loading branch information
evilsocket committed May 31, 2010
1 parent 2db906c commit ebc71e6
Show file tree
Hide file tree
Showing 16 changed files with 290 additions and 287 deletions.
49 changes: 25 additions & 24 deletions include/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,28 @@ class Node;
class NodeValue {
public :

Object *m_constant;
string m_identifier;
int m_expression;
int m_statement;
Node *m_switch;
Node *m_default;
string m_function;
bool m_vargs;
access_t m_access;
bool m_static;
string m_method;
string m_call;
size_t m_argc;
Node *m_alias_call;
Node *m_owner;
Node *m_member;

Node *m_try_block;
Node *m_exp_id;
Node *m_catch_block;
Node *m_finally_block;
Object *constant;
string identifier;
int opcode;
Node *switch_block;
Node *default_block;
string function;
bool vargs;
access_t access;
bool is_static;
string method;
string call;
size_t argc;
Node *alias;
Node *owner;
Node *member;

Node *try_block;
string exception_id;
Node *catch_block;
Node *finally_block;

llist_t extends;

NodeValue();
~NodeValue();
Expand Down Expand Up @@ -144,7 +145,7 @@ public :
}

INLINE char *id(){
return (char *)value.m_identifier.c_str();
return (char *)value.identifier.c_str();
}

INLINE Node *body(){
Expand Down Expand Up @@ -248,7 +249,7 @@ class CallNode : public Node {
class TryCatchNode : public Node {
public :

TryCatchNode( size_t lineno, int statement, Node *try_block, Node *exp_id, Node *catch_block, Node *finally_block );
TryCatchNode( size_t lineno, int statement, Node *try_block, char *exception_id, Node *catch_block, Node *finally_block );

Node *clone();
};
Expand Down Expand Up @@ -282,7 +283,7 @@ class MethodDeclarationNode : public Node {
/* class type definition */
class ClassNode : public Node {
public :
llist_t m_extends;

ClassNode( size_t lineno, char *classname, llist_t *extends, llist_t *members );
};

Expand Down
2 changes: 1 addition & 1 deletion include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ typedef Object * (*ob_call_method_function_t) ( vm_t *, vframe_t *, Object *, ch
/*
* Object type codes enumeration.
* otEndMarker is used to mark the last allowed type in
* vm_function_t::types.
* vfunction_t::types.
*/
enum H_OBJECT_TYPE {
otEndMarker = -1,
Expand Down
18 changes: 9 additions & 9 deletions include/vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ using std::map;
/*
* Macro to define module exported functions structure.
*/
#define HYBRIS_EXPORTED_FUNCTIONS() extern "C" vm_function_t hybris_module_functions[] =
#define HYBRIS_EXPORTED_FUNCTIONS() extern "C" vfunction_t hybris_module_functions[] =
/*
* Macro to easily access hybris functions parameters.
*/
#define vm_argv(i) ((*data)[i])
/*
* Macro to easily access hybris functions parameters number.
*/
#define vm_argc() (data->size())
#define vargc() (data->size())
/*
* Pre declaration of structure vm_t.
*/
Expand All @@ -95,7 +95,7 @@ typedef void (*initializer_t)( vm_t * );
*/
typedef Object * (*function_t)( vm_t *, vmem_t * );

typedef struct _vm_function_t {
typedef struct _vfunction_t {
/*
* Function identifier.
*/
Expand All @@ -113,7 +113,7 @@ typedef struct _vm_function_t {
*/
H_OBJECT_TYPE types[HMAXARGS][20];
}
vm_function_t;
vfunction_t;

/*
* Split 'str' into 'tokens' vector using 'delimiters'.
Expand Down Expand Up @@ -150,7 +150,7 @@ typedef struct vm_module {
vm_module_t;

typedef llist_t vm_modules_t;
typedef ITree<vm_function_t> vm_mcache_t;
typedef ITree<vfunction_t> vm_mcache_t;
typedef ITree<pcre> vm_pcache_t;
typedef llist_t vm_scope_t;
typedef map< pthread_t, vm_scope_t *> vm_thread_scope_t;
Expand Down Expand Up @@ -427,9 +427,9 @@ INLINE void vm_timer( vm_t *vm, int start = 0 ){
* loaded module and return its pointer.
* Handle function pointer caching.
*/
INLINE vm_function_t *vm_get_function( vm_t *vm, char *identifier ){
INLINE vfunction_t *vm_get_function( vm_t *vm, char *identifier ){
vm_module_t *module;
vm_function_t *function;
vfunction_t *function;

/*
* First check if it's already cached.
Expand All @@ -446,7 +446,7 @@ INLINE vm_function_t *vm_get_function( vm_t *vm, char *identifier ){
* For each function of the module.
*/
ll_foreach( &module->functions, f_item ){
function = ll_data( vm_function_t *, f_item );
function = ll_data( vfunction_t *, f_item );
/*
* Found it, add to the cache and return.
*/
Expand Down Expand Up @@ -568,7 +568,7 @@ void vm_prepare_stack( vm_t *vm, vframe_t &stack, string owner, vector<string
void vm_prepare_stack( vm_t *vm, vframe_t *root, vframe_t &stack, string owner, vector<string> ids, Node *argv );
void vm_prepare_stack( vm_t *vm, vframe_t *root, vframe_t &stack, string owner, Extern *fn_pointer, Node *argv );
void vm_prepare_stack( vm_t *vm, vframe_t *root, vframe_t &stack, string owner, Node *argv );
void vm_prepare_stack( vm_t *vm, vframe_t *root, vm_function_t *function, vframe_t &stack, string owner, Node *argv );
void vm_prepare_stack( vm_t *vm, vframe_t *root, vfunction_t *function, vframe_t &stack, string owner, Node *argv );
void vm_prepare_stack( vm_t *vm, vframe_t *root, Node *function, vframe_t &stack, string owner, Node *argv );
void vm_dismiss_stack( vm_t *vm );
/*
Expand Down
Loading

0 comments on commit ebc71e6

Please sign in to comment.