Skip to content

Commit 12e3732

Browse files
committed
Changed errid to errname in DLL interface
1 parent 259b279 commit 12e3732

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/asar-dll-bindings/c/asardll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct errordata {
1717
int line;
1818
const char * callerfilename;
1919
int callerline;
20-
int errid;
20+
const char * errname;
2121
};
2222

2323
struct labeldata {

src/asar/interface-lib.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct errordata {
4444
int line;
4545
const char * callerfilename;
4646
int callerline;
47-
int errid;
47+
const char * errname;
4848
};
4949
static autoarray<errordata> errors;
5050
static int numerror;
@@ -86,7 +86,7 @@ void print(const char * str)
8686
prints[numprint++]= duplicate_string(str);
8787
}
8888

89-
static void fillerror(errordata& myerr, int errid, const char * type, const char * str, bool show_block)
89+
static void fillerror(errordata& myerr, const char* errname, const char * type, const char * str, bool show_block)
9090
{
9191
const char* current_filename = get_current_file_name();
9292
if(current_filename) myerr.filename= duplicate_string(current_filename);
@@ -104,8 +104,7 @@ static void fillerror(errordata& myerr, int errid, const char * type, const char
104104
myerr.callerline=get_previous_file_line_no();
105105
const char* prev_file = get_previous_file_name();
106106
myerr.callerfilename=prev_file ? duplicate_string(prev_file) : nullptr;
107-
// RPG Hacker: TODO: Rework this into error/warning name string once we bump the DLL API version again.
108-
myerr.errid = errid;
107+
myerr.errname = duplicate_string(errname);
109108
}
110109

111110
static bool ismath=false;
@@ -118,7 +117,7 @@ void error_interface(int errid, int whichpass, const char * e_)
118117
else if (pass == whichpass) {
119118
// don't show current block if the error came from an error command
120119
bool show_block = (errid != error_id_error_command);
121-
fillerror(errors[numerror++], errid, STR "error: (" + get_error_name((asar_error_id)errid) + "): ", e_, show_block);
120+
fillerror(errors[numerror++], get_error_name((asar_error_id)errid), STR "error: (" + get_error_name((asar_error_id)errid) + "): ", e_, show_block);
122121
}
123122
else {}//ignore anything else
124123
}
@@ -127,7 +126,7 @@ void warn(int errid, const char * str)
127126
{
128127
// don't show current block if the warning came from a warn command
129128
bool show_block = (errid != warning_id_warn_command);
130-
fillerror(warnings[numwarn++], errid, STR "warning: (" + get_warning_name((asar_warning_id)errid) + "): ", str, show_block);
129+
fillerror(warnings[numwarn++], get_warning_name((asar_warning_id)errid), STR "warning: (" + get_warning_name((asar_warning_id)errid) + "): ", str, show_block);
131130
}
132131

133132

@@ -152,6 +151,7 @@ static void resetdllstuff()
152151
free_and_null(errors[i].fullerrdata);
153152
free_and_null(errors[i].callerfilename);
154153
free_and_null(errors[i].block);
154+
free_and_null(errors[i].errname);
155155
}
156156
errors.reset();
157157
numerror=0;

src/asar/interface-lib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct errordata {
1616
int line;
1717
const char * callerfilename;
1818
int callerline;
19-
int errid;
19+
const char * errname;
2020
};
2121

2222
struct labeldata {

0 commit comments

Comments
 (0)