structmemberalign: simplify API
This commit is contained in:
parent
c92c58037b
commit
7d23654c16
@ -1244,7 +1244,7 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
function suite.structMemberAlignment()
|
function suite.structMemberAlignment()
|
||||||
structmemberalign "1Byte"
|
structmemberalign(1)
|
||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
@ -1347,8 +1347,17 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
function m.structMemberAlignment(cfg)
|
function m.structMemberAlignment(cfg)
|
||||||
if cfg.structmemberalign then
|
local map = {
|
||||||
m.element("StructMemberAlignment", nil, cfg.structmemberalign)
|
[1] = "1Byte",
|
||||||
|
[2] = "2Bytes",
|
||||||
|
[4] = "4Bytes",
|
||||||
|
[8] = "8Bytes",
|
||||||
|
[16] = "16Bytes"
|
||||||
|
}
|
||||||
|
|
||||||
|
local value = map[cfg.structmemberalign]
|
||||||
|
if value then
|
||||||
|
m.element("StructMemberAlignment", nil, value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1339,13 +1339,13 @@
|
|||||||
p.api.register {
|
p.api.register {
|
||||||
name = "structmemberalign",
|
name = "structmemberalign",
|
||||||
scope = "config",
|
scope = "config",
|
||||||
kind = "string",
|
kind = "integer",
|
||||||
allowed = {
|
allowed = {
|
||||||
"1Byte",
|
"1",
|
||||||
"2Bytes",
|
"2",
|
||||||
"4Bytes",
|
"4",
|
||||||
"8Bytes",
|
"8",
|
||||||
"16Bytes",
|
"16",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user