From 5e1f1055e1350d17f760db2c14f9a97986548ae0 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 19 Feb 2026 22:41:03 -0800 Subject: [PATCH] Add more const declarations --- net_link.cc | 4 ++-- vvp/compile.cc | 6 +++--- vvp/vpi_priv.cc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net_link.cc b/net_link.cc index ae638621f..039428ae9 100644 --- a/net_link.cc +++ b/net_link.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2025 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2026 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -131,7 +131,7 @@ Nexus* Link::find_nexus_() const { assert(next_); if (nexus_) return nexus_; - for (Link*cur = next_ ; cur != this ; cur = cur->next_) { + for (const Link*cur = next_ ; cur != this ; cur = cur->next_) { if (cur->nexus_) return cur->nexus_; } return 0; diff --git a/vvp/compile.cc b/vvp/compile.cc index 00821421b..5c0460086 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -408,12 +408,12 @@ vvp_net_t* vvp_net_lookup(const char*label) case vpiIntVar: case vpiLongIntVar: case vpiIntegerVar: { - __vpiSignal*sig = dynamic_cast<__vpiSignal*>(vpi); + const __vpiSignal*sig = dynamic_cast<__vpiSignal*>(vpi); return sig->node; } case vpiRealVar: { - __vpiRealVar*sig = dynamic_cast<__vpiRealVar*>(vpi); + const __vpiRealVar*sig = dynamic_cast<__vpiRealVar*>(vpi); return sig->net; } @@ -425,7 +425,7 @@ vvp_net_t* vvp_net_lookup(const char*label) } case vpiNamedEvent: { - __vpiNamedEvent*tmp = dynamic_cast<__vpiNamedEvent*>(vpi); + const __vpiNamedEvent*tmp = dynamic_cast<__vpiNamedEvent*>(vpi); return tmp->funct; } diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index 3c5f0d5e4..823c13951 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -521,7 +521,7 @@ char* vpi_get_str(PLI_INT32 property, vpiHandle ref) __vpiScope*vpip_timescale_scope_from_handle(vpiHandle obj) { - struct __vpiSysTaskCall*task; + const struct __vpiSysTaskCall*task; struct __vpiSignal*signal; struct __vpiRealVar*real; const __vpiNamedEvent*event;