Skip to content

Commit

Permalink
Remove 64-bit helper functions as Qt4 does it already
Browse files Browse the repository at this point in the history
Refs #6256

This has been languishing in the ticket for 2 years.  I have reapplied the
patch, and gotten rid of the new users of the helpers.  90+% of this is Isaac's
work, so he's getting the credit.

Still need to update bindings/mythweb and bump proto version

Signed-off-by: Gavin Hurlbut <ghurlbut@mythtv.org>
  • Loading branch information
Isaac Richards authored and Beirdo committed May 27, 2011
1 parent 1b1d0a9 commit 1508085
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 235 deletions.
5 changes: 2 additions & 3 deletions mythtv/libs/libmyth/remoteutil.cpp
Expand Up @@ -8,7 +8,6 @@
#include "remoteutil.h"
#include "programinfo.h"
#include "mythcorecontext.h"
#include "decodeencode.h"
#include "storagegroup.h"
#include "mythevent.h"

Expand Down Expand Up @@ -55,8 +54,8 @@ vector<FileSystemInfo> RemoteGetFreeSpace(void)
fsInfo.fsID = (*(it++)).toInt();
fsInfo.dirID = (*(it++)).toInt();
fsInfo.blocksize = (*(it++)).toInt();
fsInfo.totalSpaceKB = decodeLongLong(strlist, it);
fsInfo.usedSpaceKB = decodeLongLong(strlist, it);
fsInfo.totalSpaceKB = (*(it++)).toLongLong();
fsInfo.usedSpaceKB = (*(it++)).toLongLong();
fsInfos.push_back(fsInfo);
}
}
Expand Down
124 changes: 0 additions & 124 deletions mythtv/libs/libmythbase/decodeencode.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions mythtv/libs/libmythbase/decodeencode.h

This file was deleted.

4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/libmythbase.pro
Expand Up @@ -15,7 +15,7 @@ HEADERS += mythbaseexp.h mythdbcon.h mythdb.h mythdbparams.h oldsettings.h
HEADERS += mythverbose.h mythversion.h compat.h mythconfig.h
HEADERS += mythobservable.h mythevent.h httpcomms.h mcodecs.h
HEADERS += mythtimer.h mythsignalingtimer.h mythdirs.h exitcodes.h
HEADERS += lcddevice.h mythstorage.h remotefile.h decodeencode.h
HEADERS += lcddevice.h mythstorage.h remotefile.h
HEADERS += mythcorecontext.h mythsystem.h mythlocale.h storagegroup.h
HEADERS += mythcoreutil.h mythdownloadmanager.h mythtranslation.h
HEADERS += unzip.h unzip_p.h zipentry_p.h iso639.h iso3166.h mythmedia.h
Expand All @@ -27,7 +27,7 @@ SOURCES += mythsocket.cpp mythsocketthread.cpp msocketdevice.cpp
SOURCES += mythdbcon.cpp mythdb.cpp oldsettings.cpp mythverbose.cpp
SOURCES += mythobservable.cpp mythevent.cpp httpcomms.cpp mcodecs.cpp
SOURCES += mythdirs.cpp mythsignalingtimer.cpp
SOURCES += lcddevice.cpp mythstorage.cpp remotefile.cpp decodeencode.cpp
SOURCES += lcddevice.cpp mythstorage.cpp remotefile.cpp
SOURCES += mythcorecontext.cpp mythsystem.cpp mythlocale.cpp storagegroup.cpp
SOURCES += mythcoreutil.cpp mythdownloadmanager.cpp mythtranslation.cpp
SOURCES += unzip.cpp iso639.cpp iso3166.cpp mythmedia.cpp util.cpp
Expand Down
15 changes: 7 additions & 8 deletions mythtv/libs/libmythbase/remotefile.cpp
Expand Up @@ -6,7 +6,6 @@ using namespace std;
#include "mythconfig.h"
#include "mythdb.h"
#include "remotefile.h"
#include "decodeencode.h"
#include "mythcorecontext.h"
#include "mythsocket.h"
#include "compat.h"
Expand Down Expand Up @@ -128,15 +127,15 @@ MythSocket *RemoteFile::openSocket(bool control)
strlist.push_back("invalid response");
}

