mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-06 17:32:40 +00:00
Address review comments
This commit is contained in:
parent
d811cbb948
commit
032ef799b8
@ -5,6 +5,7 @@
|
|||||||
#include "core/libraries/error_codes.h"
|
#include "core/libraries/error_codes.h"
|
||||||
#include "core/libraries/libs.h"
|
#include "core/libraries/libs.h"
|
||||||
#include "core/libraries/np_common/np_common.h"
|
#include "core/libraries/np_common/np_common.h"
|
||||||
|
#include "core/libraries/np_common/np_common_error.h"
|
||||||
|
|
||||||
namespace Libraries::NpCommon {
|
namespace Libraries::NpCommon {
|
||||||
|
|
||||||
@ -14,7 +15,8 @@ int PS4_SYSV_ABI sceNpCmpNpId(OrbisNpId* np_id1, OrbisNpId* np_id2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compare data
|
// Compare data
|
||||||
if (std::strncmp(np_id1->handle.data, np_id2->handle.data, ORBIS_NP_ONLINEID_MAX_LENGTH) != 0) {
|
if (std::strncmp(reinterpret_cast<char*>(np_id1->handle.data),
|
||||||
|
reinterpret_cast<char*>(np_id2->handle.data), ORBIS_NP_ONLINEID_MAX_LENGTH) != 0) {
|
||||||
return ORBIS_NP_UTIL_ERROR_NOT_MATCH;
|
return ORBIS_NP_UTIL_ERROR_NOT_MATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,8 +43,8 @@ int PS4_SYSV_ABI sceNpCmpNpIdInOrder(OrbisNpId* np_id1, OrbisNpId* np_id2, u32*
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compare data
|
// Compare data
|
||||||
u32 compare =
|
u32 compare = std::strncmp(reinterpret_cast<char*>(np_id1->handle.data),
|
||||||
std::strncmp(np_id1->handle.data, np_id2->handle.data, ORBIS_NP_ONLINEID_MAX_LENGTH);
|
reinterpret_cast<char*>(np_id2->handle.data), ORBIS_NP_ONLINEID_MAX_LENGTH);
|
||||||
if (compare < 0) {
|
if (compare < 0) {
|
||||||
*out_result = -1;
|
*out_result = -1;
|
||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
@ -82,7 +84,8 @@ int PS4_SYSV_ABI sceNpCmpOnlineId(OrbisNpOnlineId* online_id1, OrbisNpOnlineId*
|
|||||||
return ORBIS_NP_ERROR_INVALID_ARGUMENT;
|
return ORBIS_NP_ERROR_INVALID_ARGUMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (std::strncmp(online_id1->data, online_id2->data, ORBIS_NP_ONLINEID_MAX_LENGTH) != 0) {
|
if (std::strncmp(reinterpret_cast<char*>(online_id1->data),
|
||||||
|
reinterpret_cast<char*>(online_id2->data), ORBIS_NP_ONLINEID_MAX_LENGTH) != 0) {
|
||||||
return ORBIS_NP_UTIL_ERROR_NOT_MATCH;
|
return ORBIS_NP_UTIL_ERROR_NOT_MATCH;
|
||||||
}
|
}
|
||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
|
@ -11,15 +11,12 @@ class SymbolsResolver;
|
|||||||
|
|
||||||
namespace Libraries::NpCommon {
|
namespace Libraries::NpCommon {
|
||||||
|
|
||||||
constexpr int ORBIS_NP_ERROR_INVALID_ARGUMENT = 0x80550003;
|
|
||||||
constexpr int ORBIS_NP_UTIL_ERROR_NOT_MATCH = 0x80550609;
|
|
||||||
|
|
||||||
constexpr int ORBIS_NP_ONLINEID_MAX_LENGTH = 16;
|
constexpr int ORBIS_NP_ONLINEID_MAX_LENGTH = 16;
|
||||||
|
|
||||||
struct OrbisNpOnlineId {
|
struct OrbisNpOnlineId {
|
||||||
char data[ORBIS_NP_ONLINEID_MAX_LENGTH];
|
s8 data[ORBIS_NP_ONLINEID_MAX_LENGTH];
|
||||||
char term;
|
s8 term;
|
||||||
char dummy[3];
|
s8 dummy[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct OrbisNpId {
|
struct OrbisNpId {
|
||||||
|
9
src/core/libraries/np_common/np_common_error.h
Normal file
9
src/core/libraries/np_common/np_common_error.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/libraries/error_codes.h"
|
||||||
|
|
||||||
|
constexpr int ORBIS_NP_ERROR_INVALID_ARGUMENT = 0x80550003;
|
||||||
|
constexpr int ORBIS_NP_UTIL_ERROR_NOT_MATCH = 0x80550609;
|
Loading…
Reference in New Issue
Block a user