mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix clang-tidy bugprone-throw-keyword-missing warnings
This one renames the Modbus Exception binpac type to ExcResponse. clang-tidy insisted that anything named started with Exception was actually an exception and needed to be thrown.
This commit is contained in:
parent
2c2a595af5
commit
8bb015754a
3 changed files with 4 additions and 3 deletions
|
@ -14,4 +14,5 @@ Checks: [-*,
|
||||||
bugprone-suspicious-string-compare,
|
bugprone-suspicious-string-compare,
|
||||||
bugprone-suspicious-include,
|
bugprone-suspicious-include,
|
||||||
bugprone-suspicious-realloc-usage,
|
bugprone-suspicious-realloc-usage,
|
||||||
|
bugprone-throw-keyword-missing,
|
||||||
]
|
]
|
||||||
|
|
|
@ -114,7 +114,7 @@ refine flow ModbusTCP_Flow += {
|
||||||
%}
|
%}
|
||||||
|
|
||||||
# EXCEPTION
|
# EXCEPTION
|
||||||
function deliver_Exception(header: ModbusTCP_TransportHeader, message: Exception): bool
|
function deliver_Exception(header: ModbusTCP_TransportHeader, message: ModbusTCP_ExceptResponse): bool
|
||||||
%{
|
%{
|
||||||
if ( ::modbus_exception )
|
if ( ::modbus_exception )
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,7 +112,7 @@ type ModbusTCP_Request(header: ModbusTCP_TransportHeader) = case header.fc of {
|
||||||
#
|
#
|
||||||
type ModbusTCP_Response(header: ModbusTCP_TransportHeader) = case header.fc & 0x80 of {
|
type ModbusTCP_Response(header: ModbusTCP_TransportHeader) = case header.fc & 0x80 of {
|
||||||
0 -> normal_response : ModbusTCP_NormalResponse(header);
|
0 -> normal_response : ModbusTCP_NormalResponse(header);
|
||||||
default -> exception_response : Exception(header);
|
default -> exception_response : ModbusTCP_ExceptResponse(header);
|
||||||
};
|
};
|
||||||
|
|
||||||
type ModbusTCP_NormalResponse(header: ModbusTCP_TransportHeader) = case header.fc of {
|
type ModbusTCP_NormalResponse(header: ModbusTCP_TransportHeader) = case header.fc of {
|
||||||
|
@ -140,7 +140,7 @@ type ModbusTCP_NormalResponse(header: ModbusTCP_TransportHeader) = case header.f
|
||||||
default -> unknown: bytestring &restofdata;
|
default -> unknown: bytestring &restofdata;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Exception(header: ModbusTCP_TransportHeader) = record {
|
type ModbusTCP_ExceptResponse(header: ModbusTCP_TransportHeader) = record {
|
||||||
code: uint8;
|
code: uint8;
|
||||||
} &let {
|
} &let {
|
||||||
deliver: bool = $context.flow.deliver_Exception(header, this);
|
deliver: bool = $context.flow.deliver_Exception(header, this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue