From e384a2d2b726d0892ccbd80aef617547b651bb0b Mon Sep 17 00:00:00 2001 From: Dominic Spill Date: Tue, 27 Mar 2018 14:11:51 -0600 Subject: [PATCH] Explicitly cast variables to silence Windows build warnings --- host/hackrf-tools/src/hackrf_sweep.c | 4 ++-- host/hackrf-tools/src/hackrf_transfer.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 9770fd77..8b038841 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -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]); } diff --git a/host/hackrf-tools/src/hackrf_transfer.c b/host/hackrf-tools/src/hackrf_transfer.c index f75b5660..78cea971 100644 --- a/host/hackrf-tools/src/hackrf_transfer.c +++ b/host/hackrf-tools/src/hackrf_transfer.c @@ -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;