From patchwork Fri Oct 19 21:08:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 192811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "acsinet15.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id AD45E2C037D for ; Sat, 20 Oct 2012 08:08:39 +1100 (EST) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9JL8Zku012216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Oct 2012 21:08:35 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q9JL8YA9000330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Oct 2012 21:08:35 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TPJo2-0007Ho-Qn; Fri, 19 Oct 2012 14:08:34 -0700 Received: from ucsinet22.oracle.com ([156.151.31.94]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TPJo0-0007Hf-7f for fedfs-utils-devel@oss.oracle.com; Fri, 19 Oct 2012 14:08:32 -0700 Received: from acsinet11.oracle.com (acsinet11.oracle.com [141.146.126.233]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q9JL8V4I026781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Oct 2012 21:08:31 GMT Received: from mail-ia0-f171.google.com (mail-ia0-f171.google.com [209.85.210.171]) by acsinet11.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9JL7bV6005718 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 19 Oct 2012 21:08:30 GMT Received: by mail-ia0-f171.google.com with SMTP id u21so674450ial.2 for ; Fri, 19 Oct 2012 14:08:30 -0700 (PDT) Received: by 10.50.51.194 with SMTP id m2mr2794985igo.53.1350680910433; Fri, 19 Oct 2012 14:08:30 -0700 (PDT) Received: from seurat.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id us4sm16664470igc.9.2012.10.19.14.08.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Oct 2012 14:08:29 -0700 (PDT) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Fri, 19 Oct 2012 17:08:28 -0400 Message-ID: <20121019210828.53119.2892.stgit@seurat.1015granger.net> In-Reply-To: <20121019210357.53119.28925.stgit@seurat.1015granger.net> References: <20121019210357.53119.28925.stgit@seurat.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Flow-Control-Info: class=Default reputation=ipRepBelow100 ip=209.85.210.171 ct-class=G1 ct-vol1=0 ct-vol2=0 ct-vol3=0 ct-risk=0 ct-spam1=0 ct-spam2=0 ct-bulk=0 rcpts=1 size=3035 X-MM-CT-Classification: not spam X-MM-CT-RefID: str=0001.0A090203.5081C14E.00FB,ss=1,re=0.000,fgs=0 Subject: [fedfs-utils] [PATCH 06/11] libnsdb: Clean up some sparse warnings X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] Address the following sparse warnings in libnsdb.so: nsdb.c:76:6: warning: symbol 'fedfs_base_dirname' was not declared. Should it be static? nsdb.c:87:6: warning: symbol 'fedfs_nsdbcerts_dirname' was not declared. Should it be static? nsdb.c:231:70: warning: Using plain integer as NULL pointer sqlite.c:161:69: warning: Using plain integer as NULL pointer sqlite.c:184:60: warning: Using plain integer as NULL pointer sqlite.c:206:62: warning: Using plain integer as NULL pointer Introduced by commit 0520ee72 "Initial commit" March 29, 2011. Signed-off-by: Chuck Lever --- src/libnsdb/nsdb.c | 7 ++++--- src/libnsdb/sqlite.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libnsdb/nsdb.c b/src/libnsdb/nsdb.c index 4b35544..46b7845 100644 --- a/src/libnsdb/nsdb.c +++ b/src/libnsdb/nsdb.c @@ -73,7 +73,7 @@ /** * Stores pathname of directory containing FedFS persistent state */ -char fedfs_base_dirname[PATH_MAX + 1] = +static char fedfs_base_dirname[PATH_MAX + 1] = FEDFS_DEFAULT_STATEDIR; /** @@ -84,7 +84,7 @@ char fedfs_base_dirname[PATH_MAX + 1] = /** * Stores pathname of directory containing NSDB x509v3 certs */ -char fedfs_nsdbcerts_dirname[PATH_MAX + 1] = +static char fedfs_nsdbcerts_dirname[PATH_MAX + 1] = FEDFS_DEFAULT_STATEDIR "/" FEDFS_NSDBCERT_DIR; /** @@ -228,7 +228,8 @@ nsdb_init_database(void) * This provides better performance and crash robustness. */ err_msg = NULL; - rc = sqlite3_exec(db, "PRAGMA journal_mode=TRUNCATE;", NULL, 0, &err_msg); + rc = sqlite3_exec(db, "PRAGMA journal_mode=TRUNCATE;", + NULL, NULL, &err_msg); if (rc != SQLITE_OK) { xlog(L_ERROR, "Failed to enable persistent journaling: %s", err_msg); diff --git a/src/libnsdb/sqlite.c b/src/libnsdb/sqlite.c index 398303c..616dce3 100644 --- a/src/libnsdb/sqlite.c +++ b/src/libnsdb/sqlite.c @@ -158,7 +158,8 @@ nsdb_begin_transaction(sqlite3 *db) int rc; err_msg = NULL; - rc = sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION;", NULL, 0, &err_msg); + rc = sqlite3_exec(db, "BEGIN IMMEDIATE TRANSACTION;", + NULL, NULL, &err_msg); if (rc != SQLITE_OK) { xlog(L_ERROR, "Failed to start transaction: %s", err_msg); sqlite3_free(err_msg); @@ -181,7 +182,7 @@ nsdb_end_transaction(sqlite3 *db) int rc; err_msg = NULL; - rc = sqlite3_exec(db, "COMMIT TRANSACTION;", NULL, 0, &err_msg); + rc = sqlite3_exec(db, "COMMIT TRANSACTION;", NULL, NULL, &err_msg); if (rc != SQLITE_OK) { xlog(L_ERROR, "Failed to commit transaction: %s", err_msg); sqlite3_free(err_msg); @@ -203,7 +204,7 @@ nsdb_rollback_transaction(sqlite3 *db) int rc; err_msg = NULL; - rc = sqlite3_exec(db, "ROLLBACK TRANSACTION;", NULL, 0, &err_msg); + rc = sqlite3_exec(db, "ROLLBACK TRANSACTION;", NULL, NULL, &err_msg); if (rc != SQLITE_OK) { xlog(L_ERROR, "Failed to roll back transaction: %s", err_msg); sqlite3_free(err_msg);