mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-21 03:35:40 -04:00
Remove YBaseLib dependency
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#include "qtutils.h"
|
||||
#include "YBaseLib/ByteStream.h"
|
||||
#include "common/byte_stream.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtWidgets/QDialog>
|
||||
@ -583,13 +583,13 @@ int KeyEventToInt(const QKeyEvent* ke)
|
||||
QByteArray ReadStreamToQByteArray(ByteStream* stream, bool rewind /*= false*/)
|
||||
{
|
||||
QByteArray ret;
|
||||
const uint64 old_pos = stream->GetPosition();
|
||||
const u64 old_pos = stream->GetPosition();
|
||||
if (rewind && !stream->SeekAbsolute(0))
|
||||
return {};
|
||||
|
||||
const uint64 stream_size = stream->GetSize() - stream->GetPosition();
|
||||
const u64 stream_size = stream->GetSize() - stream->GetPosition();
|
||||
ret.resize(static_cast<int>(stream_size));
|
||||
if (stream_size > 0 && !stream->Read2(ret.data(), static_cast<uint32>(stream_size), nullptr))
|
||||
if (stream_size > 0 && !stream->Read2(ret.data(), static_cast<u32>(stream_size), nullptr))
|
||||
return {};
|
||||
|
||||
stream->SeekAbsolute(old_pos);
|
||||
@ -598,7 +598,7 @@ QByteArray ReadStreamToQByteArray(ByteStream* stream, bool rewind /*= false*/)
|
||||
|
||||
bool WriteQByteArrayToStream(QByteArray& arr, ByteStream* stream)
|
||||
{
|
||||
return arr.isEmpty() || stream->Write2(arr.data(), static_cast<uint32>(arr.size()));
|
||||
return arr.isEmpty() || stream->Write2(arr.data(), static_cast<u32>(arr.size()));
|
||||
}
|
||||
|
||||
} // namespace QtUtils
|
Reference in New Issue
Block a user