Skip to content

Commit 1ddb247

Browse files
estliberitasSannis
authored andcommitted
replaced tabs with 4-space indent
1 parent ed75d49 commit 1ddb247

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

src/mysql_bindings_statement.cc

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Handle<Value> MysqlStatement::FetchAllSync(const Arguments& args) {
484484
// Get fields count for binding buffers
485485
unsigned int field_count = mysql_stmt_field_count(stmt->_stmt);
486486

487-
// Get meta data for binding buffers
487+
// Get meta data for binding buffers
488488
MYSQL_RES *meta = mysql_stmt_result_metadata(stmt->_stmt);
489489
MYSQL_FIELD *fields = meta->fields;
490490

@@ -502,30 +502,30 @@ Handle<Value> MysqlStatement::FetchAllSync(const Arguments& args) {
502502
memset(date_data, 0, sizeof(date_data));
503503
memset(bind, 0, sizeof(bind));
504504

505-
unsigned long string_size = 1024
506-
, size = 0;
505+
unsigned long string_size = 1024
506+
, size = 0;
507507

508-
// temp: count min needed size for
509-
while (++i < field_count) {
510-
enum_field_types type = fields[i].type;
511-
if (
512-
type == MYSQL_TYPE_TINY_BLOB ||
513-
type == MYSQL_TYPE_MEDIUM_BLOB ||
508+
// temp: count min needed size for
509+
while (++i < field_count) {
510+
enum_field_types type = fields[i].type;
511+
if (
512+
type == MYSQL_TYPE_TINY_BLOB ||
513+
type == MYSQL_TYPE_MEDIUM_BLOB ||
514514
type == MYSQL_TYPE_LONG_BLOB ||
515515
type == MYSQL_TYPE_BLOB ||
516516
type == MYSQL_TYPE_STRING ||
517517
type == MYSQL_TYPE_VAR_STRING) {
518-
size = fields[i].length;
519-
if (size > string_size) {
520-
string_size = size;
521-
}
522-
}
523-
}
518+
size = fields[i].length;
519+
if (size > string_size) {
520+
string_size = size;
521+
}
522+
}
523+
}
524524

525-
DEBUG_PRINT("Final string size: %lu\n", string_size);
525+
DEBUG_PRINT("Final string size: %lu\n", string_size);
526526

527527
char str_data[field_count][string_size];
528-
i = 0;
528+
i = 0;
529529

530530
while (i < field_count) {
531531
bind[i].buffer_type = fields[i].type;
@@ -702,23 +702,23 @@ Handle<Value> MysqlStatement::FetchAllSync(const Arguments& args) {
702702
case MYSQL_TYPE_BLOB:
703703
case MYSQL_TYPE_STRING:
704704
case MYSQL_TYPE_VAR_STRING:
705-
if (fields[j].flags & BINARY_FLAG) {
705+
if (fields[j].flags & BINARY_FLAG) {
706706
DEBUG_PRINT("\t\tBlob, length: (%lu)\n", length[j]);
707707

708-
// taken from: http://sambro.is-super-awesome.com/2011/03/03/creating-a-proper-buffer-in-a-node-c-addon/
709-
node::Buffer *slowBuffer = node::Buffer::New(length[j]);
710-
memcpy(node::Buffer::Data(slowBuffer), str_data[j], length[j]);
711-
v8::Local<v8::Object> globalObj = v8::Context::GetCurrent()->Global();
712-
v8::Local<v8::Function> bufferConstructor = v8::Local<v8::Function>::Cast(globalObj->Get(v8::String::New("Buffer")));
713-
v8::Handle<v8::Value> constructorArgs[3] = { slowBuffer->handle_, v8::Integer::New(length[j]), v8::Integer::New(0) };
714-
js_field = bufferConstructor->NewInstance(3, constructorArgs);
715-
} else {
708+
// taken from: http://sambro.is-super-awesome.com/2011/03/03/creating-a-proper-buffer-in-a-node-c-addon/
709+
node::Buffer *slowBuffer = node::Buffer::New(length[j]);
710+
memcpy(node::Buffer::Data(slowBuffer), str_data[j], length[j]);
711+
v8::Local<v8::Object> globalObj = v8::Context::GetCurrent()->Global();
712+
v8::Local<v8::Function> bufferConstructor = v8::Local<v8::Function>::Cast(globalObj->Get(v8::String::New("Buffer")));
713+
v8::Handle<v8::Value> constructorArgs[3] = { slowBuffer->handle_, v8::Integer::New(length[j]), v8::Integer::New(0) };
714+
js_field = bufferConstructor->NewInstance(3, constructorArgs);
715+
} else {
716716
DEBUG_PRINT("\t\tString: %s (%lu)\n", str_data[j], length[j]);
717-
js_field = V8STR2(str_data[j], length[j]);
718-
}
717+
js_field = V8STR2(str_data[j], length[j]);
718+
}
719719

720-
break;
721-
default:
720+
break;
721+
default:
722722
DEBUG_PRINT("\t\tDefault (as string): %s\n", str_data[j]);
723723
js_field = V8STR2(str_data[j], length[j]);
724724
break;

src/mysql_bindings_statement.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
}
3333

3434
#ifdef DEBUG
35-
#define DEBUG_PRINT(fmt, ...) fprintf(stdout, fmt, __VA_ARGS__)
35+
#define DEBUG_PRINT(fmt, ...) fprintf(stdout, fmt, __VA_ARGS__)
3636
#else
37-
#define DEBUG_PRINT(fmt, ...) 1
37+
#define DEBUG_PRINT(fmt, ...) 1
3838
#endif
3939

4040

0 commit comments

Comments
 (0)