From: Dmitry Selyutin Date: Thu, 21 Sep 2023 20:00:59 +0000 (+0300) Subject: caveat: introduce header guards X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5394b37dc8825ce618f6fc117318ae5724ac6162;p=cavatools.git caveat: introduce header guards --- diff --git a/caveat/arith.h b/caveat/arith.h index 4757e84..86bc825 100644 --- a/caveat/arith.h +++ b/caveat/arith.h @@ -2,6 +2,7 @@ Copyright (c) 2020 Peter Hsu. All Rights Reserved. See LICENCE file for details. */ +#pragma once #define F32_SIGN (0x1 << 31) #define F64_SIGN (0x1L << 63) diff --git a/caveat/caveat.h b/caveat/caveat.h index 953d40b..44b94c9 100644 --- a/caveat/caveat.h +++ b/caveat/caveat.h @@ -2,8 +2,7 @@ Copyright (c) 2020 Peter Hsu. All Rights Reserved. See LICENCE file for details. */ -#ifndef CAVEAT_H -#define CAVEAT_H +#pragma once /* Caveat trace records are a kind of instruction set with a 7-bit 'opcode'. @@ -175,7 +174,3 @@ extern const char* usage; void help_exit(); int parse_options( const char** argv ); - - - -#endif diff --git a/caveat/caveat_fp.h b/caveat/caveat_fp.h index 2141c0e..41d171a 100644 --- a/caveat/caveat_fp.h +++ b/caveat/caveat_fp.h @@ -1,3 +1,5 @@ +#pragma once + #define SOFT_FP #ifndef NO_FP_MACROS #define FMADD32( rm, rd, rs1, rs2, rs3) SRM(rm); FR(rd).f32 = f32_mulAdd( F32(rs1), F32(rs2), F32(rs3)); SET_FPX; SRM(cpu->state.fcsr.rmode); diff --git a/caveat/core.h b/caveat/core.h index 4879c3e..58cad22 100644 --- a/caveat/core.h +++ b/caveat/core.h @@ -2,6 +2,7 @@ Copyright (c) 2020 Peter Hsu. All Rights Reserved. See LICENCE file for details. */ +#pragma once #define sex(rd) IR(rd).l = IR(rd).l << 32 >> 32 #define zex(rd) IR(rd).ul = IR(rd).ul << 32 >> 32 @@ -61,4 +62,3 @@ void slow_sim(struct core_t*, long max_count); int proxy_ecall( struct core_t* cpu ); void proxy_csr( struct core_t* cpu, const struct insn_t* p, int which ); void status_report(struct core_t* cpu, FILE*); - diff --git a/caveat/insn.h b/caveat/insn.h index 9089d2b..abee30e 100644 --- a/caveat/insn.h +++ b/caveat/insn.h @@ -2,6 +2,8 @@ Copyright (c) 2020 Peter Hsu. All Rights Reserved. See LICENCE file for details. */ +#pragma once + #ifdef __cplusplus extern "C" { #endif diff --git a/caveat/shmfifo.h b/caveat/shmfifo.h index a382e09..1a4afe0 100644 --- a/caveat/shmfifo.h +++ b/caveat/shmfifo.h @@ -2,6 +2,8 @@ Copyright (c) 2020 Peter Hsu. All Rights Reserved. See LICENCE file for details. */ +#pragma once + #include #include #include diff --git a/caveat/sim_body.h b/caveat/sim_body.h index 686713f..6d2d7ed 100644 --- a/caveat/sim_body.h +++ b/caveat/sim_body.h @@ -1,9 +1,6 @@ // See LICENSE for license details. - -#ifndef SIM_BODY_H -#define SIM_BODY_H - +#pragma once #define IR(rn) cpu->reg[rn] #define FR(rn) cpu->reg[rn] @@ -114,6 +111,3 @@ inline float64_t NF64(int rn) { float64_t x=F64(rn); x.v^=F64_SIGN; return x; } cpu->pc = PC; // program counter cached in register cpu->counter.insn_executed += max_count-countdown; } - - -#endif