[PATCH 2/3] NF example / bindings: use bool where appropriate |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- Subject: [PATCH 2/3] NF example / bindings: use bool where appropriate
- From: Eero Tamminen <oak@xxxxxxxxxxxxxx>
- Date: Thu, 28 May 2020 01:33:00 +0300
---
tests/natfeats/natfeats.c | 12 ++++++------
tests/natfeats/natfeats.h | 9 ++++++---
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/tests/natfeats/natfeats.c b/tests/natfeats/natfeats.c
index 0b455b85..e644622d 100644
--- a/tests/natfeats/natfeats.c
+++ b/tests/natfeats/natfeats.c
@@ -1,7 +1,7 @@
/*
* natfeat.c - NatFeats API examples
*
- * Copyright (c) 2014-2016, 2019 by Eero Tamminen
+ * Copyright (c) 2014-2016, 2019-2020 by Eero Tamminen
*
* NF initialization & calling is based on EmuTOS code,
* Copyright (c) 2001-2003 The EmuTOS development team
@@ -87,23 +87,23 @@ long nf_print(const char *text)
}
}
-long nf_debugger(void)
+bool nf_debugger(void)
{
if (nfid_debugger) {
return nf_call(nfid_debugger);
} else {
(void)Cconws("NF_DEBUGGER unavailable!\r\n");
- return 0;
+ return false;
}
}
-long nf_fastforward(long enabled)
+bool nf_fastforward(bool enabled)
{
if (nfid_fastforward) {
- return nf_call(nfid_fastforward, enabled);
+ return nf_call(nfid_fastforward, (long)enabled);
} else {
(void)Cconws("NF_FASTFORWARD unavailable!\r\n");
- return 0;
+ return false;
}
}
diff --git a/tests/natfeats/natfeats.h b/tests/natfeats/natfeats.h
index 6c815e79..9ffa2b19 100644
--- a/tests/natfeats/natfeats.h
+++ b/tests/natfeats/natfeats.h
@@ -10,6 +10,8 @@
#ifndef _NATFEAT_H
#define _NATFEAT_H
+#include <stdbool.h>
+
/* AHCC uses registers to pass arguments, but
* NatFeats calls expect arguments to be in stack.
* "cdecl" can be used to declare that arguments
@@ -65,15 +67,16 @@ extern long nf_print(const char *text);
/**
* invoke emulator debugger
* (Hatari specific, can be used e.g. in asserts)
+ * returns true on debugger invocation
*/
-extern long nf_debugger(void);
+extern bool nf_debugger(void);
/**
- * set emulator fastforward mode on (1) or off (0)
+ * set emulator fastforward mode on (true) or off (false)
* (Hatari specific)
* returns previous value
*/
-extern long nf_fastforward(long enabled);
+extern bool nf_fastforward(bool enabled);
/**
* terminate the execution of the emulation if possible
--
2.20.1
--------------6BD8094804F7DEED823E40A9
Content-Type: text/x-patch; charset=UTF-8;
name="0001-Return-error-message-from-ScreenSnapShot_SaveToFile.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0001-Return-error-message-from-ScreenSnapShot_SaveToFile.pat";
filename*1="ch"