Start the long road to exception readiness.
This commit is contained in:
@@ -61,9 +61,15 @@ SortStarsOnName (STAR_SEARCH_STATE *pSS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Since HMalloc just terminates on failure,
|
||||||
|
// we can use `new` safely from mixed C++ and
|
||||||
|
// C. Either I'll use `std::new_handler` to
|
||||||
|
// do the same thing... or just let exceptions
|
||||||
|
// tear it down by bumping into the `noexcept`
|
||||||
|
// boundaries I'll stick on the `extern "C"`
|
||||||
|
// interfaces.
|
||||||
extern "C" bool
|
extern "C" bool
|
||||||
DoStarSearch (MENU_STATE *pMS)
|
DoStarSearch (MENU_STATE *pMS) noexcept
|
||||||
try
|
|
||||||
{
|
{
|
||||||
TEXTENTRY_STATE tes;
|
TEXTENTRY_STATE tes;
|
||||||
bool success;
|
bool success;
|
||||||
@@ -98,7 +104,3 @@ try
|
|||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
catch( const std::bad_alloc & )
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -22,8 +22,14 @@
|
|||||||
#include "uqm/menustat.h"
|
#include "uqm/menustat.h"
|
||||||
#include "uqm/controls.h"
|
#include "uqm/controls.h"
|
||||||
|
|
||||||
|
#ifndef CXX_NOEXCEPT
|
||||||
|
#define CXX_NOEXCEPT
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#undef CXX_NOEXCEPT
|
||||||
|
#define CXX_NOEXCEPT noexcept
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern STAR_DESC *CurStarDescPtr;
|
extern STAR_DESC *CurStarDescPtr;
|
||||||
@@ -65,7 +71,7 @@ typedef struct starsearch_state
|
|||||||
int *SortedStars;
|
int *SortedStars;
|
||||||
} STAR_SEARCH_STATE;
|
} STAR_SEARCH_STATE;
|
||||||
|
|
||||||
bool DoStarSearch( MENU_STATE * );
|
bool DoStarSearch( MENU_STATE * ) CXX_NOEXCEPT;
|
||||||
BOOLEAN OnStarNameChange( TEXTENTRY_STATE * );
|
BOOLEAN OnStarNameChange( TEXTENTRY_STATE * );
|
||||||
BOOLEAN OnStarNameFrame ( TEXTENTRY_STATE *pTES );
|
BOOLEAN OnStarNameFrame ( TEXTENTRY_STATE *pTES );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user