updated appropriate functions to be marked as const

This commit is contained in:
favoritas37 2015-06-19 01:55:49 +03:00
parent 46f91f7a38
commit dbc47abff2
2 changed files with 4 additions and 3 deletions

View File

@ -34,8 +34,8 @@ private:
int characterCountBitsForVersions0To9_;
int characterCountBitsForVersions10To26_;
int characterCountBitsForVersions27AndHigher_;
std::string name_;
int bits_;
std::string name_;
Mode(int cbv0_9, int cbv10_26, int cbv27, int bits, char const* name);
@ -54,7 +54,7 @@ public:
static Mode HANZI;
static Mode& forBits(int bits);
int getCharacterCountBits(Version *version);
int getCharacterCountBits(const Version *version) const;
int getBits() const { return bits_; }
bool operator==(const Mode& other);

View File

@ -54,6 +54,7 @@ Mode::Mode(const zxing::qrcode::Mode &mode)
characterCountBitsForVersions0To9_ = mode.characterCountBitsForVersions0To9_;
characterCountBitsForVersions10To26_ = mode.characterCountBitsForVersions10To26_;
characterCountBitsForVersions27AndHigher_ = mode.characterCountBitsForVersions27AndHigher_;
bits_ = mode.bits_;
name_ = mode.name_;
}
@ -87,7 +88,7 @@ Mode& Mode::forBits(int bits) {
}
}
int Mode::getCharacterCountBits(Version *version)
int Mode::getCharacterCountBits(const Version *version) const
{
int number = version->getVersionNumber();
if (number <= 9) {