Skip to content

Commit ba83d65

Browse files
Eliminate warnings from static analysis tool.
1 parent 5362112 commit ba83d65

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/dpiError.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ int dpiError__getInfo(dpiError *error, dpiErrorInfo *info)
161161
info->sqlState = "01002";
162162
break;
163163
default:
164-
if (error->buffer->code == 0 && error->buffer->errorNum == 0)
164+
if (error->buffer->code == 0 &&
165+
error->buffer->errorNum == (dpiErrorNum) 0)
165166
info->sqlState = "00000";
166167
else info->sqlState = "HY000";
167168
break;

src/dpiSodaColl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void dpiSodaColl__free(dpiSodaColl *coll, dpiError *error)
228228
// dpiSodaColl__getDocCount() [INTERNAL]
229229
// Internal method for getting document count.
230230
//-----------------------------------------------------------------------------
231-
int dpiSodaColl__getDocCount(dpiSodaColl *coll,
231+
static int dpiSodaColl__getDocCount(dpiSodaColl *coll,
232232
const dpiSodaOperOptions *options, uint32_t flags, uint64_t *count,
233233
dpiError *error)
234234
{

src/dpiSodaDb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static int dpiSodaDb__checkConnected(dpiSodaDb *db, const char *fnName,
3737
// The provided cursor handle is iterated until either the limit is reached
3838
// or there are no more collections to find.
3939
//-----------------------------------------------------------------------------
40-
int dpiSodaDb__getCollectionNames(dpiSodaDb *db, void *cursorHandle,
40+
static int dpiSodaDb__getCollectionNames(dpiSodaDb *db, void *cursorHandle,
4141
uint32_t limit, dpiSodaCollNames *names, char **namesBuffer,
4242
dpiError *error)
4343
{

src/dpiUtils.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,12 @@ int dpiUtils__parseNumberString(const char *value, uint32_t valueLength,
149149
uint8_t *numDigits, uint8_t *digits, dpiError *error)
150150
{
151151
char convertedValue[DPI_NUMBER_AS_TEXT_CHARS], exponentDigits[4];
152-
int exponentIsNegative, exponent;
153152
uint8_t numExponentDigits, digit;
154153
uint32_t convertedValueLength;
155154
uint16_t *utf16chars, i;
155+
int exponentIsNegative;
156156
const char *endValue;
157+
int16_t exponent;
157158

158159
// empty strings are not valid numbers
159160
if (valueLength == 0)
@@ -250,7 +251,7 @@ int dpiUtils__parseNumberString(const char *value, uint32_t valueLength,
250251
return dpiError__set(error, "no digits in exponent",
251252
DPI_ERR_INVALID_NUMBER);
252253
exponentDigits[numExponentDigits] = '\0';
253-
exponent = (int) strtol(exponentDigits, NULL, 0);
254+
exponent = (int16_t) strtol(exponentDigits, NULL, 0);
254255
if (exponentIsNegative)
255256
exponent = -exponent;
256257
*decimalPointIndex += exponent;

0 commit comments

Comments
 (0)