mirror of
https://gitlab.com/c3d/db48x.git
synced 2024-09-29 05:36:58 +02:00
tests: Replace magic constant -1
with EXIT_PGM
We use `-1` to mark the termination of the RPL thread and request the state to be saved on disk. Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
parent
887f4173b4
commit
1507f36dc5
4 changed files with 6 additions and 4 deletions
|
@ -28,6 +28,7 @@
|
|||
// ****************************************************************************
|
||||
|
||||
#include "sim-rpl.h"
|
||||
#include "tests.h"
|
||||
#include <dmcp.h>
|
||||
|
||||
extern int key_remaining();
|
||||
|
@ -47,7 +48,7 @@ RPLThread::~RPLThread()
|
|||
while (!isFinished())
|
||||
{
|
||||
if (key_remaining())
|
||||
key_push(-1);
|
||||
key_push(tests::EXIT_PGM);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ MainWindow::~MainWindow()
|
|||
// Destroy the main window
|
||||
// ----------------------------------------------------------------------------
|
||||
{
|
||||
key_push(-1);
|
||||
key_push(tests::EXIT_PGM);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -372,7 +372,7 @@ extern "C" void program_main()
|
|||
}
|
||||
|
||||
#if SIMULATOR
|
||||
if (key == -1)
|
||||
if (key == tests::EXIT_PGM)
|
||||
{
|
||||
cstring path = get_reset_state_file();
|
||||
printf("Exit: saving state to %s\n", path);
|
||||
|
|
|
@ -179,7 +179,8 @@ struct tests
|
|||
NOKEYS = 104, // Wait until keys buffer is empty
|
||||
REFRESH = 105, // Wait until there is a screen refresh
|
||||
|
||||
KEYSYNC = 106,
|
||||
KEYSYNC = 106, // Wait for other side to process keys
|
||||
EXIT_PGM = 142, // Exiting program
|
||||
};
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue