本文整理汇总了C++中PointerWrap::SetError方法的典型用法代码示例。如果您正苦于以下问题:C++ PointerWrap::SetError方法的具体用法?C++ PointerWrap::SetError怎么用?C++ PointerWrap::SetError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointerWrap
的用法示例。
在下文中一共展示了PointerWrap::SetError方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoState
void MetaFileSystem::DoState(PointerWrap &p)
{
lock_guard guard(lock);
auto s = p.Section("MetaFileSystem", 1);
if (!s)
return;
p.Do(current);
// Save/load per-thread current directory map
p.Do(currentDir);
u32 n = (u32) fileSystems.size();
p.Do(n);
bool skipPfat0 = false;
if (n != (u32) fileSystems.size())
{
if (n == (u32) fileSystems.size() - 1) {
skipPfat0 = true;
} else {
p.SetError(p.ERROR_FAILURE);
ERROR_LOG(FILESYS, "Savestate failure: number of filesystems doesn't match.");
return;
}
}
for (u32 i = 0; i < n; ++i) {
if (!skipPfat0 || fileSystems[i].prefix != "pfat0:") {
fileSystems[i].system->DoState(p);
}
}
}
示例2: __KernelDoState
void __KernelDoState(PointerWrap &p)
{
std::string git_version = PPSSPP_GIT_VERSION;
p.Do(git_version);
if (git_version != PPSSPP_GIT_VERSION)
{
p.SetError(p.ERROR_WARNING);
WARN_LOG(HLE, "Warning: this savestate was generated by a different version of PPSSPP. It may not load properly.");
}
p.Do(kernelRunning);
kernelObjects.DoState(p);
p.DoMarker("KernelObjects");
__InterruptsDoState(p);
// Memory needs to be after kernel objects, which may free kernel memory.
__KernelMemoryDoState(p);
__KernelThreadingDoState(p);
__KernelAlarmDoState(p);
__KernelVTimerDoState(p);
__KernelEventFlagDoState(p);
__KernelMbxDoState(p);
__KernelModuleDoState(p);
__KernelMutexDoState(p);
__KernelSemaDoState(p);
__KernelTimeDoState(p);
__AtracDoState(p);
__AudioDoState(p);
__CtrlDoState(p);
__DisplayDoState(p);
__FontDoState(p);
__GeDoState(p);
__ImposeDoState(p);
__IoDoState(p);
__MpegDoState(p);
__NetDoState(p);
__PowerDoState(p);
__PsmfDoState(p);
__PsmfPlayerDoState(p);
__RtcDoState(p);
__SasDoState(p);
__SslDoState(p);
__UmdDoState(p);
__UtilityDoState(p);
__UsbDoState(p);
__VaudioDoState(p);
__PPGeDoState(p);
__InterruptsDoStateLate(p);
__KernelThreadingDoStateLate(p);
}
示例3: DoState
void KernelObjectPool::DoState(PointerWrap &p)
{
auto s = p.Section("KernelObjectPool", 1);
if (!s)
return;
int _maxCount = maxCount;
p.Do(_maxCount);
if (_maxCount != maxCount)
{
p.SetError(p.ERROR_FAILURE);
ERROR_LOG(SCEKERNEL, "Unable to load state: different kernel object storage.");
return;
}
if (p.mode == p.MODE_READ)
{
hleCurrentThreadName = NULL;
kernelObjects.Clear();
}
p.Do(nextID);
p.DoArray(occupied, maxCount);
for (int i = 0; i < maxCount; ++i)
{
if (!occupied[i])
continue;
int type;
if (p.mode == p.MODE_READ)
{
p.Do(type);
pool[i] = CreateByIDType(type);
// Already logged an error.
if (pool[i] == NULL)
return;
pool[i]->uid = i + handleOffset;
}
else
{
type = pool[i]->GetIDType();
p.Do(type);
}
pool[i]->DoState(p);
if (p.error >= p.ERROR_FAILURE)
break;
}
}
示例4: DoState
void VFSFileSystem::DoState(PointerWrap &p) {
// Note: used interchangeably with DirectoryFileSystem for flash0:, so we use the same name.
auto s = p.Section("DirectoryFileSystem", 0, 2);
if (!s)
return;
u32 num = (u32) entries.size();
p.Do(num);
if (num != 0) {
p.SetError(p.ERROR_WARNING);
ERROR_LOG(FILESYS, "FIXME: Open files during savestate, could go badly.");
}
}
示例5: __InterruptsDoState
void __InterruptsDoState(PointerWrap &p)
{
int numInterrupts = PSP_NUMBER_INTERRUPTS;
p.Do(numInterrupts);
if (numInterrupts != PSP_NUMBER_INTERRUPTS)
{
p.SetError(p.ERROR_FAILURE);
ERROR_LOG(HLE, "Savestate failure: wrong number of interrupts, can't load.");
return;
}
intState.DoState(p);
PendingInterrupt pi(0, 0);
p.Do(pendingInterrupts, pi);
p.Do(interruptsEnabled);
p.Do(inInterrupt);
p.Do(threadBeforeInterrupt);
p.DoMarker("sceKernelInterrupt");
}
示例6: DoState
void MetaFileSystem::DoState(PointerWrap &p)
{
p.Do(current);
// Save/load per-thread current directory map
p.Do(currentDir);
u32 n = (u32) fileSystems.size();
p.Do(n);
if (n != (u32) fileSystems.size())
{
p.SetError(p.ERROR_FAILURE);
ERROR_LOG(FILESYS, "Savestate failure: number of filesystems doesn't match.");
return;
}
for (u32 i = 0; i < n; ++i)
fileSystems[i].system->DoState(p);
p.DoMarker("MetaFileSystem");
}
示例7: DoState
void VFSFileSystem::DoState(PointerWrap &p) {
if (!entries.empty()) {
p.SetError(p.ERROR_WARNING);
ERROR_LOG(FILESYS, "FIXME: Open files during savestate, could go badly.");
}
}