Skip to content

Commit f55b4b6

Browse files
authored
Merge pull request RedisLabs#103 from computerphilosopher/whitespace
remove unnecessary whitespaces
2 parents 9d8b43a + 51b7ba7 commit f55b4b6

14 files changed

+115
-115
lines changed

JSON_handler.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ json_handler::json_handler(const char * jsonfilename) : m_json_file(NULL)
3434
m_json_file = fopen(jsonfilename, "w");
3535
if (!m_json_file) {
3636
perror(jsonfilename);
37-
}
37+
}
3838
// opening the JSON
3939
fprintf(stderr, "Json file %s created...\n", jsonfilename);
40-
fprintf(m_json_file,"{");
40+
fprintf(m_json_file,"{");
4141
m_nest_closer_types.push_back(NESTED_GENERAL);
42-
beutify();
42+
beutify();
4343
}
4444

4545
/**
@@ -57,7 +57,7 @@ json_handler::~json_handler()
5757
}
5858
}
5959

60-
/**
60+
/**
6161
* Write singel object named objectname to the JSON with values stated in ...
6262
* based on the format defined
6363
* basically uses fprintf with the same parameters.
@@ -73,7 +73,7 @@ void json_handler::write_obj(const char * objectname, const char * format, ...)
7373
fprintf(m_json_file, ",");
7474
}
7575

76-
/**
76+
/**
7777
* Starts a nesting with a title as defined in objectname
7878
* in case objectname == NULL it will not add the title and just start nesting
7979
* The type defines the kind of charecters that will be used
@@ -90,9 +90,9 @@ void json_handler::open_nesting(const char * objectname,eJSON_NESTED_TYPE type /
9090
beutify(false);
9191
}
9292

93-
/**
93+
/**
9494
* Ends the nesting
95-
* Closes the nesting based on the nesting list
95+
* Closes the nesting based on the nesting list
9696
* Returns = the nested levels left after the closing
9797
*/
9898
int json_handler::close_nesting()
@@ -115,7 +115,7 @@ int json_handler::close_nesting()
115115
return m_nest_closer_types.size();
116116
}
117117

118-
/**
118+
/**
119119
* Add tabls and new line (if only_tabs==true will only add tabs)
120120
*/
121121
void json_handler::beutify(bool only_tabs)
@@ -129,5 +129,5 @@ void json_handler::beutify(bool only_tabs)
129129
{
130130
fprintf(m_json_file, "\t");
131131
}
132-
132+
133133
}

JSON_handler.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ typedef enum{
3030
NESTED_ARRAY // []
3131
}eJSON_NESTED_TYPE;
3232

33-
/** represents an JSON handler, At this phase, only writes to JSON. */
33+
/** represents an JSON handler, At this phase, only writes to JSON. */
3434
class json_handler {
3535
protected:
36-
FILE * m_json_file;
36+
FILE * m_json_file;
3737
// This list is used later for closing the nesting
3838
std::list<eJSON_NESTED_TYPE> m_nest_closer_types;
3939
void beutify(bool only_tabs = false);
4040
public:
4141
json_handler(const char * jsonfilename);
4242
~json_handler();
43-
43+
4444
// Write a single object to JSON
4545
void write_obj(const char * objectname, const char * format, ...);
4646

47-
// Starts nesting, the type is used for deciding which charecter to be used for opening and closing
47+
// Starts nesting, the type is used for deciding which charecter to be used for opening and closing
4848
// the nesting ('{}','[]')
4949
void open_nesting(const char * objectname,eJSON_NESTED_TYPE type = NESTED_GENERAL);
50-
50+
5151
// returns the nested level left after closing
5252
int close_nesting();
5353
};

client.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ client::client(struct event_base *event_base, benchmark_config *config,
125125
if (!setup_client(config, protocol, obj_gen)) {
126126
return;
127127
}
128-
128+
129129
benchmark_debug_log("new client %p successfully set up.\n", this);
130130
m_initialized = true;
131131
}
@@ -203,7 +203,7 @@ bool client::finished(void)
203203
return true;
204204
if (m_config->test_time > 0 && m_stats.get_duration() >= m_config->test_time)
205205
return true;
206-
return false;
206+
return false;
207207
}
208208

209209
void client::set_start_time() {
@@ -333,7 +333,7 @@ void client::create_request(struct timeval timestamp, unsigned int conn_id)
333333

334334
assert(key != NULL);
335335
assert(keylen > 0);
336-
336+
337337
m_keylist->add_key(key, keylen);
338338
}
339339

