fix compilation issues on latest libogc & ppc-mxml

This commit is contained in:
Naim2000 2023-10-25 17:33:03 -05:00
parent 8b7e126911
commit 0cf8c31447
2 changed files with 24 additions and 26 deletions

View File

@ -4,37 +4,35 @@
#include "appmetadata.h" #include "appmetadata.h"
static char* GetStringValue(mxml_node_t* node, const char* element) static const char* GetStringValue(mxml_node_t* node, const char* element)
{ {
mxml_node_t* elementNode = mxmlFindElement(node, node, element, NULL, NULL, MXML_DESCEND_FIRST); mxml_node_t* elementNode = mxmlFindElement(node, node, element, NULL, NULL, MXML_DESCEND_FIRST);
if (!elementNode) return NULL;
if (elementNode) mxml_node_t* current = mxmlGetFirstChild(elementNode);
{
mxml_node_t* current = elementNode->child;
while (current && current->type != MXML_OPAQUE) while (current && mxmlGetType(current) != MXML_OPAQUE)
current = mxmlWalkNext(current, elementNode, MXML_NO_DESCEND); current = mxmlWalkNext(current, elementNode, MXML_NO_DESCEND);
if (current->type == MXML_OPAQUE) if (current)
return current->value.opaque; return mxmlGetOpaque(current);
} else
return NULL; return NULL;
} }
static char* GetArgumentValue(mxml_node_t* node) static const char* GetArgumentValue(mxml_node_t* node)
{ {
if (node) if (!node) return NULL;
{
mxml_node_t* current = node->child;
while (current && current->type != MXML_OPAQUE) mxml_node_t* current = mxmlGetFirstChild(node);
while (current && mxmlGetType(current) != MXML_OPAQUE)
current = mxmlWalkNext(current, node, MXML_NO_DESCEND); current = mxmlWalkNext(current, node, MXML_NO_DESCEND);
if (current->type == MXML_OPAQUE) if (current)
return current->value.opaque; return mxmlGetOpaque(current);
} else
return NULL; return NULL;
} }
@ -142,7 +140,7 @@ char* LoadArguments(const char* path, u16* length)
for (arg = mxmlFindElement(arguments, arguments, "arg", NULL, NULL, MXML_DESCEND_FIRST); arg != NULL; arg = mxmlFindElement(arg, arguments, "arg", NULL, NULL, MXML_NO_DESCEND)) for (arg = mxmlFindElement(arguments, arguments, "arg", NULL, NULL, MXML_DESCEND_FIRST); arg != NULL; arg = mxmlFindElement(arg, arguments, "arg", NULL, NULL, MXML_NO_DESCEND))
{ {
char* current = GetArgumentValue(arg); const char* current = GetArgumentValue(arg);
if (current) if (current)
{ {
@ -165,7 +163,7 @@ char* LoadArguments(const char* path, u16* length)
for (arg = mxmlFindElement(arguments, arguments, "arg", NULL, NULL, MXML_DESCEND_FIRST); arg != NULL; arg = mxmlFindElement(arg, arguments, "arg", NULL, NULL, MXML_NO_DESCEND)) for (arg = mxmlFindElement(arguments, arguments, "arg", NULL, NULL, MXML_DESCEND_FIRST); arg != NULL; arg = mxmlFindElement(arg, arguments, "arg", NULL, NULL, MXML_NO_DESCEND))
{ {
char* current = GetArgumentValue(arg); const char* current = GetArgumentValue(arg);
if (current) if (current)
{ {

View File

@ -62,7 +62,7 @@ s32 Title_FakesignTMD(signed_blob *p_tmd)
sha1 hash; sha1 hash;
/* Modify TMD fill field */ /* Modify TMD fill field */
tmd_data->fill2 = fill; tmd_data->fill3 = fill;
/* Calculate hash */ /* Calculate hash */
SHA1((u8 *)tmd_data, TMD_SIZE(tmd_data), hash); SHA1((u8 *)tmd_data, TMD_SIZE(tmd_data), hash);