Fix struct to remove need for c_shift().
This commit is contained in:
parent
700360e0d3
commit
757c83d395
@ -1,8 +1,6 @@
|
|||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds/types.h>
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/synchronization.h>
|
#include <3ds/synchronization.h>
|
||||||
#include <3ds/services/apt.h>
|
#include <3ds/services/apt.h>
|
||||||
#include <3ds/services/cfgu.h>
|
#include <3ds/services/cfgu.h>
|
||||||
@ -22,6 +20,11 @@ void errorInit(errorConf* err, errorType type, CFG_Language lang)
|
|||||||
err->returnCode = ERROR_UNKNOWN;
|
err->returnCode = ERROR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void errorCode(errorConf* err, int error)
|
||||||
|
{
|
||||||
|
err->errorCode = error;
|
||||||
|
}
|
||||||
|
|
||||||
static void errorConvertToUTF16(u16* out, const char* in, size_t max)
|
static void errorConvertToUTF16(u16* out, const char* in, size_t max)
|
||||||
{
|
{
|
||||||
if (!in || !*in)
|
if (!in || !*in)
|
||||||
@ -40,27 +43,9 @@ static void errorConvertToUTF16(u16* out, const char* in, size_t max)
|
|||||||
out[units] = 0;
|
out[units] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* c_shift(const char *text)
|
|
||||||
{
|
|
||||||
size_t len = strlen(text);
|
|
||||||
char *str = (char*)malloc(len + 2);
|
|
||||||
if (str)
|
|
||||||
{
|
|
||||||
str[0] = text[0];
|
|
||||||
strcpy(&str[1], text);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
void errorCode(errorConf* err, int error)
|
|
||||||
{
|
|
||||||
err->errorCode = error;
|
|
||||||
}
|
|
||||||
|
|
||||||
void errorText(errorConf *err, const char* text)
|
void errorText(errorConf *err, const char* text)
|
||||||
{ char *tex = c_shift(text);
|
{
|
||||||
errorConvertToUTF16(err->Text, tex, 1900);
|
errorConvertToUTF16(err->Text, text, 1900);
|
||||||
free(tex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void errorDisp(errorConf* err)
|
void errorDisp(errorConf* err)
|
||||||
|
Loading…
Reference in New Issue
Block a user