[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/25] Use bool for tracing variables
From: |
Richard Henderson |
Subject: |
[PATCH v3 01/25] Use bool for tracing variables |
Date: |
Thu, 21 May 2020 19:34:16 -0700 |
Reviewed-by: Alex Bennée <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
risu.h | 3 ++-
reginfo.c | 2 +-
risu.c | 8 ++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/risu.h b/risu.h
index 8d2d646..e2b4508 100644
--- a/risu.h
+++ b/risu.h
@@ -17,6 +17,7 @@
#include <ucontext.h>
#include <stdio.h>
#include <getopt.h>
+#include <stdbool.h>
/* Extra option processing for architectures */
extern const struct option * const arch_long_opts;
@@ -96,7 +97,7 @@ int recv_and_compare_register_info(read_fn read_fn,
* Should return 0 if it was a good match (ie end of test)
* and 1 for a mismatch.
*/
-int report_match_status(int trace);
+int report_match_status(bool trace);
/* Interface provided by CPU-specific code: */
diff --git a/reginfo.c b/reginfo.c
index dd42ae2..1b2a821 100644
--- a/reginfo.c
+++ b/reginfo.c
@@ -141,7 +141,7 @@ int recv_and_compare_register_info(read_fn read_fn,
* Should return 0 if it was a good match (ie end of test)
* and 1 for a mismatch.
*/
-int report_match_status(int trace)
+int report_match_status(bool trace)
{
int resp = 0;
fprintf(stderr, "match status...\n");
diff --git a/risu.c b/risu.c
index 01525d2..79b1092 100644
--- a/risu.c
+++ b/risu.c
@@ -31,7 +31,7 @@
void *memblock;
int apprentice_fd, master_fd;
-int trace;
+bool trace;
size_t signal_count;
#ifdef HAVE_ZLIB
@@ -228,7 +228,7 @@ int master(void)
signal_count);
return 0;
} else {
- return report_match_status(0);
+ return report_match_status(false);
}
}
set_sigill_handler(&master_sigill);
@@ -250,7 +250,7 @@ int apprentice(void)
#endif
close(apprentice_fd);
fprintf(stderr, "finished early after %zd checkpoints\n",
signal_count);
- return report_match_status(1);
+ return report_match_status(true);
}
set_sigill_handler(&apprentice_sigill);
fprintf(stderr, "starting apprentice image at 0x%"PRIxPTR"\n",
@@ -344,7 +344,7 @@ int main(int argc, char **argv)
break;
case 't':
trace_fn = optarg;
- trace = 1;
+ trace = true;
break;
case 'h':
hostname = optarg;
--
2.20.1
- [PATCH v3 00/25] risu cleanups and improvements, Richard Henderson, 2020/05/21
- [PATCH v3 01/25] Use bool for tracing variables,
Richard Henderson <=
- [PATCH v3 02/25] Unify master_fd and apprentice_fd to comm_fd, Richard Henderson, 2020/05/21
- [PATCH v3 03/25] Hoist trace file and socket opening, Richard Henderson, 2020/05/21
- [PATCH v3 04/25] Adjust tracefile open for write, Richard Henderson, 2020/05/21
- [PATCH v3 05/25] Use EXIT_FAILURE, EXIT_SUCCESS, Richard Henderson, 2020/05/21
- [PATCH v3 06/25] Make some risu.c symbols static, Richard Henderson, 2020/05/21
- [PATCH v3 08/25] Add enum RisuResult, Richard Henderson, 2020/05/21
- [PATCH v3 07/25] Add enum RisuOp, Richard Henderson, 2020/05/21
- [PATCH v3 09/25] Unify i/o functions and use RisuResult, Richard Henderson, 2020/05/21
- [PATCH v3 10/25] Pass non-OK result back through siglongjmp, Richard Henderson, 2020/05/21
- [PATCH v3 11/25] Always write for --master, Richard Henderson, 2020/05/21