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