From edb87ca96d6f6456971452083cb2e391a48f71bc Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Thu, 11 Oct 2018 21:17:30 +0200 Subject: [PATCH] clang: fix some more warnings in xattr code --- core/src/filed/fd_plugins.cc | 2 +- core/src/findlib/xattr.cc | 6 +++--- core/src/plugins/filed/example-plugin-fd.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/filed/fd_plugins.cc b/core/src/filed/fd_plugins.cc index 7f9bf3fa224..8e964e8c062 100644 --- a/core/src/filed/fd_plugins.cc +++ b/core/src/filed/fd_plugins.cc @@ -1593,7 +1593,7 @@ bxattr_exit_code PluginParseXattrStreams(JobControlRecord *jcr, #if defined(HAVE_XATTR) plugin = (Plugin *)jcr->plugin_ctx->plugin; if (PlugFunc(plugin)->setXattr != NULL) { - xattr_t *current_xattr; + xattr_t *current_xattr = nullptr; struct xattr_pkt xp; xattr_value_list = New(alist(10, not_owned_by_alist)); diff --git a/core/src/findlib/xattr.cc b/core/src/findlib/xattr.cc index 8ffda440b84..8df4e51ae94 100644 --- a/core/src/findlib/xattr.cc +++ b/core/src/findlib/xattr.cc @@ -141,7 +141,7 @@ bxattr_exit_code SendXattrStream(JobControlRecord *jcr, */ void XattrDropInternalTable(alist *xattr_value_list) { - xattr_t *current_xattr; + xattr_t *current_xattr = nullptr; /* * Walk the list of xattrs and free allocated memory on traversing. @@ -183,7 +183,7 @@ uint32_t SerializeXattrStream(JobControlRecord *jcr, uint32_t expected_serialize_len, alist *xattr_value_list) { - xattr_t *current_xattr; + xattr_t *current_xattr = nullptr; ser_declare; /* @@ -1913,7 +1913,7 @@ static bxattr_exit_code bsd_parse_xattr_streams(JobControlRecord *jcr, char *content, uint32_t content_length) { - xattr_t *current_xattr; + xattr_t *current_xattr = nullptr; alist *xattr_value_list; int current_attrnamespace, cnt; char *attrnamespace, *attrname; diff --git a/core/src/plugins/filed/example-plugin-fd.cc b/core/src/plugins/filed/example-plugin-fd.cc index f98b9590680..f28da63296f 100644 --- a/core/src/plugins/filed/example-plugin-fd.cc +++ b/core/src/plugins/filed/example-plugin-fd.cc @@ -201,7 +201,7 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) printf("plugin: BackupEnd\n"); break; case bEventLevel: - printf("plugin: JobLevel=%c %ld\n", (int64_t)value, (int64_t)value); + printf("plugin: JobLevel=%c %ld\n",(int)(int64_t)value, (int64_t)value); break; case bEventSince: printf("plugin: since=%ld\n", (int64_t)value);