diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index a74f242ca..96d862fc7 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -204,7 +204,7 @@ static CursesMenuHandler getHandlerForKey( const MenuList* list, char ch ); /* extern int errno; */ static void -cursesUserError( CursesAppGlobals* globals, char* format, ... ) +cursesUserError( CursesAppGlobals* globals, const char* format, ... ) { char buf[512]; va_list ap; @@ -241,7 +241,7 @@ curses_util_userError( XW_UtilCtxt* uc, UtilErrID id ) { CursesAppGlobals* globals = (CursesAppGlobals*)uc->closure; XP_Bool silent; - XP_UCHAR* message = linux_getErrString( id, &silent ); + const XP_UCHAR* message = linux_getErrString( id, &silent ); if ( silent ) { XP_LOGF( "silent userError: %s", message ); diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 9dc824f54..c8bf1ddd8 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -1059,7 +1059,7 @@ handle_commit_button( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) } /* handle_commit_button */ static void -gtkUserError( GtkAppGlobals* XP_UNUSED(globals), char* format, ... ) +gtkUserError( GtkAppGlobals* XP_UNUSED(globals), const char* format, ... ) { char buf[512]; va_list ap; @@ -1412,7 +1412,7 @@ gtk_util_userError( XW_UtilCtxt* uc, UtilErrID id ) { GtkAppGlobals* globals = (GtkAppGlobals*)uc->closure; XP_Bool silent; - XP_UCHAR* message = linux_getErrString( id, &silent ); + const XP_UCHAR* message = linux_getErrString( id, &silent ); XP_LOGF( "%s(%d)", __func__, id ); diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index 982f26501..e7b168d80 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -135,11 +135,12 @@ strFromStream( XWStreamCtxt* stream ) return buf; } /* strFromStream */ -XP_UCHAR* + +const XP_UCHAR* linux_getErrString( UtilErrID id, XP_Bool* silent ) { *silent = XP_FALSE; - char* message = NULL; + const char* message = NULL; switch( id ) { case ERR_TILES_NOT_IN_LINE: @@ -184,6 +185,10 @@ linux_getErrString( UtilErrID id, XP_Bool* silent ) break; #endif + case ERR_CANT_TRADE_MID_MOVE: + message = "Remove played tiles before trading."; + break; + case ERR_CANT_UNDO_TILEASSIGN: message = "Tile assignment can't be undone."; break; diff --git a/xwords4/linux/linuxmain.h b/xwords4/linux/linuxmain.h index c8bd53ccf..4b0a623ea 100644 --- a/xwords4/linux/linuxmain.h +++ b/xwords4/linux/linuxmain.h @@ -56,7 +56,7 @@ void linuxFireTimer( CommonGlobals* cGlobals, XWTimerReason why ); XWStreamCtxt* stream_from_msgbuf( CommonGlobals* cGlobals, unsigned char* bufPtr, XP_U16 nBytes ); -XP_UCHAR* linux_getErrString( UtilErrID id, XP_Bool* silent ); +const XP_UCHAR* linux_getErrString( UtilErrID id, XP_Bool* silent ); XP_UCHAR* strFromStream( XWStreamCtxt* stream ); void catGameHistory( CommonGlobals* cGlobals );