Commit b0fb2f90 authored by John Boydon's avatar John Boydon

WIP

parent c5f74d93
......@@ -228,7 +228,7 @@ void displayBugScreen(const char *msg) {
#if (EXTRA_INFO_ON_CALC_ERROR == 1)
/*=====================================================================================================================
* longInteger_t extended print
* longInteger_t extensible print
*--------------------------------------------------------------------------------------------------------------------*/
static int print_LongInteger(FILE *stream, const struct printf_info *info, const void *const *args) {
......@@ -256,7 +256,7 @@ static int print_LongInteger_arginfo (const struct printf_info *info, size_t n,
}
/*=====================================================================================================================
* real_t extended print
* real_t extensible print
*--------------------------------------------------------------------------------------------------------------------*/
static int print_Real(FILE *stream, const struct printf_info *info, const void *const *args) {
......@@ -282,7 +282,7 @@ static int print_Real_arginfo(const struct printf_info *info, size_t n, int *arg
}
/*=====================================================================================================================
* (real_t, real_t) extended print
* (real_t, real_t) extensible print
*--------------------------------------------------------------------------------------------------------------------*/
static int print_Complex(FILE *stream, const struct printf_info *info, const void *const *args) {
......@@ -313,7 +313,7 @@ static int print_Complex_arginfo(const struct printf_info *info, size_t n, int *
}
/*=====================================================================================================================
* real34_t extended print
* real34_t extensible print
*--------------------------------------------------------------------------------------------------------------------*/
static int print_Real34(FILE *stream, const struct printf_info *info, const void *const *args) {
......@@ -339,7 +339,7 @@ static int print_Real34_arginfo(const struct printf_info *info, size_t n, int *a
}
/*=====================================================================================================================
* Extended print
* Extensible print
*--------------------------------------------------------------------------------------------------------------------*/
static printf_domain_t domain = NULL;
......@@ -413,34 +413,20 @@ void displayExtendedErrorMessage(uint8_t errorCode, calcRegister_t errMessageReg
va_start(args, formattedMessage);
char message[3000];
if(domain==NULL)
vsprintf(message, formattedMessage, args);
else
wp_snprintf(message, 3000, formattedMessage, args);
wp_snprintf(message, 3000, formattedMessage, args);
va_end(args);
displayCalcErrorMessage(errorCode, errMessageRegisterLine, errRegisterLine);
if (domain == NULL) {
sprintf(errorMessage, "In function:\"%s\", file: \"%s\" at line: %d",
wp_snprintf(errorMessage, ERROR_MESSAGE_LENGTH / 2, "In function:\"%s\", file: \"%s\" at line: %d",
functionName, strrstr(fileName, "src"), lineNumber);
sprintf(errorMessage + ERROR_MESSAGE_LENGTH / 2,
"\terror: \"%s\"\n\tRegX:%s, RegY:%s, RegZ:%s, RegT:%s, RegL:%s", message,
wp_snprintf(errorMessage + ERROR_MESSAGE_LENGTH / 2, ERROR_MESSAGE_LENGTH / 2,
"\terror: \"%s\"\n\tRegX:%s, RegY:%s, RegZ:%s, RegT:%s, RegL:%s\n", message,
getRegisterDataTypeName(REGISTER_X, false, false), getRegisterDataTypeName(REGISTER_Y, false, false),
getRegisterDataTypeName(REGISTER_Z, false, false), getRegisterDataTypeName(REGISTER_T, false, false),
getRegisterDataTypeName(REGISTER_L, false, false));
}
else {
wp_snprintf(errorMessage, ERROR_MESSAGE_LENGTH / 2, "In function:\"%s\", file: \"%s\" at line: %d",
functionName, strrstr(fileName, "src"), lineNumber);
wp_snprintf(errorMessage + ERROR_MESSAGE_LENGTH / 2, ERROR_MESSAGE_LENGTH / 2,
"\terror: \"%s\"\n\tRegX:%s, RegY:%s, RegZ:%s, RegT:%s, RegL:%s\n", message,
getRegisterDataTypeName(REGISTER_X, false, false),getRegisterDataTypeName(REGISTER_Y, false, false),
getRegisterDataTypeName(REGISTER_Z, false, false),getRegisterDataTypeName(REGISTER_T, false, false),
getRegisterDataTypeName(REGISTER_L, false, false));
}
moreInfoOnError(errorMessage, errorMessage + ERROR_MESSAGE_LENGTH/2, NULL, NULL);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment