C++/C#: Fix formatting

This commit is contained in:
Dave Bartolomeo
2019-11-26 10:48:24 -07:00
parent 7d48220a76
commit 4e1ee7a998
2 changed files with 18 additions and 24 deletions

View File

@@ -204,11 +204,9 @@ string bitsToBytesAndBits(IntValue bits) {
hasValue(bits) and
bytes = bits / 8 and
leftoverBits = bits % 8 and
if leftoverBits = 0 then
result = bytes.toString()
else
result = bytes + ":" + leftoverBits
) or
if leftoverBits = 0 then result = bytes.toString() else result = bytes + ":" + leftoverBits
)
or
not hasValue(bits) and result = "?"
}
@@ -217,11 +215,10 @@ string bitsToBytesAndBits(IntValue bits) {
*/
bindingset[bitOffset]
string getBitOffsetString(IntValue bitOffset) {
if hasValue(bitOffset) then
if bitOffset >= 0 then
result = "+" + bitsToBytesAndBits(bitOffset)
else
result = "-" + bitsToBytesAndBits(neg(bitOffset))
else
result = "+?"
if hasValue(bitOffset)
then
if bitOffset >= 0
then result = "+" + bitsToBytesAndBits(bitOffset)
else result = "-" + bitsToBytesAndBits(neg(bitOffset))
else result = "+?"
}

View File

@@ -204,11 +204,9 @@ string bitsToBytesAndBits(IntValue bits) {
hasValue(bits) and
bytes = bits / 8 and
leftoverBits = bits % 8 and
if leftoverBits = 0 then
result = bytes.toString()
else
result = bytes + ":" + leftoverBits
) or
if leftoverBits = 0 then result = bytes.toString() else result = bytes + ":" + leftoverBits
)
or
not hasValue(bits) and result = "?"
}
@@ -217,11 +215,10 @@ string bitsToBytesAndBits(IntValue bits) {
*/
bindingset[bitOffset]
string getBitOffsetString(IntValue bitOffset) {
if hasValue(bitOffset) then
if bitOffset >= 0 then
result = "+" + bitsToBytesAndBits(bitOffset)
else
result = "-" + bitsToBytesAndBits(neg(bitOffset))
else
result = "+?"
if hasValue(bitOffset)
then
if bitOffset >= 0
then result = "+" + bitsToBytesAndBits(bitOffset)
else result = "-" + bitsToBytesAndBits(neg(bitOffset))
else result = "+?"
}