Explicitly cast variables to silence Windows build warnings

This commit is contained in:
Dominic Spill
2018-03-27 14:11:51 -06:00
parent d4d74db27c
commit e384a2d2b7
2 changed files with 3 additions and 3 deletions

View File

@ -564,7 +564,7 @@ int main(int argc, char** argv) {
pwr = (float*)fftwf_malloc(sizeof(float) * fftSize);
window = (float*)fftwf_malloc(sizeof(float) * fftSize);
for (i = 0; i < fftSize; i++) {
window[i] = 0.5f * (1.0f - cos(2 * M_PI * i / (fftSize - 1)));
window[i] = (float) (0.5f * (1.0f - cos(2 * M_PI * i / (fftSize - 1))));
}
result = hackrf_init();
@ -640,7 +640,7 @@ int main(int argc, char** argv) {
for(i = 0; i < num_ranges; i++) {
step_count = 1 + (frequencies[2*i+1] - frequencies[2*i] - 1)
/ TUNE_STEP;
frequencies[2*i+1] = frequencies[2*i] + step_count * TUNE_STEP;
frequencies[2*i+1] = (uint16_t) (frequencies[2*i] + step_count * TUNE_STEP);
fprintf(stderr, "Sweeping from %u MHz to %u MHz\n",
frequencies[2*i], frequencies[2*i+1]);
}

View File

@ -748,7 +748,7 @@ int main(int argc, char** argv) {
freq_hz = if_freq_hz;
break;
case RF_PATH_FILTER_LOW_PASS:
freq_hz = labs((long int) if_freq_hz - lo_freq_hz);
freq_hz = (int64_t) labs(if_freq_hz - lo_freq_hz);
break;
case RF_PATH_FILTER_HIGH_PASS:
freq_hz = if_freq_hz + lo_freq_hz;