From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2041) id D75003858D1E; Fri, 30 Sep 2022 05:08:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D75003858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664514484; bh=67aLRpDlvwI+r7/E79PoVhd79gt2WFMMtKU4Qo90X5U=; h=From:To:Subject:Date:From; b=H0Y3e/5EO83iW42VAj5ZmtZUSIH2K1yzoVaTVQe6X4BV43Oc59Dpr7cucDA6KgNET jAhUbkMRIS/pPBv1aCD+3pJBIW3AOrjs2BAE8dIm4bMwgyYzXM843NeJSMTxJeDvSU LQXYxIQBVhqf+LPEG9tBFFIxYlF9Ik2xY7f/H/t0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Vladimir Mezentsev To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] gprofng: fix cppcheck warnings X-Act-Checkin: binutils-gdb X-Git-Author: Vladimir Mezentsev X-Git-Refname: refs/heads/master X-Git-Oldrev: 1d4c108cec2b50bde92d269c34b79d0d19949630 X-Git-Newrev: 0d94a8735055432029237612a6eb9165db1ec9dd Message-Id: <20220930050804.D75003858D1E@sourceware.org> Date: Fri, 30 Sep 2022 05:08:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D0d94a8735055= 432029237612a6eb9165db1ec9dd commit 0d94a8735055432029237612a6eb9165db1ec9dd Author: Vladimir Mezentsev Date: Thu Sep 29 13:30:42 2022 -0700 gprofng: fix cppcheck warnings =20 gprofng/ChangeLog 2022-09-29 Vladimir Mezentsev =20 * common/hwcdrv.c: Fix cppcheck warning. * src/ABS.h: Likewise. * src/CompCom.cc: Likewise. Diff: --- gprofng/common/hwcdrv.c | 2 +- gprofng/src/ABS.h | 2 +- gprofng/src/CompCom.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gprofng/common/hwcdrv.c b/gprofng/common/hwcdrv.c index 05390e239df..03c3a71c8e2 100644 --- a/gprofng/common/hwcdrv.c +++ b/gprofng/common/hwcdrv.c @@ -696,7 +696,7 @@ init_perf_event (struct perf_event_attr *hw, uint64_t e= vent, uint64_t period) #endif =20 hw->sample_period =3D period; - hw->sample_type =3D PERF_SAMPLE_IP | PERF_SAMPLE_READ | + hw->sample_type =3D PERF_SAMPLE_IP | // PERF_SAMPLE_TID | // PERF_SAMPLE_TIME | // possibly interesting // PERF_SAMPLE_ADDR | diff --git a/gprofng/src/ABS.h b/gprofng/src/ABS.h index a5bcbea16b6..c4552d81e5b 100644 --- a/gprofng/src/ABS.h +++ b/gprofng/src/ABS.h @@ -53,7 +53,7 @@ extern char *ABS_PP_CODES[NUM_ABS_PP_CODES]; /* dbe should check HWC values for errors */ #define HWCVAL_ERR_FLAG (1ULL<<63) #define HWCVAL_SET_ERR(ctr) ((ctr) | HWCVAL_ERR_FLAG) -#define HWCVAL_HAS_ERR(ctr) ((ctr) & HWCVAL_ERR_FLAG ? 1 : 0) +#define HWCVAL_HAS_ERR(ctr) (((ctr) & HWCVAL_ERR_FLAG) !=3D 0) #define HWCVAL_CLR_ERR(ctr) ((ctr) & ~HWCVAL_ERR_FLAG) =20 #define ABS_GET_RT_CODE(EA) ((EA) & 0x0FLL) diff --git a/gprofng/src/CompCom.cc b/gprofng/src/CompCom.cc index 3a035a9e7f7..14d6fc39a60 100644 --- a/gprofng/src/CompCom.cc +++ b/gprofng/src/CompCom.cc @@ -305,7 +305,7 @@ CompComment::compcom_format (int index, compmsg *msg, i= nt &visible) for (int i =3D 0; i < plist_idx - 1; i++) { prim_ty =3D ccm_param_primtype (msg->msg_type, i + 1); - if (prim_ty =3D=3D CCM_PRIMTYPE_STRING || prim_ty =3D=3D CCM_PRIMTYPE_S= TRING) + if (prim_ty =3D=3D CCM_PRIMTYPE_STRING) free (parms[i]); } }