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
f1fa5bf1
Commit
f1fa5bf1
authored
Aug 28, 2017
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove integer type mismatch warnings from parse.y.
parent
15d48efa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
include/mruby/compile.h
include/mruby/compile.h
+3
-3
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+16
-16
No files found.
include/mruby/compile.h
View file @
f1fa5bf1
...
@@ -175,7 +175,7 @@ MRB_API char const* mrb_parser_get_filename(struct mrb_parser_state*, uint16_t i
...
@@ -175,7 +175,7 @@ MRB_API char const* mrb_parser_get_filename(struct mrb_parser_state*, uint16_t i
MRB_API
struct
mrb_parser_state
*
mrb_parse_file
(
mrb_state
*
,
FILE
*
,
mrbc_context
*
);
MRB_API
struct
mrb_parser_state
*
mrb_parse_file
(
mrb_state
*
,
FILE
*
,
mrbc_context
*
);
#endif
#endif
MRB_API
struct
mrb_parser_state
*
mrb_parse_string
(
mrb_state
*
,
const
char
*
,
mrbc_context
*
);
MRB_API
struct
mrb_parser_state
*
mrb_parse_string
(
mrb_state
*
,
const
char
*
,
mrbc_context
*
);
MRB_API
struct
mrb_parser_state
*
mrb_parse_nstring
(
mrb_state
*
,
const
char
*
,
in
t
,
mrbc_context
*
);
MRB_API
struct
mrb_parser_state
*
mrb_parse_nstring
(
mrb_state
*
,
const
char
*
,
size_
t
,
mrbc_context
*
);
MRB_API
struct
RProc
*
mrb_generate_code
(
mrb_state
*
,
struct
mrb_parser_state
*
);
MRB_API
struct
RProc
*
mrb_generate_code
(
mrb_state
*
,
struct
mrb_parser_state
*
);
MRB_API
mrb_value
mrb_load_exec
(
mrb_state
*
mrb
,
struct
mrb_parser_state
*
p
,
mrbc_context
*
c
);
MRB_API
mrb_value
mrb_load_exec
(
mrb_state
*
mrb
,
struct
mrb_parser_state
*
p
,
mrbc_context
*
c
);
...
@@ -185,9 +185,9 @@ MRB_API mrb_value mrb_load_file(mrb_state*,FILE*);
...
@@ -185,9 +185,9 @@ MRB_API mrb_value mrb_load_file(mrb_state*,FILE*);
MRB_API
mrb_value
mrb_load_file_cxt
(
mrb_state
*
,
FILE
*
,
mrbc_context
*
cxt
);
MRB_API
mrb_value
mrb_load_file_cxt
(
mrb_state
*
,
FILE
*
,
mrbc_context
*
cxt
);
#endif
#endif
MRB_API
mrb_value
mrb_load_string
(
mrb_state
*
mrb
,
const
char
*
s
);
MRB_API
mrb_value
mrb_load_string
(
mrb_state
*
mrb
,
const
char
*
s
);
MRB_API
mrb_value
mrb_load_nstring
(
mrb_state
*
mrb
,
const
char
*
s
,
in
t
len
);
MRB_API
mrb_value
mrb_load_nstring
(
mrb_state
*
mrb
,
const
char
*
s
,
size_
t
len
);
MRB_API
mrb_value
mrb_load_string_cxt
(
mrb_state
*
mrb
,
const
char
*
s
,
mrbc_context
*
cxt
);
MRB_API
mrb_value
mrb_load_string_cxt
(
mrb_state
*
mrb
,
const
char
*
s
,
mrbc_context
*
cxt
);
MRB_API
mrb_value
mrb_load_nstring_cxt
(
mrb_state
*
mrb
,
const
char
*
s
,
in
t
len
,
mrbc_context
*
cxt
);
MRB_API
mrb_value
mrb_load_nstring_cxt
(
mrb_state
*
mrb
,
const
char
*
s
,
size_
t
len
,
mrbc_context
*
cxt
);
/** @} */
/** @} */
MRB_END_DECL
MRB_END_DECL
...
...
mrbgems/mruby-compiler/core/parse.y
View file @
f1fa5bf1
...
@@ -749,7 +749,7 @@ new_float(parser_state *p, const char *s)
...
@@ -749,7 +749,7 @@ new_float(parser_state *p, const char *s)
/* (:str . (s . len)) */
/* (:str . (s . len)) */
static node*
static node*
new_str(parser_state *p, const char *s,
in
t len)
new_str(parser_state *p, const char *s,
size_
t len)
{
{
return cons((node*)NODE_STR, cons((node*)strndup(s, len), nint(len)));
return cons((node*)NODE_STR, cons((node*)strndup(s, len), nint(len)));
}
}
...
@@ -3361,7 +3361,7 @@ static void
...
@@ -3361,7 +3361,7 @@ static void
yyerror(parser_state *p, const char *s)
yyerror(parser_state *p, const char *s)
{
{
char* c;
char* c;
in
t n;
size_
t n;
if (! p->capture_errors) {
if (! p->capture_errors) {
#ifndef MRB_DISABLE_STDIO
#ifndef MRB_DISABLE_STDIO
...
@@ -3397,7 +3397,7 @@ static void
...
@@ -3397,7 +3397,7 @@ static void
yywarn(parser_state *p, const char *s)
yywarn(parser_state *p, const char *s)
{
{
char* c;
char* c;
in
t n;
size_
t n;
if (! p->capture_errors) {
if (! p->capture_errors) {
#ifndef MRB_DISABLE_STDIO
#ifndef MRB_DISABLE_STDIO
...
@@ -3593,7 +3593,7 @@ peek_n(parser_state *p, int c, int n)
...
@@ -3593,7 +3593,7 @@ peek_n(parser_state *p, int c, int n)
static mrb_bool
static mrb_bool
peeks(parser_state *p, const char *s)
peeks(parser_state *p, const char *s)
{
{
in
t len = strlen(s);
size_
t len = strlen(s);
#ifndef MRB_DISABLE_STDIO
#ifndef MRB_DISABLE_STDIO
if (p->f) {
if (p->f) {
...
@@ -3629,7 +3629,7 @@ skips(parser_state *p, const char *s)
...
@@ -3629,7 +3629,7 @@ skips(parser_state *p, const char *s)
}
}
s++;
s++;
if (peeks(p, s)) {
if (peeks(p, s)) {
in
t len = strlen(s);
size_
t len = strlen(s);
while (len--) {
while (len--) {
if (nextc(p) == '\n') {
if (nextc(p) == '\n') {
...
@@ -3762,7 +3762,7 @@ scan_oct(const int *start, int len, int *retlen)
...
@@ -3762,7 +3762,7 @@ scan_oct(const int *start, int len, int *retlen)
retval <<= 3;
retval <<= 3;
retval |= *s++ - '0';
retval |= *s++ - '0';
}
}
*retlen =
s - start
;
*retlen =
(int)(s - start)
;
return retval;
return retval;
}
}
...
@@ -3781,7 +3781,7 @@ scan_hex(parser_state *p, const int *start, int len, int *retlen)
...
@@ -3781,7 +3781,7 @@ scan_hex(parser_state *p, const int *start, int len, int *retlen)
retval |= (tmp - hexdigit) & 15;
retval |= (tmp - hexdigit) & 15;
s++;
s++;
}
}
*retlen =
s - start
;
*retlen =
(int)(s - start)
;
return (int32_t)retval;
return (int32_t)retval;
}
}
...
@@ -3958,9 +3958,9 @@ parse_string(parser_state *p)
...
@@ -3958,9 +3958,9 @@ parse_string(parser_state *p)
{
{
int c;
int c;
string_type type = (string_type)(intptr_t)p->lex_strterm->car;
string_type type = (string_type)(intptr_t)p->lex_strterm->car;
int nest_level =
(intptr_t)p->lex_strterm->cdr->car
;
int nest_level =
intn(p->lex_strterm->cdr->car)
;
int beg =
(intptr_t)p->lex_strterm->cdr->cdr->car
;
int beg =
intn(p->lex_strterm->cdr->cdr->car)
;
int end =
(intptr_t)p->lex_strterm->cdr->cdr->cdr
;
int end =
intn(p->lex_strterm->cdr->cdr->cdr)
;
parser_heredoc_info *hinf = (type & STR_FUNC_HEREDOC) ? parsing_heredoc_inf(p) : NULL;
parser_heredoc_info *hinf = (type & STR_FUNC_HEREDOC) ? parsing_heredoc_inf(p) : NULL;
int cmd_state = p->cmd_start;
int cmd_state = p->cmd_start;
...
@@ -5672,7 +5672,7 @@ MRB_API const char*
...
@@ -5672,7 +5672,7 @@ MRB_API const char*
mrbc_filename(mrb_state *mrb, mrbc_context *c, const char *s)
mrbc_filename(mrb_state *mrb, mrbc_context *c, const char *s)
{
{
if (s) {
if (s) {
in
t len = strlen(s);
size_
t len = strlen(s);
char *p = (char *)mrb_malloc(mrb, len + 1);
char *p = (char *)mrb_malloc(mrb, len + 1);
memcpy(p, s, len + 1);
memcpy(p, s, len + 1);
...
@@ -5704,12 +5704,12 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
...
@@ -5704,12 +5704,12 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
for (i = 0; i < p->filename_table_length; ++i) {
for (i = 0; i < p->filename_table_length; ++i) {
if (p->filename_table[i] == sym) {
if (p->filename_table[i] == sym) {
p->current_filename_index = i;
p->current_filename_index =
(int)
i;
return;
return;
}
}
}
}
p->current_filename_index = p->filename_table_length++;
p->current_filename_index =
(int)
p->filename_table_length++;
new_table = (mrb_sym*)parser_palloc(p, sizeof(mrb_sym) * p->filename_table_length);
new_table = (mrb_sym*)parser_palloc(p, sizeof(mrb_sym) * p->filename_table_length);
if (p->filename_table) {
if (p->filename_table) {
...
@@ -5744,7 +5744,7 @@ mrb_parse_file(mrb_state *mrb, FILE *f, mrbc_context *c)
...
@@ -5744,7 +5744,7 @@ mrb_parse_file(mrb_state *mrb, FILE *f, mrbc_context *c)
#endif
#endif
MRB_API parser_state*
MRB_API parser_state*
mrb_parse_nstring(mrb_state *mrb, const char *s,
in
t len, mrbc_context *c)
mrb_parse_nstring(mrb_state *mrb, const char *s,
size_
t len, mrbc_context *c)
{
{
parser_state *p;
parser_state *p;
...
@@ -5839,13 +5839,13 @@ mrb_load_file(mrb_state *mrb, FILE *f)
...
@@ -5839,13 +5839,13 @@ mrb_load_file(mrb_state *mrb, FILE *f)
#endif
#endif
MRB_API mrb_value
MRB_API mrb_value
mrb_load_nstring_cxt(mrb_state *mrb, const char *s,
in
t len, mrbc_context *c)
mrb_load_nstring_cxt(mrb_state *mrb, const char *s,
size_
t len, mrbc_context *c)
{
{
return mrb_load_exec(mrb, mrb_parse_nstring(mrb, s, len, c), c);
return mrb_load_exec(mrb, mrb_parse_nstring(mrb, s, len, c), c);
}
}
MRB_API mrb_value
MRB_API mrb_value
mrb_load_nstring(mrb_state *mrb, const char *s,
in
t len)
mrb_load_nstring(mrb_state *mrb, const char *s,
size_
t len)
{
{
return mrb_load_nstring_cxt(mrb, s, len, NULL);
return mrb_load_nstring_cxt(mrb, s, len, NULL);
}
}
...
...
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