Skip to content

Commit 55da68d

Browse files
committed
Longer lines is now available in C++ code
1 parent fbc0f94 commit 55da68d

File tree

4 files changed

+23
-39
lines changed

4 files changed

+23
-39
lines changed

src/mysql_bindings_connection.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ Handle<Value> MysqlConnection::New(const Arguments& args) {
234234
*
235235
* Gets last connect error number
236236
**/
237-
Handle<Value> MysqlConnection::ConnectErrnoGetter(Local<String> property,
238-
const AccessorInfo &info) {
237+
Handle<Value> MysqlConnection::ConnectErrnoGetter(Local<String> property, const AccessorInfo &info) {
239238
HandleScope scope;
240239

241240
MysqlConnection *conn = OBJUNWRAP<MysqlConnection>(info.Holder());
@@ -248,8 +247,7 @@ Handle<Value> MysqlConnection::ConnectErrnoGetter(Local<String> property,
248247
*
249248
* Gets last connect error string
250249
**/
251-
Handle<Value> MysqlConnection::ConnectErrorGetter(Local<String> property,
252-
const AccessorInfo &info) {
250+
Handle<Value> MysqlConnection::ConnectErrorGetter(Local<String> property, const AccessorInfo &info) {
253251
HandleScope scope;
254252

255253
MysqlConnection *conn = OBJUNWRAP<MysqlConnection>(info.Holder());

src/mysql_bindings_connection.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,9 @@ class MysqlConnection : public node::ObjectWrap {
9797

9898
// Properties
9999

100-
static Handle<Value> ConnectErrnoGetter(Local<String> property,
101-
const AccessorInfo &info);
100+
static Handle<Value> ConnectErrnoGetter(Local<String> property, const AccessorInfo &info);
102101

103-
static Handle<Value> ConnectErrorGetter(Local<String> property,
104-
const AccessorInfo &info);
102+
static Handle<Value> ConnectErrorGetter(Local<String> property, const AccessorInfo &info);
105103

106104
// Methods
107105

src/mysql_bindings_result.cc

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,17 @@ MysqlResult::~MysqlResult() {
5656
this->Free();
5757
}
5858

59-
void MysqlResult::AddFieldProperties(
60-
Local<Object> &js_field_obj,
61-
MYSQL_FIELD *field) {
62-
js_field_obj->Set(V8STR("name"), V8STR(field->name ? field->name : ""));
59+
void MysqlResult::AddFieldProperties(Local<Object> &js_field_obj, MYSQL_FIELD *field) {
60+
js_field_obj->Set(V8STR("name"),
61+
V8STR(field->name ? field->name : ""));
6362
js_field_obj->Set(V8STR("orgname"),
6463
V8STR(field->org_name ? field->org_name : ""));
65-
js_field_obj->Set(V8STR("table"), V8STR(field->table ? field->table : ""));
64+
js_field_obj->Set(V8STR("table"),
65+
V8STR(field->table ? field->table : ""));
6666
js_field_obj->Set(V8STR("orgtable"),
6767
V8STR(field->org_table ? field->org_table : ""));
68-
js_field_obj->Set(V8STR("def"), V8STR(field->def ? field->def : ""));
68+
js_field_obj->Set(V8STR("def"),
69+
V8STR(field->def ? field->def : ""));
6970

7071
js_field_obj->Set(V8STR("max_length"),
7172
Integer::NewFromUnsigned(field->max_length));
@@ -81,9 +82,7 @@ void MysqlResult::AddFieldProperties(
8182
Integer::NewFromUnsigned(field->decimals));
8283
}
8384

84-
Local<Value> MysqlResult::GetFieldValue(MYSQL_FIELD field,
85-
char* field_value,
86-
unsigned long field_length) {
85+
Local<Value> MysqlResult::GetFieldValue(MYSQL_FIELD field, char* field_value, unsigned long field_length) {
8786
HandleScope scope;
8887

8988
Local<Value> js_field = Local<Value>::New(Null());
@@ -124,8 +123,7 @@ Local<Value> MysqlResult::GetFieldValue(MYSQL_FIELD field,
124123
case MYSQL_TYPE_TIME: // TIME field
125124
if (field_value) {
126125
int hours = 0, minutes = 0, seconds = 0;
127-
sscanf(field_value, "%d:%d:%d",
128-
&hours, &minutes, &seconds);
126+
sscanf(field_value, "%d:%d:%d", &hours, &minutes, &seconds);
129127
time_t result = hours*60*60 + minutes*60 + seconds;
130128
js_field = Date::New(static_cast<double>(result)*1000);
131129
}
@@ -172,9 +170,7 @@ Local<Value> MysqlResult::GetFieldValue(MYSQL_FIELD field,
172170
case MYSQL_TYPE_VAR_STRING:
173171
if (field_value) {
174172
if (field.flags & BINARY_FLAG) {
175-
js_field = Local<Value>::New(
176-
node::Buffer::New(
177-
V8STR2(field_value, field_length)));
173+
js_field = Local<Value>::New(node::Buffer::New(V8STR2(field_value, field_length)));
178174
} else {
179175
js_field = V8STR2(field_value, field_length);
180176
}
@@ -268,8 +264,7 @@ Handle<Value> MysqlResult::New(const Arguments& args) {
268264
*
269265
* Get the number of fields in a result
270266
**/
271-
Handle<Value> MysqlResult::FieldCountGetter(Local<String> property,
272-
const AccessorInfo &info) {
267+
Handle<Value> MysqlResult::FieldCountGetter(Local<String> property, const AccessorInfo &info) {
273268
HandleScope scope;
274269

275270
MysqlResult *res = OBJUNWRAP<MysqlResult>(info.Holder());

src/mysql_bindings_result.h

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ class MysqlResult : public node::ObjectWrap {
3838

3939
static void Init(Handle<Object> target);
4040

41-
static void AddFieldProperties(
42-
Local<Object> &js_field_obj,
43-
MYSQL_FIELD *field);
41+
static void AddFieldProperties(Local<Object> &js_field_obj, MYSQL_FIELD *field);
4442

45-
static Local<Value> GetFieldValue(MYSQL_FIELD field,
46-
char* field_value,
47-
unsigned long field_length);
43+
static Local<Value> GetFieldValue(MYSQL_FIELD field, char* field_value, unsigned long field_length);
4844

4945
void Free();
5046

@@ -56,13 +52,11 @@ class MysqlResult : public node::ObjectWrap {
5652

5753
MysqlResult();
5854

59-
explicit MysqlResult(MYSQL *my_connection,
60-
MYSQL_RES *my_result,
61-
uint32_t my_field_count):
62-
ObjectWrap(),
63-
_conn(my_connection),
64-
_res(my_result),
65-
field_count(my_field_count) {}
55+
explicit MysqlResult(MYSQL *my_connection, MYSQL_RES *my_result, uint32_t my_field_count):
56+
ObjectWrap(),
57+
_conn(my_connection),
58+
_res(my_result),
59+
field_count(my_field_count) {}
6660

6761
~MysqlResult();
6862

@@ -72,8 +66,7 @@ class MysqlResult : public node::ObjectWrap {
7266

7367
// Properties
7468

75-
static Handle<Value> FieldCountGetter(Local<String> property,
76-
const AccessorInfo &info);
69+
static Handle<Value> FieldCountGetter(Local<String> property, const AccessorInfo &info);
7770

7871
// Methods
7972

0 commit comments

Comments
 (0)