Skip to content

Commit 7b5c6a3

Browse files
khaledDiptorup Deb
authored andcommitted
Fix windows compilation warnings
1 parent 4fea02c commit 7b5c6a3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

numba_dpex/core/runtime/_dpexrt_python.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static NRT_MemInfo *DPEXRT_MemInfo_fill(NRT_MemInfo *mi,
624624
}
625625
else if (!dest_is_float && value_is_float) {
626626
double *p = (double *)&value;
627-
bc.i64_ = *p;
627+
bc.i64_ = (int64_t)*p;
628628
}
629629
else {
630630
bc.i64_ = value;
@@ -638,7 +638,7 @@ static NRT_MemInfo *DPEXRT_MemInfo_fill(NRT_MemInfo *mi,
638638
{
639639
if (dest_is_float && value_is_float) {
640640
double *p = (double *)(&value);
641-
bc.f_ = *p;
641+
bc.f_ = (float)*p;
642642
}
643643
else if (dest_is_float && !value_is_float) {
644644
// To stop warning: dereferencing type-punned pointer
@@ -648,7 +648,7 @@ static NRT_MemInfo *DPEXRT_MemInfo_fill(NRT_MemInfo *mi,
648648
}
649649
else if (!dest_is_float && value_is_float) {
650650
double *p = (double *)&value;
651-
bc.i32_ = *p;
651+
bc.i32_ = (int32_t)*p;
652652
}
653653
else {
654654
bc.i32_ = (int32_t)value;
@@ -665,7 +665,7 @@ static NRT_MemInfo *DPEXRT_MemInfo_fill(NRT_MemInfo *mi,
665665

666666
if (value_is_float) {
667667
double *p = (double *)&value;
668-
bc.i16_ = *p;
668+
bc.i16_ = (int16_t)*p;
669669
}
670670
else {
671671
bc.i16_ = (int16_t)value;
@@ -682,7 +682,7 @@ static NRT_MemInfo *DPEXRT_MemInfo_fill(NRT_MemInfo *mi,
682682

683683
if (value_is_float) {
684684
double *p = (double *)&value;
685-
bc.i8_ = *p;
685+
bc.i8_ = (int8_t)*p;
686686
}
687687
else {
688688
bc.i8_ = (int8_t)value;

0 commit comments

Comments
 (0)