bladeRF-fsk: Fixed 32-bit Windows build issue
Narrowing conversion requires a sanity check and cast.
This commit is contained in:
parent
63afe69ac5
commit
4de1d02e65
1 changed files with 5 additions and 1 deletions
|
|
@ -735,6 +735,10 @@ void *phy_receive_frames(void *arg)
|
|||
CHECK_FRAME_TYPE, DECODE, COPY};
|
||||
enum states state; //current state variable
|
||||
|
||||
/* corr_process() takes a size_t count.
|
||||
* Ensure a cast from uint64_t to size_t is valid. */
|
||||
assert(NUM_SAMPLES_RX < SIZE_MAX);
|
||||
|
||||
//Allocate memory for buffer
|
||||
rx_buffer = malloc(MAX_LINK_FRAME_SIZE);
|
||||
if (rx_buffer == NULL){
|
||||
|
|
@ -804,7 +808,7 @@ void *phy_receive_frames(void *arg)
|
|||
//DEBUG_MSG("[PHY] RX: State = PREAMBLE_CORRELATE\n");
|
||||
samples_index = corr_process(phy->rx->corr,
|
||||
&(phy->rx->pnorm_samples[samples_index]),
|
||||
NUM_SAMPLES_RX-samples_index, 0);
|
||||
(size_t) (NUM_SAMPLES_RX-samples_index), 0);
|
||||
if (samples_index != CORRELATOR_NO_RESULT){
|
||||
DEBUG_MSG("[PHY] RX: Preamble matched @ index %lu\n", samples_index);
|
||||
preamble_detected = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue