diff options
author | Robin Gareus <robin@gareus.org> | 2019-06-24 14:03:48 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-06-24 14:03:48 +0200 |
commit | d98bba43f173aa5e06c39f32c167ec207be41879 (patch) | |
tree | 79fdad4ee0290cf5275692e1116329a7f5a755e2 | |
parent | 6240b87cc8639d8402049fdccef2214286d6e0e3 (diff) |
Don't expose static methods that don't use members.
This is in preparation for making parsestring() a constant method
-rw-r--r-- | ptformat.cc | 20 | ||||
-rw-r--r-- | ptformat/ptformat.h | 5 |
2 files changed, 10 insertions, 15 deletions
diff --git a/ptformat.cc b/ptformat.cc index b6b13b7..0a29210 100644 --- a/ptformat.cc +++ b/ptformat.cc @@ -184,8 +184,8 @@ PTFFormat::get_content_description(uint16_t ctype) { } } -uint16_t -PTFFormat::u_endian_read2(unsigned char *buf, bool bigendian) +static uint16_t +u_endian_read2(unsigned char *buf, bool bigendian) { if (bigendian) { return ((uint16_t)(buf[0]) << 8) | (uint16_t)(buf[1]); @@ -194,8 +194,8 @@ PTFFormat::u_endian_read2(unsigned char *buf, bool bigendian) } } -uint32_t -PTFFormat::u_endian_read3(unsigned char *buf, bool bigendian) +static uint32_t +u_endian_read3(unsigned char *buf, bool bigendian) { if (bigendian) { return ((uint32_t)(buf[0]) << 16) | @@ -208,8 +208,8 @@ PTFFormat::u_endian_read3(unsigned char *buf, bool bigendian) } } -uint32_t -PTFFormat::u_endian_read4(unsigned char *buf, bool bigendian) +static uint32_t +u_endian_read4(unsigned char *buf, bool bigendian) { if (bigendian) { return ((uint32_t)(buf[0]) << 24) | @@ -224,8 +224,8 @@ PTFFormat::u_endian_read4(unsigned char *buf, bool bigendian) } } -uint64_t -PTFFormat::u_endian_read5(unsigned char *buf, bool bigendian) +static uint64_t +u_endian_read5(unsigned char *buf, bool bigendian) { if (bigendian) { return ((uint64_t)(buf[0]) << 32) | @@ -242,8 +242,8 @@ PTFFormat::u_endian_read5(unsigned char *buf, bool bigendian) } } -uint64_t -PTFFormat::u_endian_read8(unsigned char *buf, bool bigendian) +static uint64_t +u_endian_read8(unsigned char *buf, bool bigendian) { if (bigendian) { return ((uint64_t)(buf[0]) << 56) | diff --git a/ptformat/ptformat.h b/ptformat/ptformat.h index 43b4dc1..6fb6ceb 100644 --- a/ptformat/ptformat.h +++ b/ptformat/ptformat.h @@ -252,11 +252,6 @@ private: bool jumpto(uint32_t *currpos, unsigned char *buf, const uint32_t maxoffset, const unsigned char *needle, const uint32_t needlelen); bool foundin(std::string const& haystack, std::string const& needle); int64_t foundat(unsigned char *haystack, uint64_t n, const char *needle); - uint16_t u_endian_read2(unsigned char *buf, bool); - uint32_t u_endian_read3(unsigned char *buf, bool); - uint32_t u_endian_read4(unsigned char *buf, bool); - uint64_t u_endian_read5(unsigned char *buf, bool); - uint64_t u_endian_read8(unsigned char *buf, bool); char *parsestring(uint32_t pos); const std::string get_content_description(uint16_t ctype); |