Skip to content

Commit

Permalink
Fix a couple of tidy/clazy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Apr 22, 2022
1 parent 3787583 commit 2138b64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythbase/stringutil.cpp
@@ -1,3 +1,4 @@
#include <array>
#include "stringutil.h"

#if __has_include(<bit>) // C++20
Expand All @@ -16,7 +17,7 @@ static int countl_one(unsigned char x)
if (x > 256)
return 8; // works for our purposes even if not correct
#endif
static constexpr int leading_ones[256] =
static constexpr std::array<int,256> leading_ones =
{
#define REPEAT_4(x) (x), (x), (x), (x)
#define REPEAT_8(x) REPEAT_4(x), REPEAT_4(x)
Expand All @@ -38,7 +39,7 @@ static int countl_one(unsigned char x)

bool StringUtil::isValidUTF8(const QByteArray& data)
{
const unsigned char* p = (const unsigned char*)data.data();
const auto* p = (const unsigned char*)data.data();
const unsigned char* const end = p + data.size();
while (p < end)
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/unzip2.cpp
Expand Up @@ -263,7 +263,7 @@ bool UnZip::zipWriteOneFile(const zipEntry& entry)
return true;
}

bool UnZip::extractFile(QString outDirName)
bool UnZip::extractFile(const QString& outDirName)
{
if (!isValid())
return false;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/unzip2.h
Expand Up @@ -44,7 +44,7 @@ class UnZip
public:
explicit UnZip(QString zipFile);
~UnZip();
bool extractFile(QString outDir);
bool extractFile(const QString& outDir);

private:
bool isValid() { return m_zip != nullptr; };
Expand Down

0 comments on commit 2138b64

Please sign in to comment.