Skip to content

Commit 4e1ee7a

Browse files
author
Dave Bartolomeo
committed
C++/C#: Fix formatting
1 parent 7d48220 commit 4e1ee7a

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

cpp/ql/src/semmle/code/cpp/ir/internal/IntegerConstant.qll

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,9 @@ string bitsToBytesAndBits(IntValue bits) {
204204
hasValue(bits) and
205205
bytes = bits / 8 and
206206
leftoverBits = bits % 8 and
207-
if leftoverBits = 0 then
208-
result = bytes.toString()
209-
else
210-
result = bytes + ":" + leftoverBits
211-
) or
207+
if leftoverBits = 0 then result = bytes.toString() else result = bytes + ":" + leftoverBits
208+
)
209+
or
212210
not hasValue(bits) and result = "?"
213211
}
214212

@@ -217,11 +215,10 @@ string bitsToBytesAndBits(IntValue bits) {
217215
*/
218216
bindingset[bitOffset]
219217
string getBitOffsetString(IntValue bitOffset) {
220-
if hasValue(bitOffset) then
221-
if bitOffset >= 0 then
222-
result = "+" + bitsToBytesAndBits(bitOffset)
223-
else
224-
result = "-" + bitsToBytesAndBits(neg(bitOffset))
225-
else
226-
result = "+?"
218+
if hasValue(bitOffset)
219+
then
220+
if bitOffset >= 0
221+
then result = "+" + bitsToBytesAndBits(bitOffset)
222+
else result = "-" + bitsToBytesAndBits(neg(bitOffset))
223+
else result = "+?"
227224
}

csharp/ql/src/semmle/code/csharp/ir/internal/IntegerConstant.qll

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,9 @@ string bitsToBytesAndBits(IntValue bits) {
204204
hasValue(bits) and
205205
bytes = bits / 8 and
206206
leftoverBits = bits % 8 and
207-
if leftoverBits = 0 then
208-
result = bytes.toString()
209-
else
210-
result = bytes + ":" + leftoverBits
211-
) or
207+
if leftoverBits = 0 then result = bytes.toString() else result = bytes + ":" + leftoverBits
208+
)
209+
or
212210
not hasValue(bits) and result = "?"
213211
}
214212

@@ -217,11 +215,10 @@ string bitsToBytesAndBits(IntValue bits) {
217215
*/
218216
bindingset[bitOffset]
219217
string getBitOffsetString(IntValue bitOffset) {
220-
if hasValue(bitOffset) then
221-
if bitOffset >= 0 then
222-
result = "+" + bitsToBytesAndBits(bitOffset)
223-
else
224-
result = "-" + bitsToBytesAndBits(neg(bitOffset))
225-
else
226-
result = "+?"
218+
if hasValue(bitOffset)
219+
then
220+
if bitOffset >= 0
221+
then result = "+" + bitsToBytesAndBits(bitOffset)
222+
else result = "-" + bitsToBytesAndBits(neg(bitOffset))
223+
else result = "+?"
227224
}

0 commit comments

Comments
 (0)