Skip to content

Commit

Permalink
Don't include all of the standard namespace. (libmythtv/mheg)
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 990c37b commit d4bef56
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/mheg/dsmcc.cpp
Expand Up @@ -68,7 +68,7 @@ ObjCarousel *Dsmcc::AddTap(unsigned short componentTag, unsigned carouselId)
}

// Add this only if it's not already there.
vector<unsigned short>::iterator it;
std::vector<unsigned short>::iterator it;
for (it = car->m_Tags.begin(); it != car->m_Tags.end(); ++it)
{
if (*it == componentTag)
Expand Down Expand Up @@ -457,7 +457,7 @@ void Dsmcc::ProcessSection(const unsigned char *data, int length,
for (auto *car : m_carousels)
{
// Is the component tag one of the ones we know?
vector<unsigned short>::iterator it2;
std::vector<unsigned short>::iterator it2;
for (it2 = car->m_Tags.begin(); it2 != car->m_Tags.end(); ++it2)
{
if (*it2 == componentTag)
Expand Down
5 changes: 2 additions & 3 deletions mythtv/libs/libmythtv/mheg/dsmccobjcarousel.h
Expand Up @@ -7,7 +7,6 @@

#include <list>
#include <vector>
using namespace std;

class DsmccDii;
class Dsmcc;
Expand Down Expand Up @@ -54,7 +53,7 @@ class DSMCCCacheModuleData
unsigned long m_receivedData {0}; ///< Size received so far.

/// Block table. As blocks are received they are added to this table.
vector<QByteArray*> m_blocks;
std::vector<QByteArray*> m_blocks;
/// True if we have completed this module.
bool m_completed {false};
ModuleDescriptorData m_descriptorData;
Expand All @@ -71,7 +70,7 @@ class ObjCarousel
DSMCCCache m_fileCache;
std::list<DSMCCCacheModuleData*> m_Cache;
/// Component tags matched to this carousel.
vector<unsigned short> m_Tags;
std::vector<unsigned short> m_Tags;
unsigned long m_id {0};
};

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mheg/mhi.cpp
Expand Up @@ -645,7 +645,7 @@ void MHIContext::Reinit(const QRect &videoRect, const QRect &dispRect, float asp
enum { kNone, kHoriz, kBoth };
int mode = gCoreContext->GetNumSetting("MhegAspectCorrection", kNone);
auto const aspectd = static_cast<double>(aspect);
double const vz = (mode == kBoth) ? min(1.15, 1. / sqrt(aspectd)) : 1.;
double const vz = (mode == kBoth) ? std::min(1.15, 1. / sqrt(aspectd)) : 1.;
double const hz = (mode > kNone) ? vz * aspectd : 1.;

m_displayRect = QRect( int(dispRect.width() * (1 - hz) / 2),
Expand Down
5 changes: 2 additions & 3 deletions mythtv/libs/libmythtv/mheg/mhi.h
Expand Up @@ -8,7 +8,6 @@
// STL headers
#include <list>
#include <vector>
using namespace std;

// Qt headers
#include <QWaitCondition>
Expand Down Expand Up @@ -200,7 +199,7 @@ class MHIContext : public MHContext, public QRunnable
QMutex m_displayLock;
bool m_updated {false};

list<MHIImageData*> m_display; // List of items to display
std::list<MHIImageData*> m_display; // List of items to display

FT_Face m_face {nullptr};
bool m_faceLoaded {false};
Expand All @@ -217,7 +216,7 @@ class MHIContext : public MHContext, public QRunnable
QList<int> m_tuneInfo;

uint m_lastNbiVersion {NBI_VERSION_UNSET};
vector<unsigned char> m_nbiData;
std::vector<unsigned char> m_nbiData;

QRect m_videoRect, m_videoDisplayRect;
QRect m_displayRect;
Expand Down

0 comments on commit d4bef56

Please sign in to comment.