Skip to content

Commit 2cf0b46

Browse files
committed
libedit: remove redundant break statements after EL_ABORT
1 parent d8567e8 commit 2cf0b46

5 files changed

Lines changed: 10 additions & 17 deletions

File tree

lib/libedit/el.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: el.c,v 1.101 2022/10/30 19:11:31 christos Exp $ */
1+
/* $NetBSD: el.c,v 1.102 2025/01/03 00:40:08 rillig Exp $ */
22

33
/*-
44
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
3737
#if 0
3838
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
3939
#else
40-
__RCSID("$NetBSD: el.c,v 1.101 2022/10/30 19:11:31 christos Exp $");
40+
__RCSID("$NetBSD: el.c,v 1.102 2025/01/03 00:40:08 rillig Exp $");
4141
#endif
4242
#endif /* not lint && not SCCSID */
4343

@@ -274,7 +274,6 @@ el_wset(EditLine *el, int op, ...)
274274
default:
275275
rv = -1;
276276
EL_ABORT((el->el_errfile, "Bad op %d\n", op));
277-
break;
278277
}
279278
break;
280279
}

lib/libedit/el.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: el.h,v 1.47 2024/05/17 02:59:08 christos Exp $ */
1+
/* $NetBSD: el.h,v 1.48 2025/01/03 00:40:08 rillig Exp $ */
22

33
/*-
44
* Copyright (c) 1992, 1993
@@ -153,7 +153,7 @@ libedit_private EditLine *el_init_internal(const char *, FILE *, FILE *,
153153
__FILE__, __LINE__); \
154154
fprintf a; \
155155
abort(); \
156-
} while( /*CONSTCOND*/0);
156+
} while (0)
157157
#else
158158
#define EL_ABORT(a) abort()
159159
#endif

lib/libedit/keymacro.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: keymacro.c,v 1.24 2019/07/23 10:18:52 christos Exp $ */
1+
/* $NetBSD: keymacro.c,v 1.25 2025/01/03 00:40:08 rillig Exp $ */
22

33
/*-
44
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
3737
#if 0
3838
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
3939
#else
40-
__RCSID("$NetBSD: keymacro.c,v 1.24 2019/07/23 10:18:52 christos Exp $");
40+
__RCSID("$NetBSD: keymacro.c,v 1.25 2025/01/03 00:40:08 rillig Exp $");
4141
#endif
4242
#endif /* not lint && not SCCSID */
4343

@@ -346,7 +346,6 @@ node__try(EditLine *el, keymacro_node_t *ptr, const wchar_t *str,
346346
default:
347347
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n",
348348
ptr->type));
349-
break;
350349
}
351350

352351
switch (ptr->type = ntype) {
@@ -359,7 +358,6 @@ node__try(EditLine *el, keymacro_node_t *ptr, const wchar_t *str,
359358
break;
360359
default:
361360
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype));
362-
break;
363361
}
364362
} else {
365363
/* still more chars to go */
@@ -444,7 +442,6 @@ node__put(EditLine *el, keymacro_node_t *ptr)
444442
break;
445443
default:
446444
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ptr->type));
447-
break;
448445
}
449446
el_free(ptr);
450447
}
@@ -614,7 +611,6 @@ keymacro_kprint(EditLine *el, const wchar_t *key, keymacro_value_t *val,
614611
break;
615612
default:
616613
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype));
617-
break;
618614
}
619615
else
620616
(void) fprintf(el->el_outfile, fmt, ct_encode_string(key,

lib/libedit/map.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: map.c,v 1.55 2022/10/30 19:11:31 christos Exp $ */
1+
/* $NetBSD: map.c,v 1.56 2025/01/03 00:40:08 rillig Exp $ */
22

33
/*-
44
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
3737
#if 0
3838
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
3939
#else
40-
__RCSID("$NetBSD: map.c,v 1.55 2022/10/30 19:11:31 christos Exp $");
40+
__RCSID("$NetBSD: map.c,v 1.56 2025/01/03 00:40:08 rillig Exp $");
4141
#endif
4242
#endif /* not lint && not SCCSID */
4343

@@ -1390,7 +1390,6 @@ map_bind(EditLine *el, int argc, const wchar_t **argv)
13901390
/* coverity[dead_error_begin] */
13911391
default:
13921392
EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype));
1393-
break;
13941393
}
13951394
return 0;
13961395
}

lib/libedit/read.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: read.c,v 1.108 2022/10/30 19:11:31 christos Exp $ */
1+
/* $NetBSD: read.c,v 1.109 2025/01/03 00:40:08 rillig Exp $ */
22

33
/*-
44
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
3737
#if 0
3838
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
3939
#else
40-
__RCSID("$NetBSD: read.c,v 1.108 2022/10/30 19:11:31 christos Exp $");
40+
__RCSID("$NetBSD: read.c,v 1.109 2025/01/03 00:40:08 rillig Exp $");
4141
#endif
4242
#endif /* not lint && not SCCSID */
4343

@@ -265,7 +265,6 @@ read_getcmd(EditLine *el, el_action_t *cmdnum, wchar_t *ch)
265265
return -1;
266266
default:
267267
EL_ABORT((el->el_errfile, "Bad XK_ type \n"));
268-
break;
269268
}
270269
}
271270
} while (cmd == ED_SEQUENCE_LEAD_IN);

0 commit comments

Comments
 (0)