Skip to content

Commit

Permalink
Don't include all of the standard namespace. (libmythmetadata)
Browse files Browse the repository at this point in the history
Including all of the standard namespace is considered bad practice. It
defeats the purpose of namespaces, and pollutes the global name table.
  • Loading branch information
linuxdude42 committed Oct 2, 2020
1 parent f6bfd69 commit 83f9b0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions mythtv/libs/libmythmetadata/musicmetadata.cpp
Expand Up @@ -42,8 +42,6 @@
#include "musicutils.h"
#include "lyricsdata.h"

using namespace std;

static QString thePrefix = "the ";

bool operator==(MusicMetadata& a, MusicMetadata& b)
Expand Down Expand Up @@ -1591,10 +1589,10 @@ void AllMusic::resync()
int playCount = query.value(13).toInt();
qint64 lastPlay = query.value(14).toDateTime().toSecsSinceEpoch();

m_playCountMin = min(playCount, m_playCountMin);
m_playCountMax = max(playCount, m_playCountMax);
m_lastPlayMin = min(lastPlay, m_lastPlayMin);
m_lastPlayMax = max(lastPlay, m_lastPlayMax);
m_playCountMin = std::min(playCount, m_playCountMin);
m_playCountMax = std::max(playCount, m_playCountMax);
m_lastPlayMin = std::min(lastPlay, m_lastPlayMin);
m_lastPlayMax = std::max(lastPlay, m_lastPlayMax);
}
m_numLoaded++;
}
Expand Down
6 changes: 2 additions & 4 deletions mythtv/libs/libmythmetadata/videometadata.cpp
Expand Up @@ -21,8 +21,6 @@
#include "programinfo.h" // for format_season_and_episode
#include "mythsorthelper.h"

using namespace std;

class VideoMetadataImp
{
public:
Expand Down Expand Up @@ -559,7 +557,7 @@ void VideoMetadataImp::fromDBRow(MSqlQuery &query)
m_year = query.value(5).toInt();
m_releasedate = query.value(6).toDate();
m_userrating = (float)query.value(7).toDouble();
if (isnan(m_userrating) || m_userrating < 0)
if (std::isnan(m_userrating) || m_userrating < 0)
m_userrating = 0.0;
if (m_userrating > 10.0F)
m_userrating = 10.0F;
Expand Down Expand Up @@ -641,7 +639,7 @@ void VideoMetadataImp::saveToDatabase()
m_trailer = VIDEO_TRAILER_DEFAULT;
if (m_inetref.isEmpty())
m_inetref = VIDEO_INETREF_DEFAULT;
if (isnan(m_userrating))
if (std::isnan(m_userrating))
m_userrating = 0.0;
if (m_userrating < -10.0F || m_userrating > 10.0F)
m_userrating = 0.0;
Expand Down

0 comments on commit 83f9b0b

Please sign in to comment.