Skip to content

Commit

Permalink
fix int conversion warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Jan 31, 2024
1 parent 3c3820b commit bb6920b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/binn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3340,11 +3340,11 @@ BOOL APIENTRY binn_get_int32(binn *value, int *pint) {

switch (value->type) {
case BINN_FLOAT:
if (value->vfloat < INT32_MIN || value->vfloat > INT32_MAX) return FALSE;
if (value->vfloat < (float)INT32_MIN || value->vfloat > (float)INT32_MAX) return FALSE;
*pint = roundval(value->vfloat);
break;
case BINN_DOUBLE:
if (value->vdouble < INT32_MIN || value->vdouble > INT32_MAX) return FALSE;
if (value->vdouble < (double)INT32_MIN || value->vdouble > (double)INT32_MAX) return FALSE;
*pint = roundval(value->vdouble);
break;
case BINN_STRING:
Expand Down Expand Up @@ -3377,11 +3377,11 @@ BOOL APIENTRY binn_get_int64(binn *value, int64 *pint) {

switch (value->type) {
case BINN_FLOAT:
if (value->vfloat < INT64_MIN || value->vfloat > INT64_MAX) return FALSE;
if (value->vfloat < (float)INT64_MIN || value->vfloat > (float)INT64_MAX) return FALSE;
*pint = roundval(value->vfloat);
break;
case BINN_DOUBLE:
if (value->vdouble < INT64_MIN || value->vdouble > INT64_MAX) return FALSE;
if (value->vdouble < (double)INT64_MIN || value->vdouble > (double)INT64_MAX) return FALSE;
*pint = roundval(value->vdouble);
break;
case BINN_STRING:
Expand Down

0 comments on commit bb6920b

Please sign in to comment.