a68: remove superfluous code detected by cppcheck [PR algol68/122954]

This commits fixes three instances of harmless but redundant code,
detected by cppcheck.

gcc/algol68/ChangeLog

	PR algol68/122954
	* a68-low-clauses.cc (serial_clause_dsa): Avoid redundant
	initialization.
	* a68-parser-modes.cc (compute_derived_modes): Likewise.
	* a68-low.cc (a68_lower_tree): Remove redundant break.
This commit is contained in:
Jose E. Marchesi
2025-12-02 11:06:45 +01:00
parent aa8b01d796
commit f76e54a7cf
3 changed files with 2 additions and 6 deletions

View File

@@ -58,9 +58,7 @@
static bool
serial_clause_dsa (NODE_T *p)
{
NODE_T *s = NEXT (SUB (p));
for (s = p; SUB (s) && IS (s, SERIAL_CLAUSE); s = SUB (s))
for (NODE_T *s = p; SUB (s) && IS (s, SERIAL_CLAUSE); s = SUB (s))
{
if (DYNAMIC_STACK_ALLOCS (s))
return true;

View File

@@ -1479,7 +1479,6 @@ a68_lower_tree (NODE_T *p, LOW_CTX_T ctx)
case PACKET:
res = lower_packet (p, ctx);
break;
break;
case PRELUDE_PACKET:
res = lower_prelude_packet (p, ctx);
break;

View File

@@ -1202,10 +1202,9 @@ compute_derived_modes (MODULE_T *mod)
for (; s != NO_PACK; FORWARD (s))
{
PACK_T *t = NEXT (s);
bool x = true;
for (t = NEXT (s); t != NO_PACK && x; FORWARD (t))
for (PACK_T *t = NEXT (s); t != NO_PACK && x; FORWARD (t))
{
if (TEXT (s) == TEXT (t))
{