Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a57ba96

Browse files
committed
Use float constants where needed.
This prevents a warning casting from double to float if the variable is not double.
1 parent 881f2a6 commit a57ba96

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/_image.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void _bin_indices_middle(
1212
unsigned int *rowstart = irows;
1313
const float *ys2 = ys1 + 1;
1414
const float *yl = ys1 + ny;
15-
float yo = y_min + dy / 2.0;
15+
float yo = y_min + dy / 2.0f;
1616
float ym = 0.5f * (*ys1 + *ys2);
1717
// y/rows
1818
j = 0;
@@ -126,7 +126,7 @@ void _bin_indices_linear(
126126
int iilast = (int)ny - 1;
127127
int iy0 = (int)floor(sc * (y[ii] - offs));
128128
int iy1 = (int)floor(sc * (y[ii + 1] - offs));
129-
float invgap = 1.0 / (iy1 - iy0);
129+
float invgap = 1.0f / (iy1 - iy0);
130130
for (i = 0; i < nrows && i < iy0; i++) {
131131
irows[i] = -1;
132132
}
@@ -135,7 +135,7 @@ void _bin_indices_linear(
135135
ii++;
136136
iy0 = iy1;
137137
iy1 = (int)floor(sc * (y[ii + 1] - offs));
138-
invgap = 1.0 / (iy1 - iy0);
138+
invgap = 1.0f / (iy1 - iy0);
139139
}
140140
if (i >= iy0 && i <= iy1) {
141141
irows[i] = ii;
@@ -151,7 +151,7 @@ void _bin_indices_linear(
151151
int ii = iilast;
152152
int iy0 = (int)floor(sc * (y[ii] - offs));
153153
int iy1 = (int)floor(sc * (y[ii - 1] - offs));
154-
float invgap = 1.0 / (iy1 - iy0);
154+
float invgap = 1.0f / (iy1 - iy0);
155155
for (i = 0; i < nrows && i < iy0; i++) {
156156
irows[i] = -1;
157157
}
@@ -160,7 +160,7 @@ void _bin_indices_linear(
160160
ii--;
161161
iy0 = iy1;
162162
iy1 = (int)floor(sc * (y[ii - 1] - offs));
163-
invgap = 1.0 / (iy1 - iy0);
163+
invgap = 1.0f / (iy1 - iy0);
164164
}
165165
if (i >= iy0 && i <= iy1) {
166166
irows[i] = ii - 1;

0 commit comments

Comments
 (0)