Tweaked C++ code for style and robustness.

This commit is contained in:
Project Nayuki 2018-02-26 20:21:23 +00:00
parent 015c243fb2
commit 18f9b7c6ce
3 changed files with 3 additions and 3 deletions

View File

@ -280,7 +280,7 @@ class QrCode final {
* Creates a Reed-Solomon ECC generator for the given degree. This could be implemented
* as a lookup table over all possible parameter values, instead of as an algorithm.
*/
public: ReedSolomonGenerator(int degree);
public: explicit ReedSolomonGenerator(int degree);
/*-- Method --*/

View File

@ -60,7 +60,7 @@ int main() {
for (int i = 0; i < length; i++) {
int b;
std::cin >> b;
data.push_back((uint8_t)b);
data.push_back(static_cast<uint8_t>(b));
isAscii &= 0 < b && b < 128;
}

View File

@ -147,7 +147,7 @@ class QrSegment final {
private: std::vector<bool> data;
/*---- Constructor ----*/
/*---- Constructors ----*/
/*
* Creates a new QR Code data segment with the given parameters and data.