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
3de0a625
Commit
3de0a625
authored
Jun 27, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
resolve conflict in class.c
parents
0a88499f
50f38a7d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
22 deletions
+22
-22
src/class.c
src/class.c
+2
-2
src/codegen.c
src/codegen.c
+2
-2
src/error.c
src/error.c
+3
-3
src/parse.y
src/parse.y
+11
-11
src/time.c
src/time.c
+1
-1
src/vm.c
src/vm.c
+3
-3
No files found.
src/class.c
View file @
3de0a625
...
...
@@ -1149,11 +1149,11 @@ mrb_mod_to_s(mrb_state *mrb, mrb_value klass)
switch
(
mrb_type
(
klass
))
{
case
MRB_TT_CLASS
:
n
=
snprintf
(
buf
,
256
,
"#<Class:%p>"
,
c
);
n
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"#<Class:%p>"
,
c
);
break
;
case
MRB_TT_MODULE
:
n
=
snprintf
(
buf
,
256
,
"#<Module:%p>"
,
c
);
n
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"#<Module:%p>"
,
c
);
break
;
default:
...
...
src/codegen.c
View file @
3de0a625
...
...
@@ -1537,7 +1537,7 @@ codegen(codegen_scope *s, node *tree, int val)
int
len
;
int
sym
;
len
=
snprintf
(
buf
,
3
,
"$%c"
,
(
int
)(
intptr_t
)
tree
);
len
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"$%c"
,
(
int
)(
intptr_t
)
tree
);
sym
=
new_sym
(
s
,
mrb_intern2
(
s
->
mrb
,
buf
,
len
));
genop
(
s
,
MKOP_ABx
(
OP_GETGLOBAL
,
cursp
(),
sym
));
push
();
...
...
@@ -1550,7 +1550,7 @@ codegen(codegen_scope *s, node *tree, int val)
int
len
;
int
sym
;
len
=
snprintf
(
buf
,
3
,
"$%d"
,
(
int
)(
intptr_t
)
tree
);
len
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"$%d"
,
(
int
)(
intptr_t
)
tree
);
sym
=
new_sym
(
s
,
mrb_intern2
(
s
->
mrb
,
buf
,
len
));
genop
(
s
,
MKOP_ABx
(
OP_GETGLOBAL
,
cursp
(),
sym
));
push
();
...
...
src/error.c
View file @
3de0a625
...
...
@@ -180,7 +180,7 @@ mrb_raise(mrb_state *mrb, struct RClass *c, const char *fmt, ...)
int
n
;
va_start
(
args
,
fmt
);
n
=
vsnprintf
(
buf
,
256
,
fmt
,
args
);
n
=
vsnprintf
(
buf
,
sizeof
(
buf
)
,
fmt
,
args
);
va_end
(
args
);
if
(
n
<
0
)
{
n
=
0
;
...
...
@@ -197,7 +197,7 @@ mrb_name_error(mrb_state *mrb, mrb_sym id, const char *fmt, ...)
int
n
;
va_start
(
args
,
fmt
);
n
=
vsnprintf
(
buf
,
256
,
fmt
,
args
);
n
=
vsnprintf
(
buf
,
sizeof
(
buf
)
,
fmt
,
args
);
va_end
(
args
);
if
(
n
<
0
)
{
n
=
0
;
...
...
@@ -216,7 +216,7 @@ mrb_sprintf(mrb_state *mrb, const char *fmt, ...)
int
n
;
va_start
(
args
,
fmt
);
n
=
vsnprintf
(
buf
,
256
,
fmt
,
args
);
n
=
vsnprintf
(
buf
,
sizeof
(
buf
)
,
fmt
,
args
);
va_end
(
args
);
if
(
n
<
0
)
{
n
=
0
;
...
...
src/parse.y
View file @
3de0a625
...
...
@@ -2587,7 +2587,7 @@ var_ref : variable
{
char buf[16];
snprintf(buf,
16
, "%d", p->lineno);
snprintf(buf,
sizeof(buf)
, "%d", p->lineno);
$$ = new_int(p, buf, 10);
}
;
...
...
@@ -2955,7 +2955,7 @@ yyerror_i(parser_state *p, const char *fmt, int i)
{
char buf[256];
snprintf(buf,
256
, fmt, i);
snprintf(buf,
sizeof(buf)
, fmt, i);
yyerror(p, buf);
}
...
...
@@ -2995,7 +2995,7 @@ yywarning_s(parser_state *p, const char *fmt, const char *s)
{
char buf[256];
snprintf(buf,
256
, fmt, s);
snprintf(buf,
sizeof(buf)
, fmt, s);
yywarning(p, buf);
}
...
...
@@ -3201,9 +3201,9 @@ toklen(parser_state *p)
#define IS_LABEL_SUFFIX(n) (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
static unsigned long
scan_oct(const
char
*start, int len, int *retlen)
scan_oct(const
int
*start, int len, int *retlen)
{
const
char
*s = start;
const
int
*s = start;
unsigned long retval = 0;
while (len-- && *s >= '0' && *s <= '7') {
...
...
@@ -3215,10 +3215,10 @@ scan_oct(const char *start, int len, int *retlen)
}
static unsigned long
scan_hex(const
char
*start, int len, int *retlen)
scan_hex(const
int
*start, int len, int *retlen)
{
static const char hexdigit[] = "0123456789abcdef0123456789ABCDEF";
register const
char
*s = start;
register const
int
*s = start;
register unsigned long retval = 0;
char *tmp;
...
...
@@ -3264,7 +3264,7 @@ read_escape(parser_state *p)
case '0': case '1': case '2': case '3': /* octal constant */
case '4': case '5': case '6': case '7':
{
char
buf[3];
int
buf[3];
int i;
for (i=0; i<3; i++) {
...
...
@@ -3281,7 +3281,7 @@ read_escape(parser_state *p)
case 'x': /* hex constant */
{
char
buf[2];
int
buf[2];
int i;
for (i=0; i<2; i++) {
...
...
@@ -3702,7 +3702,7 @@ parser_yylex(parser_state *p)
}
if (c2) {
char buf[256];
snprintf(buf,
256
, "invalid character syntax; use ?\\%c", c2);
snprintf(buf,
sizeof(buf)
, "invalid character syntax; use ?\\%c", c2);
yyerror(p, buf);
}
}
...
...
@@ -4542,7 +4542,7 @@ parser_yylex(parser_state *p)
pushback(p, c);
}
}
if (result == 0 && isupper(tok(p)[0])) {
if (result == 0 && isupper(
(int)
tok(p)[0])) {
result = tCONSTANT;
}
else {
...
...
src/time.c
View file @
3de0a625
...
...
@@ -435,7 +435,7 @@ mrb_time_asctime(mrb_state *mrb, mrb_value self)
tm
=
mrb_get_datatype
(
mrb
,
self
,
&
mrb_time_type
);
if
(
!
tm
)
return
mrb_nil_value
();
d
=
&
tm
->
datetime
;
len
=
snprintf
(
buf
,
256
,
"%s %s %02d %02d:%02d:%02d %s%d"
,
len
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"%s %s %02d %02d:%02d:%02d %s%d"
,
wday_names
[
d
->
tm_wday
],
mon_names
[
d
->
tm_mon
],
d
->
tm_mday
,
d
->
tm_hour
,
d
->
tm_min
,
d
->
tm_sec
,
tm
->
timezone
==
MRB_TIMEZONE_UTC
?
"UTC "
:
""
,
...
...
src/vm.c
View file @
3de0a625
...
...
@@ -295,7 +295,7 @@ localjump_error(mrb_state *mrb, const char *kind)
int
len
;
mrb_value
exc
;
len
=
snprintf
(
buf
,
256
,
"unexpected %s"
,
kind
);
len
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"unexpected %s"
,
kind
);
exc
=
mrb_exc_new
(
mrb
,
E_LOCALJUMP_ERROR
,
buf
,
len
);
mrb
->
exc
=
(
struct
RObject
*
)
mrb_object
(
exc
);
}
...
...
@@ -308,12 +308,12 @@ argnum_error(mrb_state *mrb, int num)
mrb_value
exc
;
if
(
mrb
->
ci
->
mid
)
{
len
=
snprintf
(
buf
,
256
,
"'%s': wrong number of arguments (%d for %d)"
,
len
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"'%s': wrong number of arguments (%d for %d)"
,
mrb_sym2name
(
mrb
,
mrb
->
ci
->
mid
),
mrb
->
ci
->
argc
,
num
);
}
else
{
len
=
snprintf
(
buf
,
256
,
"wrong number of arguments (%d for %d)"
,
len
=
snprintf
(
buf
,
sizeof
(
buf
)
,
"wrong number of arguments (%d for %d)"
,
mrb
->
ci
->
argc
,
num
);
}
exc
=
mrb_exc_new
(
mrb
,
E_ARGUMENT_ERROR
,
buf
,
len
);
...
...
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