From patchwork Thu Oct 25 10:48:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 194113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 4D77B2C00B0 for ; Thu, 25 Oct 2012 21:48:39 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TRKzL-0001w7-2W; Thu, 25 Oct 2012 10:48:35 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TRKzI-0001vi-8o for fwts-devel@lists.ubuntu.com; Thu, 25 Oct 2012 10:48:32 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TRKzI-0002rd-6K for fwts-devel@lists.ubuntu.com; Thu, 25 Oct 2012 10:48:32 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/3] lib: fwts: add FWTS_UNUSED() macro for unused func arguments Date: Thu, 25 Oct 2012 11:48:29 +0100 Message-Id: <1351162111-31669-2-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1351162111-31669-1-git-send-email-colin.king@canonical.com> References: <1351162111-31669-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King I'm hoping to use -Wextra in the near future to ensure code quality is high. Some of the fwts functions such as callbacks and fwts library helper functions take arguments that we ignore. To hint to gcc that we're really ignoring these and to stop -Wextra breaking I'm adding FWTS_UNUSED() to explicitly tell us that the argument is meant to be ignored. Example: void fwts_somefunc(fwts_framework *fw, int dummy) { /* variable declarations here */ FWTS_IGNORED(dummy); /* start of executable statements here */ .. } Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/lib/include/fwts.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h index a1e0fd2..b8d0670 100644 --- a/src/lib/include/fwts.h +++ b/src/lib/include/fwts.h @@ -24,6 +24,8 @@ #define FWTS_ARCH_INTEL 1 #endif +#define FWTS_UNUSED(var) (void)var + #define FWTS_JSON_DATA_PATH "/usr/share/fwts" #include "fwts_version.h"