Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: reduce indentation of typeok_shift
details: https://anonhg.NetBSD.org/src/rev/1d808b775bc1
branches: trunk
changeset: 961037:1d808b775bc1
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Apr 06 21:35:25 2021 +0000
description:
lint: reduce indentation of typeok_shift
No functional change.
diffstat:
usr.bin/xlint/lint1/tree.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diffs (55 lines):
diff -r c587237ec675 -r 1d808b775bc1 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Tue Apr 06 21:32:57 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Tue Apr 06 21:35:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.269 2021/04/06 21:32:57 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.270 2021/04/06 21:35:25 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.269 2021/04/06 21:32:57 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.270 2021/04/06 21:35:25 rillig Exp $");
#endif
#include <float.h>
@@ -900,21 +900,21 @@
static void
typeok_shift(tspec_t lt, const tnode_t *rn, tspec_t rt)
{
- if (rn->tn_op == CON) {
- if (!is_uinteger(rt) && rn->tn_val->v_quad < 0) {
- /* negative shift */
- warning(121);
- } else if ((uint64_t)rn->tn_val->v_quad ==
- (uint64_t)size_in_bits(lt)) {
- /* shift equal to size of object */
- warning(267);
- } else if ((uint64_t)rn->tn_val->v_quad >
- (uint64_t)size_in_bits(lt)) {
- /* shift amount %llu is greater than bit-size %llu of '%s' */
- warning(122, (unsigned long long)rn->tn_val->v_quad,
- (unsigned long long)size_in_bits(lt),
- tspec_name(lt));
- }
+ if (rn->tn_op != CON)
+ return;
+
+ if (!is_uinteger(rt) && rn->tn_val->v_quad < 0) {
+ /* negative shift */
+ warning(121);
+ } else if ((uint64_t)rn->tn_val->v_quad ==
+ (uint64_t)size_in_bits(lt)) {
+ /* shift equal to size of object */
+ warning(267);
+ } else if ((uint64_t)rn->tn_val->v_quad > (uint64_t)size_in_bits(lt)) {
+ /* shift amount %llu is greater than bit-size %llu of '%s' */
+ warning(122, (unsigned long long)rn->tn_val->v_quad,
+ (unsigned long long)size_in_bits(lt),
+ tspec_name(lt));
}
}
Home |
Main Index |
Thread Index |
Old Index