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
cca5e097
Commit
cca5e097
authored
Oct 30, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VS 2017 C does not understand inline struct initialization; ref #4153
parent
eebb5671
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
mrbgems/mruby-string-ext/src/string.c
mrbgems/mruby-string-ext/src/string.c
+5
-5
No files found.
mrbgems/mruby-string-ext/src/string.c
View file @
cca5e097
...
...
@@ -252,7 +252,7 @@ enum tr_pattern_type {
struct
tr_pattern
{
uint8_t
type
;
// 1:in-order, 2:range
mrb_bool
flag_reverse
:
1
;
mrb_bool
flag_on_
stack
:
1
;
mrb_bool
flag_on_
heap
:
1
;
uint16_t
n
;
union
{
uint16_t
start_pos
;
...
...
@@ -261,14 +261,14 @@ struct tr_pattern {
struct
tr_pattern
*
next
;
};
#define STATIC_TR_PATTERN {
TR_UNINITIALIZED, FALSE, TRUE, 0, {}, NULL
}
#define STATIC_TR_PATTERN {
0
}
static
inline
void
tr_free_pattern
(
mrb_state
*
mrb
,
struct
tr_pattern
*
pat
)
{
while
(
pat
)
{
struct
tr_pattern
*
p
=
pat
->
next
;
if
(
!
pat
->
flag_on_stack
)
{
if
(
pat
->
flag_on_heap
)
{
mrb_free
(
mrb
,
pat
);
}
pat
=
p
;
...
...
@@ -304,7 +304,7 @@ tr_parse_pattern(mrb_state *mrb, struct tr_pattern *ret, const mrb_value v_patte
}
pat1
->
type
=
TR_RANGE
;
pat1
->
flag_reverse
=
flag_reverse
;
pat1
->
flag_on_
stack
=
ret_uninit
;
pat1
->
flag_on_
heap
=
!
ret_uninit
;
pat1
->
n
=
pattern
[
i
+
2
]
-
pattern
[
i
]
+
1
;
pat1
->
next
=
NULL
;
pat1
->
val
.
ch
[
0
]
=
pattern
[
i
];
...
...
@@ -328,7 +328,7 @@ tr_parse_pattern(mrb_state *mrb, struct tr_pattern *ret, const mrb_value v_patte
}
pat1
->
type
=
TR_IN_ORDER
;
pat1
->
flag_reverse
=
flag_reverse
;
pat1
->
flag_on_
stack
=
ret_uninit
;
pat1
->
flag_on_
heap
=
!
ret_uninit
;
pat1
->
n
=
len
;
pat1
->
next
=
NULL
;
pat1
->
val
.
start_pos
=
start_pos
;
...
...
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