[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RISU 1/9] Use bool for tracing variables
From: |
Richard Henderson |
Subject: |
[RISU 1/9] Use bool for tracing variables |
Date: |
Wed, 13 May 2020 11:09:45 -0700 |
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
- [RISU 0/9] risu cleanups and improvements, Richard Henderson, 2020/05/13
- [RISU 1/9] Use bool for tracing variables,
Richard Henderson <=
- [RISU 2/9] Unify master_fd and apprentice_fd to comm_fd, Richard Henderson, 2020/05/13
- [RISU 3/9] Hoist trace file opening, Richard Henderson, 2020/05/13
- [RISU 6/9] Add magic and size to the trace header, Richard Henderson, 2020/05/13
- [RISU 4/9] Adjust tracefile open for write, Richard Henderson, 2020/05/13
- [RISU 8/9] aarch64: Reorg sve reginfo to save space, Richard Henderson, 2020/05/13
- [RISU 7/9] Compute reginfo_size based on the reginfo, Richard Henderson, 2020/05/13