if (strlist.size() >= 4)
if (strlist.size() >= 3)
{
it = strlist.begin(); ++it;
recordernum = (*it).toInt(); ++it;
filesize = decodeLongLong(strlist, it);
filesize = (*(it)).toLongLong(); ++it;
for (; it != strlist.end(); ++it)
auxfiles << *it;
}
else if (0 < strlist.size() && strlist.size() < 4 &&
else if (0 < strlist.size() && strlist.size() < 3 &&
strlist[0] != "ERROR")
{
VERBOSE(VB_IMPORTANT, loc_err +
Expand Down Expand Up @@ -373,18 +372,18 @@ long long RemoteFile::Seek(long long pos, int whence, long long curpos)

QStringList strlist( QString(query).arg(recordernum) );
strlist << "SEEK";
encodeLongLong(strlist, pos);
strlist << QString::number(pos);
strlist << QString::number(whence);
if (curpos > 0)
encodeLongLong(strlist, curpos);
strlist << QString::number(curpos);
else
encodeLongLong(strlist, readposition);
strlist << QString::number(readposition);

controlSock->writeStringList(strlist);
controlSock->readStringList(strlist);
lock.unlock();

long long retval = decodeLongLong(strlist, 0);
long long retval = strlist[0].toLongLong();
readposition = retval;

Reset();
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -44,7 +44,6 @@ using namespace std;
#include "fifowriter.h"
#include "filtermanager.h"
#include "util.h"
#include "decodeencode.h"
#include "livetvchain.h"
#include "decoderbase.h"
#include "nuppeldecoder.h"
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythtv/previewgenerator.cpp
Expand Up @@ -28,7 +28,6 @@
#include "remotefile.h"
#include "storagegroup.h"
#include "util.h"
#include "decodeencode.h"
#include "playercontext.h"
#include "mythdirs.h"
#include "mythverbose.h"
Expand Down Expand Up @@ -341,7 +340,7 @@ bool PreviewGenerator::RemotePreviewRun(void)
strlist.push_back(token);
programInfo.ToStringList(strlist);
strlist.push_back(timeInSeconds ? "s" : "f");
encodeLongLong(strlist, captureTime);
strlist.push_back(QString::number(captureTime));
if (outFileName.isEmpty())
{
strlist.push_back("<EMPTY>");
Expand Down
27 changes: 9 additions & 18 deletions mythtv/libs/libmythtv/remoteencoder.cpp
Expand Up @@ -5,7 +5,6 @@
#include "remoteencoder.h"
#include "programinfo.h"
#include "util.h"
#include "decodeencode.h"
#include "mythcorecontext.h"
#include "signalmonitor.h"
#include "videooutbase.h"
Expand Down Expand Up @@ -206,21 +205,13 @@ long long RemoteEncoder::GetFramesWritten(void)
QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum));
strlist << "GET_FRAMES_WRITTEN";

if (!SendReceiveStringList(strlist, 2))
if (!SendReceiveStringList(strlist, 1))
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "GetFramesWritten() -- network error");
return -1;
}

if (1 == strlist.size())
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
QString("GetFramesWritten() -- server ret: %1")
.arg(strlist[0]));
return -1;
}

cachedFramesWritten = decodeLongLong(strlist, 0);
cachedFramesWritten = strlist[0].toLongLong();
return cachedFramesWritten;
}

Expand All @@ -235,8 +226,8 @@ long long RemoteEncoder::GetFilePosition(void)
QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum));
strlist << "GET_FILE_POSITION";

if (SendReceiveStringList(strlist, 2))
return decodeLongLong(strlist, 0);
if (SendReceiveStringList(strlist, 1))
return strlist[0].toLongLong();

return -1;
}
Expand All @@ -250,8 +241,8 @@ long long RemoteEncoder::GetMaxBitrate(void)
QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum));
strlist << "GET_MAX_BITRATE";

if (SendReceiveStringList(strlist, 2))
return decodeLongLong(strlist, 0);
if (SendReceiveStringList(strlist, 1))
return strlist[0].toLongLong();

return 20200000LL; // Peek bit rate for HD-PVR
}
Expand All @@ -267,10 +258,10 @@ int64_t RemoteEncoder::GetKeyframePosition(uint64_t desired)
{
QStringList strlist( QString("QUERY_RECORDER %1").arg(recordernum) );
strlist << "GET_KEYFRAME_POS";
encodeLongLong(strlist, desired);
strlist << QString::number(desired);

if (SendReceiveStringList(strlist, 2))
return decodeLongLong(strlist, 0);
if (SendReceiveStringList(strlist, 1))
return strlist[0].toLongLong();

return -1;
}
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/tvremoteutil.cpp
Expand Up @@ -7,7 +7,6 @@
#include "inputinfo.h"
#include "programinfo.h"
#include "mythcorecontext.h"
#include "decodeencode.h"
#include "remoteencoder.h"
#include "tv_rec.h"

Expand Down
3 changes: 1 addition & 2 deletions mythtv/programs/mythbackend/autoexpire.cpp
Expand Up @@ -707,8 +707,7 @@ void AutoExpire::ExpireEpisodesOverMax(void)
(!episodeParts.contains(episodeKey)) &&
(found > *maxIter))
{
long long spaceFreed =
query.value(5).toLongLong() >> 20;
long long spaceFreed = query.value(5).toLongLong() >> 20;
QString msg =
QString("Expiring %1 MBytes for %2 at %3 => %4. Too "
"many episodes, we only want to keep %5.")
Expand Down
5 changes: 2 additions & 3 deletions mythtv/programs/mythbackend/httpstatus.cpp
Expand Up @@ -26,7 +26,6 @@

#include "mythcorecontext.h"
#include "mythversion.h"
#include "decodeencode.h"
#include "mythdbcon.h"
#include "compat.h"
#include "mythconfig.h"
Expand Down Expand Up @@ -454,8 +453,8 @@ void HttpStatus::FillStatusXML( QDomDocument *pDoc )
fsID = *(sit++);
sit++; // ignore dirID
sit++; // ignore blocksize
iTotal = decodeLongLong(strlist, sit);
iUsed = decodeLongLong(strlist, sit);
iTotal = (*(sit++)).toLongLong();
iUsed = (*(sit++)).toLongLong();;
iAvail = iTotal - iUsed;

if (fsID == "-2")
Expand Down

2 comments on commit 1508085

@NigelPearson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your make does something like this:

cd mythcommflag/ && make -f Makefile
make[2]: *** No rule to make target ../../libs/libmythbase/decodeencode.h', needed byBlankFrameDetector.o'. Stop.
make[1]: *** [sub-mythcommflag-make_default] Error 2
make: *** [programs] Error 2
Do something like:

find programs -name *.pro -exec touch {} ;

make

@Beirdo
Copy link
Member

@Beirdo Beirdo commented on 1508085 May 28, 2011 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.