@@ -353,14 +353,14 @@ void client::create_request(struct timeval timestamp, unsigned int conn_id)
353353
} else {
354354
// overlap counters
355355
m_get_ratio_count = m_set_ratio_count = 0;
356-
}
356+
}
357357
}
358358

359359
int client::prepare(void)
360360
{
361361
if (MAIN_CONNECTION == NULL)
362362
return -1;
363-
363+
364364
int ret = this->connect();
365365
if (ret < 0) {
366366
benchmark_error_log("prepare: failed to connect, test aborted.\n");
@@ -522,7 +522,7 @@ bool verify_client::finished(void)
522522

523523
///////////////////////////////////////////////////////////////////////////
524524

525-
client_group::client_group(benchmark_config* config, abstract_protocol *protocol, object_generator* obj_gen) :
525+
client_group::client_group(benchmark_config* config, abstract_protocol *protocol, object_generator* obj_gen) :
526526
m_base(NULL), m_config(config), m_protocol(protocol), m_obj_gen(obj_gen)
527527
{
528528
m_base = event_base_new();
@@ -561,7 +561,7 @@ int client_group::create_clients(int num)
561561
delete c;
562562
return i;
563563
}
564-
564+
565565
m_clients.push_back(c);
566566
}
567567

@@ -625,14 +625,14 @@ unsigned long int client_group::get_duration_usec(void)
625625
float factor = ((float)(thread_counter - 1) / thread_counter);
626626
duration = factor * duration + (float)(*i)->get_stats()->get_duration_usec() / thread_counter ;
627627
}
628-
628+
629629
return duration;
630630
}
631631

632632
void client_group::merge_run_stats(run_stats* target)
633633
{
634634
assert(target != NULL);
635-
unsigned int iteration_counter = 1;
635+
unsigned int iteration_counter = 1;
636636
for (std::vector<client*>::iterator i = m_clients.begin(); i != m_clients.end(); i++) {
637637
target->merge(*(*i)->get_stats(), iteration_counter++);
638638
}
@@ -649,5 +649,5 @@ void client_group::write_client_stats(const char *prefix)
649649
if (!(*i)->get_stats()->save_csv(filename, m_config)) {
650650
fprintf(stderr, "error: %s: failed to write client stats.\n", filename);
651651
}
652-
}
652+
}
653653
}

config_types.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ config_ratio::config_ratio(const char *ratio_str) :
8484
if (!q || *q != '\0') {
8585
a = b = 0;
8686
return;
87-
}
87+
}
8888
}
8989

9090
config_weight_list::config_weight_list() :
@@ -98,7 +98,7 @@ config_weight_list::config_weight_list(const config_weight_list& copy) :
9898
for (std::vector<weight_item>::const_iterator i = copy.item_list.begin(); i != copy.item_list.end(); i++) {
9999
const weight_item wi = *i;
100100
item_list.push_back(wi);
101-
}
101+
}
102102
next_size_iter = item_list.begin();
103103
}
104104

@@ -111,7 +111,7 @@ config_weight_list& config_weight_list::operator=(const config_weight_list& rhs)
111111
for (std::vector<weight_item>::const_iterator i = rhs.item_list.begin(); i != rhs.item_list.end(); i++) {
112112
const weight_item wi = *i;
113113
item_list.push_back(wi);
114-
}
114+
}
115115
next_size_iter = item_list.begin();
116116
return *this;
117117
}
@@ -184,7 +184,7 @@ const char* config_weight_list::print(char *buf, int buf_len)
184184

185185
*buf = '\0';
186186
for (std::vector<weight_item>::iterator i = item_list.begin(); i != item_list.end(); i++) {
187-
int n = snprintf(buf, buf_len, "%s%u:%u",
187+
int n = snprintf(buf, buf_len, "%s%u:%u",
188188
i != item_list.begin() ? "," : "", i->size, i->weight);
189189
buf += n;
190190
buf_len -= n;

config_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct config_weight_list {
5151
unsigned int size;
5252
unsigned int weight;
5353
};
54-
54+
5555
std::vector<weight_item> item_list;
5656
std::vector<weight_item>::iterator next_size_iter;
5757
unsigned int next_size_weight;
@@ -60,7 +60,7 @@ struct config_weight_list {
6060
config_weight_list(const char* str);
6161
config_weight_list(const config_weight_list& copy);
6262
config_weight_list& operator=(const config_weight_list& rhs);
63-
63+
6464
bool is_defined(void);
6565
unsigned int largest(void);
6666
const char *print(char *buf, int buf_len);

0 commit comments

Comments
 (0)