Skip to content

Commit e0c4f09

Browse files
committed
Code formatting
1 parent 36d1043 commit e0c4f09

File tree

5 files changed

+173
-122
lines changed

5 files changed

+173
-122
lines changed

src/njsCommon.cpp

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ void njsBaton::AsyncAfterWorkCallback(uv_work_t *req, int status)
387387
void njsBaton::GetDPIError(void)
388388
{
389389
dpiContext_getError(njsOracledb::GetDPIContext(), &errorInfo);
390-
if (errorInfo.code == 1406)
390+
if (errorInfo.code == 1406) {
391391
error = njsMessages::Get(errInsufficientBufferForBinds);
392-
else {
392+
} else {
393393
error = std::string(errorInfo.message, errorInfo.messageLength);
394394
dpiError = true;
395395
}
@@ -404,9 +404,11 @@ void njsBaton::GetDPIError(void)
404404
//-----------------------------------------------------------------------------
405405
void njsBaton::SetDPIConnHandle(dpiConn *handle)
406406
{
407-
if (dpiConn_addRef(handle) < 0)
407+
if (dpiConn_addRef(handle) < 0) {
408408
GetDPIError();
409-
else dpiConnHandle = handle;
409+
} else {
410+
dpiConnHandle = handle;
411+
}
410412
}
411413

412414

@@ -417,9 +419,11 @@ void njsBaton::SetDPIConnHandle(dpiConn *handle)
417419
//-----------------------------------------------------------------------------
418420
void njsBaton::SetDPIPoolHandle(dpiPool *handle)
419421
{
420-
if (dpiPool_addRef(handle) < 0)
422+
if (dpiPool_addRef(handle) < 0) {
421423
GetDPIError();
422-
else dpiPoolHandle = handle;
424+
} else {
425+
dpiPoolHandle = handle;
426+
}
423427
}
424428

425429

@@ -430,9 +434,11 @@ void njsBaton::SetDPIPoolHandle(dpiPool *handle)
430434
//-----------------------------------------------------------------------------
431435
void njsBaton::SetDPIStmtHandle(dpiStmt *handle)
432436
{
433-
if (dpiStmt_addRef(handle) < 0)
437+
if (dpiStmt_addRef(handle) < 0) {
434438
GetDPIError();
435-
else dpiStmtHandle = handle;
439+
} else {
440+
dpiStmtHandle = handle;
441+
}
436442
}
437443

438444

@@ -443,9 +449,11 @@ void njsBaton::SetDPIStmtHandle(dpiStmt *handle)
443449
//-----------------------------------------------------------------------------
444450
void njsBaton::SetDPILobHandle(dpiLob *handle)
445451
{
446-
if (dpiLob_addRef(handle) < 0)
452+
if (dpiLob_addRef(handle) < 0) {
447453
GetDPIError();
448-
else dpiLobHandle = handle;
454+
} else {
455+
dpiLobHandle = handle;
456+
}
449457
}
450458

451459

@@ -456,9 +464,11 @@ void njsBaton::SetDPILobHandle(dpiLob *handle)
456464
//-----------------------------------------------------------------------------
457465
void njsBaton::SetDPISubscrHandle(dpiSubscr *handle)
458466
{
459-
if (dpiSubscr_addRef(handle) < 0)
467+
if (dpiSubscr_addRef(handle) < 0) {
460468
GetDPIError();
461-
else dpiSubscrHandle = handle;
469+
} else {
470+
dpiSubscrHandle = handle;
471+
}
462472
}
463473

464474

@@ -486,13 +496,10 @@ bool njsBaton::GetBoolFromJSON(Local<Object> obj, const char *key, int index,
486496
/* Undefined implies value not provided or equivalent */
487497
if (!jsValue->IsUndefined()) {
488498
if(jsValue->IsBoolean()) {
489-
// Get the boolean value
490499
*value = jsValue->ToBoolean()->Value();
491-
}
492-
else {
493-
// Non-Boolean value provided, report error
494-
error = njsMessages::Get ( errInvalidPropertyValueInParam, key,
495-
index + 1 ) ;
500+
} else {
501+
error = njsMessages::Get(errInvalidPropertyValueInParam, key,
502+
index + 1);
496503
return false;
497504
}
498505
}

0 commit comments

Comments
 (0)