X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/559d32bc2789dc69a7c19598a31f485c6caaff11..b2b89723a2427bba8290bd6967a1ab39cbb630be:/projects/stargazer/plugins/other/smux/types.h diff --git a/projects/stargazer/plugins/other/smux/types.h b/projects/stargazer/plugins/other/smux/types.h index a121bf7a..e7fcbeef 100644 --- a/projects/stargazer/plugins/other/smux/types.h +++ b/projects/stargazer/plugins/other/smux/types.h @@ -1,36 +1,39 @@ -#ifndef __TYPES_H__ -#define __TYPES_H__ +#pragma once + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" +#include "stg/OBJECT_IDENTIFIER.h" +#pragma GCC diagnostic pop #include #include -#include - -#include "stg/OBJECT_IDENTIFIER.h" +#include -class OID { +class OID +{ public: - OID(const std::string & str); + explicit OID(const std::string & str); OID(const char * str, size_t length); - OID(const std::vector & arcs); - OID(const unsigned * arcs, size_t length); - OID(OBJECT_IDENTIFIER_t * oid); + explicit OID(const std::vector & arcs); + OID(const uint32_t * arcs, size_t length); + explicit OID(OBJECT_IDENTIFIER_t * oid); OID(const OID & rvalue); ~OID(); bool addSuffix(const char * suffix, size_t length); bool addSuffix(const std::string & suffix); - bool addSuffix(const unsigned * suffix, size_t length); - bool addSuffix(const std::vector & suffix); - bool addSuffix(unsigned a, unsigned b); + bool addSuffix(const uint32_t * suffix, size_t length); + bool addSuffix(const std::vector & suffix); + bool addSuffix(uint32_t a, uint32_t b); OID copyWithSuffix(const char * suffix, size_t length) const; OID copyWithSuffix(const std::string & suffix) const; - OID copyWithSuffix(const unsigned * suffix, size_t length) const; - OID copyWithSuffix(const std::vector & suffix) const; - OID copyWithSuffix(unsigned a, unsigned b) const; + OID copyWithSuffix(const uint32_t * suffix, size_t length) const; + OID copyWithSuffix(const std::vector & suffix) const; + OID copyWithSuffix(uint32_t a, uint32_t b) const; std::string ToString() const; - const std::vector & ToVector() const { return arcs; } + const std::vector & ToVector() const { return arcs; } void ToOID(OBJECT_IDENTIFIER_t * oid) const; OID & operator=(const OID & rvalue); @@ -45,7 +48,7 @@ class OID { friend std::ostream & operator<<(std::ostream & stream, const OID & oid); private: - std::vector arcs; + std::vector arcs; }; inline @@ -53,5 +56,3 @@ bool PrefixLess(const OID & a, const OID & b) { return a.PrefixLess(b); } - -#endif