Skip to content

Commit

Permalink
changed: remove/comment some assigned but unused variables and relate…
Browse files Browse the repository at this point in the history
…d code

stops some gcc 4.5 bitchin'
  • Loading branch information
spiff committed Oct 14, 2011
1 parent a439fb5 commit 3b745f6
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 48 deletions.
6 changes: 2 additions & 4 deletions xbmc/Autorun.cpp
Expand Up @@ -145,21 +145,19 @@ bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAdded
{
bool bPlaying(false);
CFileItemList vecItems;
char szSlash = '\\';
if (strDrive.Find("iso9660") != -1) szSlash = '/';

if ( !pDir->GetDirectory( strDrive, vecItems ) )
{
return false;
}

bool bAllowVideo = true;
bool bAllowPictures = true;
// bool bAllowPictures = true;
bool bAllowMusic = true;
if (!g_passwordManager.IsMasterLockUnlocked(false))
{
bAllowVideo = !g_settings.GetCurrentProfile().videoLocked();
bAllowPictures = !g_settings.GetCurrentProfile().picturesLocked();
// bAllowPictures = !g_settings.GetCurrentProfile().picturesLocked();
bAllowMusic = !g_settings.GetCurrentProfile().musicLocked();
}

Expand Down
3 changes: 0 additions & 3 deletions xbmc/GUIPassword.cpp
Expand Up @@ -60,15 +60,12 @@ bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const CStdString &strType)
CStdString strLabel = pItem->GetLabel();
int iResult = 0; // init to user succeeded state, doing this to optimize switch statement below
char buffer[33]; // holds 32 places plus sign character
int iRetries = 0;
if(g_passwordManager.bMasterUser)// Check if we are the MasterUser!
{
iResult = 0;
}
else
{
if (!(1 > pItem->m_iBadPwdCount))
iRetries = g_guiSettings.GetInt("masterlock.maxretries") - pItem->m_iBadPwdCount;
if (0 != g_guiSettings.GetInt("masterlock.maxretries") && pItem->m_iBadPwdCount >= g_guiSettings.GetInt("masterlock.maxretries"))
{ // user previously exhausted all retries, show access denied error
CGUIDialogOK::ShowAndGetInput(12345, 12346, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
Expand Up @@ -75,7 +75,7 @@ bool CDVDDemuxVobsub::Open(const string& filename, const string& subfilename)
hints.codec = CODEC_ID_DVD_SUBTITLE;

char line[2048];
bool res;
bool __attribute__(unused) res;

SState state;
state.delay = 0;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDPlayer.cpp
Expand Up @@ -3840,7 +3840,7 @@ bool CDVDPlayer::GetStreamDetails(CStreamDetails &details)
if (m_pDemuxer)
{
bool result=CDVDFileInfo::DemuxerToStreamDetails(m_pInputStream, m_pDemuxer, details);
if (result && ((CStreamDetailVideo*)details.GetStreamCount(CStreamDetail::VIDEO) > 0)) // this is more correct (dvds in particular)
if (result && details.GetStreamCount(CStreamDetail::VIDEO) > 0) // this is more correct (dvds in particular)
{
GetVideoAspectRatio(((CStreamDetailVideo*)details.GetNthStream(CStreamDetail::VIDEO,0))->m_fAspect);
((CStreamDetailVideo*)details.GetNthStream(CStreamDetail::VIDEO,0))->m_iDuration = GetTotalTime();
Expand Down
8 changes: 4 additions & 4 deletions xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
Expand Up @@ -241,7 +241,7 @@ void CDVDTeletextData::Process()
unsigned char vtxt_row[42];
unsigned char pagedata[9][23*40];
unsigned char magazine = 0xff;
int doupdate = 0;
// int doupdate = 0;

CLog::Log(LOGNOTICE, "running thread: CDVDTeletextData");

Expand Down Expand Up @@ -367,8 +367,8 @@ void CDVDTeletextData::Process()
memset(m_TXTCache.astCachetable[m_TXTCache.CurrentPage[magazine]][m_TXTCache.CurrentSubPage[magazine]]->data, ' ', 23*40);
memset(pagedata[magazine],' ', 23*40);
}
if (dehamming[vtxt_row[9]] & 8) /* C8 -> update page */
doupdate = m_TXTCache.PageReceiving;
// if (dehamming[vtxt_row[9]] & 8) /* C8 -> update page */
// doupdate = m_TXTCache.PageReceiving;

pageinfo_thread->boxed = !!(dehamming[vtxt_row[7]] & 0x0c);

Expand Down Expand Up @@ -635,7 +635,7 @@ void CDVDTeletextData::Process()
{
SavePage(m_TXTCache.CurrentPage[magazine], m_TXTCache.CurrentSubPage[magazine], pagedata[magazine]);
m_TXTCache.PageUpdate = true;
doupdate = 0;
// doupdate = 0;
if (!m_TXTCache.ZapSubpageManual)
m_TXTCache.SubPage = m_TXTCache.CurrentSubPage[magazine];
}
Expand Down
5 changes: 3 additions & 2 deletions xbmc/filesystem/HTSPSession.cpp
Expand Up @@ -216,7 +216,8 @@ bool CHTSPSession::Connect(const std::string& hostname, int port)
char errbuf[1024];
int errlen = sizeof(errbuf);
htsmsg_t *m;
const char *method, *server, *version;
// const char *method;
const char *server, *version;
const void * chall = NULL;
size_t chall_len = 0;
int32_t proto = 0;
Expand Down Expand Up @@ -245,7 +246,7 @@ bool CHTSPSession::Connect(const std::string& hostname, int port)
CLog::Log(LOGERROR, "CHTSPSession::Open - failed to read greeting from server");
return false;
}
method = htsmsg_get_str(m, "method");
// method = htsmsg_get_str(m, "method");
htsmsg_get_s32(m, "htspversion", &proto);
server = htsmsg_get_str(m, "servername");
version = htsmsg_get_str(m, "serverversion");
Expand Down
24 changes: 12 additions & 12 deletions xbmc/filesystem/RTVDirectory.cpp
Expand Up @@ -157,10 +157,10 @@ bool CRTVDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items
if ( !strcmpi(strTagName.c_str(), "ITEM") )
{
const TiXmlNode *nameNode = pChild->FirstChild("DISPLAYNAME");
const TiXmlNode *qualityNode = pChild->FirstChild("QUALITY");
// const TiXmlNode *qualityNode = pChild->FirstChild("QUALITY");
const TiXmlNode *recordedNode = pChild->FirstChild("RECORDED");
const TiXmlNode *pathNode = pChild->FirstChild("PATH");
const TiXmlNode *durationNode = pChild->FirstChild("DURATION");
// const TiXmlNode *durationNode = pChild->FirstChild("DURATION");
const TiXmlNode *sizeNode = pChild->FirstChild("SIZE");
const TiXmlNode *atrbNode = pChild->FirstChild("ATTRIB");

Expand All @@ -182,11 +182,11 @@ bool CRTVDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items
}

// QUALITY
const char* szQuality = NULL;
if (qualityNode)
{
szQuality = qualityNode->FirstChild()->Value() ;
}
// const char* szQuality = NULL;
// if (qualityNode)
// {
// szQuality = qualityNode->FirstChild()->Value() ;
// }

// RECORDED
if (recordedNode)
Expand Down Expand Up @@ -224,11 +224,11 @@ bool CRTVDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items
}

// DURATION
const char* szDuration = NULL;
if (durationNode)
{
szDuration = durationNode->FirstChild()->Value() ;
}
// const char* szDuration = NULL;
// if (durationNode)
// {
// szDuration = durationNode->FirstChild()->Value() ;
// }

// SIZE
// NOTE: Size here is actually just duration in minutes because
Expand Down
4 changes: 2 additions & 2 deletions xbmc/input/SDLJoystick.cpp
Expand Up @@ -238,8 +238,8 @@ void CJoystick::Update(SDL_Event& joyEvent)
int buttonId = -1;
int axisId = -1;
int joyId = -1;
bool ignore = false; // not used for now
bool axis = false;
bool __attribute__(unused) ignore = false; // not used for now
bool __attribute__(unused) axis = false;

switch(joyEvent.type)
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/PerformanceSample.cpp
Expand Up @@ -96,7 +96,7 @@ double CPerformanceSample::GetEstimatedError()

for (int i=0; i<100000;i++)
{
int64_t tmDummy;
int64_t __attribute__(unused) tmDummy;
tmDummy = CurrentHostCounter();
}

Expand Down
12 changes: 4 additions & 8 deletions xbmc/utils/ssrc.cpp
Expand Up @@ -2846,7 +2846,7 @@ bool Cssrc::InitFilters(void)
if (UpSampling)
{
double aa = AA; // stop band attenuation(dB)
double lpf, delta, d, df, alp, iza;
double lpf, d, df, alp, iza;
double guard = 2;

frqgcd = gcd(sfrq, dfrq);
Expand All @@ -2862,7 +2862,6 @@ bool Cssrc::InitFilters(void)
df = (dfrq * osf / 2 - sfrq / 2) * 2 / guard;
lpf = sfrq / 2 + (dfrq * osf / 2 - sfrq / 2) / guard;

delta = pow(10.0, -aa / 20);
if (aa <= 21) d = 0.9222; else d = (aa - 7.95) / 14.36;

n1 = (int)(fs1 / df * d + 1);
Expand Down Expand Up @@ -2905,7 +2904,7 @@ bool Cssrc::InitFilters(void)
else
{
double aa = AA; // stop band attenuation(dB)
double lpf, delta, d, df, alp, iza;
double lpf, d, df, alp, iza;
int ipsize, wsize;

frqgcd = gcd(sfrq, dfrq);
Expand All @@ -2918,7 +2917,6 @@ bool Cssrc::InitFilters(void)

fs1 = sfrq * osf;

delta = pow(10.0, -aa / 20);
if (aa <= 21) d = 0.9222; else d = (aa - 7.95) / 14.36;

n1 = filter1len;
Expand Down Expand Up @@ -2961,10 +2959,9 @@ bool Cssrc::InitFilters(void)
if (UpSampling)
{
double aa = AA; // stop band attenuation(dB)
double lpf, delta, d, df, alp, iza;
double lpf, d, df, alp, iza;
int ipsize, wsize;

delta = pow(10.0, -aa / 20);
if (aa <= 21) d = 0.9222; else d = (aa - 7.95) / 14.36;

fs2 = dfrq * osf;
Expand Down Expand Up @@ -3020,15 +3017,14 @@ bool Cssrc::InitFilters(void)
else
{
double aa = AA; // stop band attenuation(dB)
double lpf, delta, d, df, alp, iza;
double lpf, d, df, alp, iza;
double guard = 2;

fs2 = sfrq / frqgcd * dfrq ;

df = (fs1 / 2 - sfrq / 2) * 2 / guard;
lpf = sfrq / 2 + (fs1 / 2 - sfrq / 2) / guard;

delta = pow(10.0, -aa / 20);
if (aa <= 21) d = 0.9222; else d = (aa - 7.95) / 14.36;

n2 = (int)(fs2 / df * d + 1);
Expand Down
2 changes: 0 additions & 2 deletions xbmc/windows/GUIMediaWindow.cpp
Expand Up @@ -966,7 +966,6 @@ bool CGUIMediaWindow::OnClick(int iItem)
bool do_not_add_karaoke = g_guiSettings.GetBool("karaoke.enabled") &&
g_guiSettings.GetBool("karaoke.autopopupselector") && pItem->IsKaraoke();
bool autoplay = m_guiState.get() && m_guiState->AutoPlayNextItem();
int iPlaylist = m_guiState.get()?m_guiState->GetPlaylist():PLAYLIST_MUSIC;

if (pItem->IsPlugin())
{
Expand All @@ -977,7 +976,6 @@ bool CGUIMediaWindow::OnClick(int iItem)
PluginPtr plugin = boost::dynamic_pointer_cast<CPluginSource>(addon);
if (plugin && plugin->Provides(CPluginSource::AUDIO) && pItem->IsAudio())
{
iPlaylist = PLAYLIST_MUSIC;
autoplay = g_guiSettings.GetBool("musicplayer.autoplaynextitem");
}
}
Expand Down
8 changes: 0 additions & 8 deletions xbmc/windows/GUIWindowLoginScreen.cpp
Expand Up @@ -204,14 +204,6 @@ void CGUIWindowLoginScreen::Update()
bool CGUIWindowLoginScreen::OnPopupMenu(int iItem)
{
if ( iItem < 0 || iItem >= m_vecItems->Size() ) return false;
// calculate our position
float posX = 200, posY = 100;
const CGUIControl *pList = GetControl(CONTROL_BIG_LIST);
if (pList)
{
posX = pList->GetXPosition() + pList->GetWidth() / 2;
posY = pList->GetYPosition() + pList->GetHeight() / 2;
}

bool bSelect = m_vecItems->Get(iItem)->IsSelected();
// mark the item
Expand Down

0 comments on commit 3b745f6

Please sign in to comment.