summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-02-05 23:52:25 +0100
committerGary Lowell <glowell@inktank.com>2013-02-05 19:29:10 -0800
commit25037fcc3509e5e1cba634cbcbf5b3718544779c (patch)
treeb35219d1dace74d383936887372ffc0eefefb43f
parent4b315535cd2b41b92e06e551a5eee7f5473e3ffa (diff)
downloadceph-25037fcc3509e5e1cba634cbcbf5b3718544779c.tar.gz
obj_bencher.cc: use vector instead of VLA's
Fix "variable length array of non-POD element type" error. (-Wvla) Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/common/obj_bencher.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/common/obj_bencher.cc b/src/common/obj_bencher.cc
index 74d54e16c90..d75612311ba 100644
--- a/src/common/obj_bencher.cc
+++ b/src/common/obj_bencher.cc
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <time.h>
#include <sstream>
+#include <vector>
const std::string BENCH_LASTRUN_METADATA = "benchmark_last_metadata";
@@ -305,11 +306,11 @@ int ObjBencher::write_bench(int secondsToRun, int concurrentios) {
std::string prefix = generate_object_prefix();
out(cout) << "Object prefix: " << prefix << std::endl;
- std::string name[concurrentios];
+ std::vector<string> name(concurrentios);
std::string newName;
bufferlist* contents[concurrentios];
double total_latency = 0;
- utime_t start_times[concurrentios];
+ std::vector<utime_t> start_times(concurrentios);
utime_t stopTime;
int r = 0;
bufferlist b_write;
@@ -493,13 +494,13 @@ int ObjBencher::write_bench(int secondsToRun, int concurrentios) {
int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurrentios, int pid) {
lock_cond lc(&lock);
- std::string name[concurrentios];
+ std::vector<string> name(concurrentios);
std::string newName;
bufferlist* contents[concurrentios];
int index[concurrentios];
int errors = 0;
utime_t start_time;
- utime_t start_times[concurrentios];
+ std::vector<utime_t> start_times(concurrentios);
utime_t time_to_run;
time_to_run.set_from_double(seconds_to_run);
double total_latency = 0;
@@ -705,7 +706,7 @@ int ObjBencher::clean_up(const std::string& prefix, int concurrentios) {
int ObjBencher::clean_up(int num_objects, int prevPid, int concurrentios) {
lock_cond lc(&lock);
- std::string name[concurrentios];
+ std::vector<string> name(concurrentios);
std::string newName;
int r = 0;
utime_t runtime;
@@ -865,7 +866,7 @@ bool ObjBencher::more_objects_matching_prefix(const std::string& prefix, std::li
int ObjBencher::clean_up_slow(const std::string& prefix, int concurrentios) {
lock_cond lc(&lock);
- std::string name[concurrentios];
+ std::vector<string> name(concurrentios);
std::string newName;
int r = 0;
utime_t runtime;