diff --git a/src/Timer.h b/src/Timer.h index 5eb0aadec8..a251e5a183 100644 --- a/src/Timer.h +++ b/src/Timer.h @@ -12,7 +12,7 @@ extern "C" { } // If you add a timer here, adjust TimerNames in Timer.cc. -enum TimerType { +enum TimerType : uint8_t { TIMER_BACKDOOR, TIMER_BREAKPOINT, TIMER_CONN_DELETE, @@ -51,8 +51,7 @@ class ODesc; class Timer : public PQ_Element { public: - Timer(double t, TimerType arg_type) : PQ_Element(t) - { type = (char) arg_type; } + Timer(double t, TimerType arg_type) : PQ_Element(t), type(arg_type) { } ~Timer() override { } TimerType Type() const { return (TimerType) type; } @@ -66,8 +65,7 @@ public: protected: Timer() {} - - unsigned int type:8; + TimerType type; }; class TimerMgr { diff --git a/src/analyzer/protocol/netbios/NetbiosSSN.h b/src/analyzer/protocol/netbios/NetbiosSSN.h index e38b7b223b..7a6c1fab8f 100644 --- a/src/analyzer/protocol/netbios/NetbiosSSN.h +++ b/src/analyzer/protocol/netbios/NetbiosSSN.h @@ -32,9 +32,9 @@ typedef enum { struct NetbiosSSN_RawMsgHdr { NetbiosSSN_RawMsgHdr(const u_char*& data, int& len); - unsigned int type:8; - unsigned int flags:8; - unsigned int length:16; + uint8_t type; + uint8_t flags; + uint16_t length; }; // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -51,13 +51,13 @@ struct NetbiosSSN_RawMsgHdr { struct NetbiosDGM_RawMsgHdr { NetbiosDGM_RawMsgHdr(const u_char*& data, int& len); - unsigned int type:8; - unsigned int flags:8; - unsigned int id:16; - unsigned int srcip:32; - unsigned int srcport:16; - unsigned int length:16; - unsigned int offset:16; + uint8_t type; + uint8_t flags; + uint16_t id; + uint32_t srcip; + uint16_t srcport; + uint16_t length; + uint16_t offset; };