From patchwork Thu Feb 7 19:41:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Al-Gaaf X-Patchwork-Id: 2113001 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D8418DFB7B for ; Thu, 7 Feb 2013 19:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030260Ab3BGTmQ (ORCPT ); Thu, 7 Feb 2013 14:42:16 -0500 Received: from wp188.webpack.hosteurope.de ([80.237.132.195]:33794 "EHLO wp188.webpack.hosteurope.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932196Ab3BGTmJ (ORCPT ); Thu, 7 Feb 2013 14:42:09 -0500 Received: from nat.nue.novell.com ([195.135.221.2] helo=darkangel.suse.de); authenticated by wp188.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1U3XMD-0003IZ-K8; Thu, 07 Feb 2013 20:42:05 +0100 From: Danny Al-Gaaf To: ceph-devel@vger.kernel.org Cc: Danny Al-Gaaf , Sage Weil Subject: [PATCH 01/15] kv_flat_btree_async.cc: use vector instead of VLA's Date: Thu, 7 Feb 2013 20:41:49 +0100 Message-Id: <1360266123-28972-2-git-send-email-danny.al-gaaf@bisect.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360266123-28972-1-git-send-email-danny.al-gaaf@bisect.de> References: <1360266123-28972-1-git-send-email-danny.al-gaaf@bisect.de> X-bounce-key: webpack.hosteurope.de; danny.al-gaaf@bisect.de; 1360266129; 8c896243; Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Fix "variable length array of non-POD element type" errors caused by using librados::ObjectWriteOperation VLAs. (-Wvla) Signed-off-by: Danny Al-Gaaf --- src/key_value_store/kv_flat_btree_async.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc index 96c6cb0..4342e70 100644 --- a/src/key_value_store/kv_flat_btree_async.cc +++ b/src/key_value_store/kv_flat_btree_async.cc @@ -1119,9 +1119,9 @@ int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &errno) { //all changes were created except for updating the index and possibly //deleting the objects. roll forward. vector, librados::ObjectWriteOperation*> > ops; - librados::ObjectWriteOperation owos[idata.to_delete.size() + 1]; + vector owos(idata.to_delete.size() + 1); for (int i = 0; i <= (int)idata.to_delete.size(); ++i) { - ops.push_back(make_pair(pair(0, ""), &owos[i])); + ops.push_back(make_pair(pair(0, ""), owos[i])); } set_up_ops(vector(), vector(), &ops, idata, &err); @@ -1883,23 +1883,23 @@ int KvFlatBtreeAsync::set_many(const map &in_map) { to_create[to_create.size() - 1].max_kdata = to_delete[to_delete.size() - 1].max_kdata; - librados::ObjectWriteOperation owos[2 + 2 * to_delete.size() - + to_create.size()]; + vector owos(2 + 2 * to_delete.size() + + to_create.size()); vector, librados::ObjectWriteOperation*> > ops; index_data idata; - set_up_prefix_index(to_create, to_delete, &owos[0], &idata, &err); + set_up_prefix_index(to_create, to_delete, owos[0], &idata, &err); if (verbose) cout << "finished making to_create and to_delete. " << std::endl; ops.push_back(make_pair( pair(ADD_PREFIX, index_name), - &owos[0])); + owos[0])); for (int i = 1; i < 2 + 2 * (int)to_delete.size() + (int)to_create.size(); i++) { - ops.push_back(make_pair(make_pair(0,""), &owos[i])); + ops.push_back(make_pair(make_pair(0,""), owos[i])); } set_up_ops(to_create, to_delete, &ops, idata, &err);