Commit 297e6944 authored by Albert Astals Cid's avatar Albert Astals Cid

Error: Make the msg be const

parent 13974861
......@@ -39,7 +39,7 @@ static void stderr_debug_function(const std::string &msg, void * /*data*/)
debug_func detail::user_debug_function = stderr_debug_function;
void *detail::debug_closure = nullptr;
void detail::error_function(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
void detail::error_function(void * /*data*/, ErrorCategory /*category*/, Goffset pos, const char *msg)
{
std::ostringstream oss;
if (pos >= 0) {
......
......@@ -47,7 +47,7 @@ namespace detail
extern debug_func user_debug_function;
extern void *debug_closure;
void error_function(void *data, ErrorCategory category, Goffset pos, char *msg);
void error_function(void *data, ErrorCategory category, Goffset pos, const char *msg);
rectf pdfrectangle_to_rectf(const PDFRectangle &pdfrect);
......
......@@ -87,7 +87,7 @@ static void
error_cb (void *data G_GNUC_UNUSED,
ErrorCategory category,
Goffset pos,
char *message)
const char *message)
{
static const char * const cat_str[] = {
"Syntax warning",
......
......@@ -50,11 +50,11 @@ static const char *errorCategoryNames[] = {
};
static void (*errorCbk)(void *data, ErrorCategory category,
Goffset pos, char *msg) = nullptr;
Goffset pos, const char *msg) = nullptr;
static void *errorCbkData = nullptr;
void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
Goffset pos, char *msg),
Goffset pos, const char *msg),
void *data) {
errorCbk = cbk;
errorCbkData = data;
......
......@@ -52,7 +52,7 @@ enum ErrorCategory {
};
extern void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
Goffset pos, char *msg),
Goffset pos, const char *msg),
void *data);
extern void CDECL error(ErrorCategory category, Goffset pos, const char *msg, ...) GOOSTRING_FORMAT;
......
......@@ -58,7 +58,7 @@ namespace Debug {
Debug::debugClosure = closure;
}
static void qt5ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
static void qt5ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, const char *msg)
{
QString emsg;
......
......@@ -739,7 +739,7 @@ static void StrList_Destroy(StrList **root)
*root = nullptr;
}
static void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
static void my_error(void *, ErrorCategory, Goffset pos, const char *msg) {
#if 0
char buf[4096], *p = buf;
......
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