Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-ref2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mu
mu-impl-ref2
Commits
6d42793c
Commit
6d42793c
authored
Jun 04, 2017
by
Kunshan Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MuCString is now const char*
And apparently no Scala code is changed.
parent
286db316
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
muapi.h
cbinding/muapi.h
+1
-1
muapiparser.py
migrate_scripts/muapiparser.py
+2
-2
ncs_tests.c
tests/c-snippets/ncs_tests.c
+4
-4
No files found.
cbinding/muapi.h
View file @
6d42793c
...
...
@@ -83,7 +83,7 @@ typedef MuGenRefValue MuIBRefValue; // irbuilderref
// Mu IR. If you want to build IR using this C API, use MuCtx->new_ir_builder.
// C-style '\0'-terminated string
typedef
char
*
MuCString
;
typedef
c
onst
c
har
*
MuCString
;
// Identifiers and names of Mu
typedef
uint32_t
MuID
;
...
...
migrate_scripts/muapiparser.py
View file @
6d42793c
...
...
@@ -15,7 +15,7 @@ r_param = re.compile(r'\s*(?P<type>\w+\s*\*?)\s*(?P<name>\w+)')
r_define
=
re
.
compile
(
r'^\s*#define\s+(?P<name>\w+)\s*\(\((?P<type>\w+)\)(?P<value>\w+)\)\s*'
+
rfrag_commpragma
+
r'\s*$'
,
re
.
MULTILINE
)
r_typedef
=
re
.
compile
(
r'^\s*typedef\s+(?P<expand_to>\w+\s*\*?)\s*(?P<name>\w+)\s*;'
,
re
.
MULTILINE
)
r_typedef
=
re
.
compile
(
r'^\s*typedef\s+(?P<
const>const\s+)?(?P<
expand_to>\w+\s*\*?)\s*(?P<name>\w+)\s*;'
,
re
.
MULTILINE
)
r_struct_start
=
re
.
compile
(
r'^struct\s+(\w+)\s*\{'
)
r_struct_end
=
re
.
compile
(
r'^\};'
)
...
...
@@ -141,7 +141,7 @@ def extract_typedefs(text):
typedefs
=
{}
typedefs_order
=
[]
for
m
in
r_typedef
.
finditer
(
text
):
expand_to
,
name
=
m
.
groups
()
const_qualifier
,
expand_to
,
name
=
m
.
groups
()
expand_to
=
expand_to
.
replace
(
" "
,
""
)
typedefs
[
name
]
=
expand_to
typedefs_order
.
append
((
name
,
expand_to
))
...
...
tests/c-snippets/ncs_tests.c
View file @
6d42793c
...
...
@@ -22,7 +22,7 @@
#define muprintf(fmt, ...) printf("[C:%d:%s] " fmt, __LINE__, __func__, ## __VA_ARGS__)
bool
test_basic
(
MuVM
*
mvm
,
int
theID
,
char
*
theName
)
{
bool
test_basic
(
MuVM
*
mvm
,
int
theID
,
c
onst
c
har
*
theName
)
{
muprintf
(
"header: %p
\n
"
,
mvm
->
header
);
muprintf
(
"new_context: %p
\n
"
,
mvm
->
new_context
);
muprintf
(
"id_of: %p
\n
"
,
mvm
->
id_of
);
...
...
@@ -36,7 +36,7 @@ bool test_basic(MuVM *mvm, int theID, char *theName) {
return
false
;
}
char
*
name
=
mvm
->
name_of
(
mvm
,
theID
);
c
onst
c
har
*
name
=
mvm
->
name_of
(
mvm
,
theID
);
muprintf
(
"name = %s
\n
"
,
name
);
if
(
strcmp
(
name
,
theName
)
!=
0
)
{
muprintf
(
"name %s is not equal to %s
\n
"
,
name
,
theName
);
...
...
@@ -46,7 +46,7 @@ bool test_basic(MuVM *mvm, int theID, char *theName) {
return
true
;
}
bool
test_with_ctx
(
MuVM
*
mvm
,
int
theID
,
char
*
theName
)
{
bool
test_with_ctx
(
MuVM
*
mvm
,
int
theID
,
c
onst
c
har
*
theName
)
{
MuCtx
*
ctx
=
mvm
->
new_context
(
mvm
);
int
id
=
ctx
->
id_of
(
ctx
,
theName
);
...
...
@@ -56,7 +56,7 @@ bool test_with_ctx(MuVM *mvm, int theID, char *theName) {
return
false
;
}
char
*
name
=
ctx
->
name_of
(
ctx
,
theID
);
c
onst
c
har
*
name
=
ctx
->
name_of
(
ctx
,
theID
);
muprintf
(
"name = %s
\n
"
,
name
);
if
(
strcmp
(
name
,
theName
)
!=
0
)
{
muprintf
(
"name %s is not equal to %s
\n
"
,
name
,
theName
);
...
...
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