Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
e19353be
Commit
e19353be
authored
Dec 18, 2018
by
dearblue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix macro expressions with paren
parent
14133f40
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
include/mruby/boxing_word.h
include/mruby/boxing_word.h
+2
-2
include/mruby/class.h
include/mruby/class.h
+1
-1
include/mruby/proc.h
include/mruby/proc.h
+5
-5
No files found.
include/mruby/boxing_word.h
View file @
e19353be
...
@@ -129,9 +129,9 @@ mrb_type(mrb_value o)
...
@@ -129,9 +129,9 @@ mrb_type(mrb_value o)
} while (0)
} while (0)
#ifndef MRB_WITHOUT_FLOAT
#ifndef MRB_WITHOUT_FLOAT
#define SET_FLOAT_VALUE(mrb,r,v) (
r) = mrb_word_boxing_float_value(mrb, v
)
#define SET_FLOAT_VALUE(mrb,r,v) (
(r) = mrb_word_boxing_float_value(mrb, v)
)
#endif
#endif
#define SET_CPTR_VALUE(mrb,r,v) (
r) = mrb_word_boxing_cptr_value(mrb, v
)
#define SET_CPTR_VALUE(mrb,r,v) (
(r) = mrb_word_boxing_cptr_value(mrb, v)
)
#define SET_NIL_VALUE(r) BOXWORD_SET_VALUE(r, MRB_TT_FALSE, value.i, 0)
#define SET_NIL_VALUE(r) BOXWORD_SET_VALUE(r, MRB_TT_FALSE, value.i, 0)
#define SET_FALSE_VALUE(r) BOXWORD_SET_VALUE(r, MRB_TT_FALSE, value.i, 1)
#define SET_FALSE_VALUE(r) BOXWORD_SET_VALUE(r, MRB_TT_FALSE, value.i, 1)
#define SET_TRUE_VALUE(r) BOXWORD_SET_VALUE(r, MRB_TT_TRUE, value.i, 1)
#define SET_TRUE_VALUE(r) BOXWORD_SET_VALUE(r, MRB_TT_TRUE, value.i, 1)
...
...
include/mruby/class.h
View file @
e19353be
...
@@ -70,7 +70,7 @@ mrb_class(mrb_state *mrb, mrb_value v)
...
@@ -70,7 +70,7 @@ mrb_class(mrb_state *mrb, mrb_value v)
} while (0)
} while (0)
#define MRB_FL_CLASS_IS_INHERITED (1 << 17)
#define MRB_FL_CLASS_IS_INHERITED (1 << 17)
#define MRB_INSTANCE_TT_MASK (0xFF)
#define MRB_INSTANCE_TT_MASK (0xFF)
#define MRB_SET_INSTANCE_TT(c, tt) (
c)->flags = (((c)->flags & ~MRB_INSTANCE_TT_MASK) | (char)(tt
))
#define MRB_SET_INSTANCE_TT(c, tt) (
(c)->flags = (((c)->flags & ~MRB_INSTANCE_TT_MASK) | (char)(tt)
))
#define MRB_INSTANCE_TT(c) (enum mrb_vtype)((c)->flags & MRB_INSTANCE_TT_MASK)
#define MRB_INSTANCE_TT(c) (enum mrb_vtype)((c)->flags & MRB_INSTANCE_TT_MASK)
MRB_API
struct
RClass
*
mrb_define_class_id
(
mrb_state
*
,
mrb_sym
,
struct
RClass
*
);
MRB_API
struct
RClass
*
mrb_define_class_id
(
mrb_state
*
,
mrb_sym
,
struct
RClass
*
);
...
...
include/mruby/proc.h
View file @
e19353be
...
@@ -23,13 +23,13 @@ struct REnv {
...
@@ -23,13 +23,13 @@ struct REnv {
};
};
/* flags (21bits): 1(shared flag):10(cioff/bidx):10(stack_len) */
/* flags (21bits): 1(shared flag):10(cioff/bidx):10(stack_len) */
#define MRB_ENV_SET_STACK_LEN(e,len) (
e)->flags = (((e)->flags & ~0x3ff)|((unsigned int)(len) & 0x3ff
))
#define MRB_ENV_SET_STACK_LEN(e,len) (
(e)->flags = (((e)->flags & ~0x3ff)|((unsigned int)(len) & 0x3ff)
))
#define MRB_ENV_STACK_LEN(e) ((mrb_int)((e)->flags & 0x3ff))
#define MRB_ENV_STACK_LEN(e) ((mrb_int)((e)->flags & 0x3ff))
#define MRB_ENV_STACK_UNSHARED (1<<20)
#define MRB_ENV_STACK_UNSHARED (1<<20)
#define MRB_ENV_UNSHARE_STACK(e) (
e)->flags |= MRB_ENV_STACK_UNSHARED
#define MRB_ENV_UNSHARE_STACK(e) (
(e)->flags |= MRB_ENV_STACK_UNSHARED)
#define MRB_ENV_STACK_SHARED_P(e) (((e)->flags & MRB_ENV_STACK_UNSHARED) == 0)
#define MRB_ENV_STACK_SHARED_P(e) (((e)->flags & MRB_ENV_STACK_UNSHARED) == 0)
#define MRB_ENV_BIDX(e) (((e)->flags >> 10) & 0x3ff)
#define MRB_ENV_BIDX(e) (((e)->flags >> 10) & 0x3ff)
#define MRB_ENV_SET_BIDX(e,idx) (
e)->flags = (((e)->flags & ~(0x3ff<<10))|((unsigned int)(idx) & 0x3ff)<<10
)
#define MRB_ENV_SET_BIDX(e,idx) (
(e)->flags = (((e)->flags & ~(0x3ff<<10))|((unsigned int)(idx) & 0x3ff)<<10)
)
void
mrb_env_unshare
(
mrb_state
*
,
struct
REnv
*
);
void
mrb_env_unshare
(
mrb_state
*
,
struct
REnv
*
);
...
@@ -101,8 +101,8 @@ MRB_API mrb_value mrb_proc_cfunc_env_get(mrb_state*, mrb_int);
...
@@ -101,8 +101,8 @@ MRB_API mrb_value mrb_proc_cfunc_env_get(mrb_state*, mrb_int);
#define MRB_METHOD_FUNC_FL ((uintptr_t)1)
#define MRB_METHOD_FUNC_FL ((uintptr_t)1)
#define MRB_METHOD_FUNC_P(m) (((uintptr_t)(m))&MRB_METHOD_FUNC_FL)
#define MRB_METHOD_FUNC_P(m) (((uintptr_t)(m))&MRB_METHOD_FUNC_FL)
#define MRB_METHOD_FUNC(m) ((mrb_func_t)((uintptr_t)(m)&(~MRB_METHOD_FUNC_FL)))
#define MRB_METHOD_FUNC(m) ((mrb_func_t)((uintptr_t)(m)&(~MRB_METHOD_FUNC_FL)))
#define MRB_METHOD_FROM_FUNC(m,fn) (
m)=(mrb_method_t)((struct RProc*)((uintptr_t)(fn)|MRB_METHOD_FUNC_FL
))
#define MRB_METHOD_FROM_FUNC(m,fn) (
(m)=(mrb_method_t)((struct RProc*)((uintptr_t)(fn)|MRB_METHOD_FUNC_FL)
))
#define MRB_METHOD_FROM_PROC(m,pr) (
m)=(mrb_method_t)(struct RProc*)(pr
)
#define MRB_METHOD_FROM_PROC(m,pr) (
(m)=(mrb_method_t)(struct RProc*)(pr)
)
#define MRB_METHOD_PROC_P(m) (!MRB_METHOD_FUNC_P(m))
#define MRB_METHOD_PROC_P(m) (!MRB_METHOD_FUNC_P(m))
#define MRB_METHOD_PROC(m) ((struct RProc*)(m))
#define MRB_METHOD_PROC(m) ((struct RProc*)(m))
#define MRB_METHOD_UNDEF_P(m) ((m)==0)
#define MRB_METHOD_UNDEF_P(m) ((m)==0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment