diff --git a/lib/constellation.cc b/lib/constellation.cc index 5e10a25..62e4a34 100644 --- a/lib/constellation.cc +++ b/lib/constellation.cc @@ -135,9 +135,11 @@ namespace gr { uint16_t idx(0); for(int j=0; j 0x01, false)){ throw std::runtime_error((boost::format("ERROR: constellation mapper expects values of 0x00 and 0x01 in *ONLY* - received 0x%02x at bit offset %d!")% ((int)(in[i*d_bps+j]))%(d_bps*i)).str()); } +#endif // !_MSC_VER idx |= (in[i*d_bps + j] << (d_bps - j-1)); } out[i] = d_mappings[mapidx][idx]; diff --git a/lib/pream_sync_correlator.cc b/lib/pream_sync_correlator.cc index c5da0f3..bdf7435 100644 --- a/lib/pream_sync_correlator.cc +++ b/lib/pream_sync_correlator.cc @@ -46,7 +46,7 @@ namespace gr { d_in_stream.push_back(gr_complex(0,0)); } d_in_stream.push_back(gr_complex(0,0)); - float phase[N]; + __GR_VLA(float, phase, N); for(int idx = 1; idx < N; idx++){ phase[idx] = arg(d_preamble_symbols[idx]); } @@ -99,13 +99,13 @@ namespace gr { } float pream_sync_correlator::acquire_value(void){ - float phase[d_preamble_symbol_count]; + __GR_VLA(float, phase, d_preamble_symbol_count); for(int idx=0; idx < d_preamble_symbol_count; idx++){ phase[idx] = arg(d_in_stream[d_preamble_symbol_count - 1 - idx]); // printf("\t1: sa[%02d] = (%02.4f,%02.4f), phase[%02d] = %02.4f\n",idx,small_array[idx].real(),small_array[idx].imag(),idx,phase[idx]); } unwrap(phase, d_preamble_symbol_count); - float phase_change[d_preamble_symbol_count]; + __GR_VLA(float, phase_change, d_preamble_symbol_count); float phase_diff = 0.0;//[d_preamble_symbol_count-1]; phase_change[0] = 0.0; // phase_diff[idx] = 0.0; @@ -132,10 +132,10 @@ namespace gr { } void pream_sync_correlator::unwrap(float *phase_array, int N) { - float dp[N]; - float dps[N]; - float dp_corr[N]; - float cumsum[N]; + __GR_VLA(float, dp, N); + __GR_VLA(float, dps, N); + __GR_VLA(float, dp_corr, N); + __GR_VLA(float, cumsum, N); float cutoff = M_PI; int j; diff --git a/lib/preamble_sync_cc_impl.cc b/lib/preamble_sync_cc_impl.cc index c50b410..e5fa1e4 100644 --- a/lib/preamble_sync_cc_impl.cc +++ b/lib/preamble_sync_cc_impl.cc @@ -99,7 +99,7 @@ namespace gr { int search_space = (int) d_preamble.size()/d_interp; int data_space = d_width/d_interp - search_space; int payload_space = d_width/d_interp; - float phase[search_space]; + __GR_VLA(float, phase, search_space); if(d_early_term) { d_corr.reset(); d_state = 0; @@ -307,12 +307,12 @@ namespace gr { } //for(int ind = 0; ind 0; ind--){ @@ -158,7 +158,7 @@ namespace gr { } } //printf("Compare has updated.\n"); - int ham_dist[MN]; + __GR_VLA(int, ham_dist, MN); for(int idx=0; idx < MN; idx++){ ham_dist[idx] = 0; } for(int idx=0; idx < MN; idx++){ //printf("idx = %d of MN = %d\t",idx,MN); @@ -225,7 +225,7 @@ namespace gr { } //float soft_out[n_symbols*d_bps]; //d_const.demap_soft(&in_rotated[0], &soft_out[0], n_symbols); - uint8_t hard_out[n_symbols*d_bps]; + __GR_VLA(uint8_t, hard_out, n_symbols * d_bps); d_const.demap_hard(&in_rotated[0], &hard_out[0], n_symbols); //memcpy(&out[oo], &soft_out[0], sizeof(float)*n_symbols*d_bps); memcpy(&out[oo], &hard_out[0], sizeof(uint8_t)*n_symbols*d_bps); diff --git a/lib/preamble_sync_demapper_impl.cc b/lib/preamble_sync_demapper_impl.cc index 5298809..0dbbe69 100644 --- a/lib/preamble_sync_demapper_impl.cc +++ b/lib/preamble_sync_demapper_impl.cc @@ -149,7 +149,7 @@ namespace gr { } //printf("Compare has shifted.\t Pream_len = %d\n",pream_len); for(int idx=0; idx < MN; idx++){ - uint8_t symbol_bits[d_bps]; + __GR_VLA(uint8_t, symbol_bits, d_bps); gr_complex symbol = in[ii] * exp(gr_complex(0,2*M_PI*idx/MN)); d_const.demap_hard(&symbol, &symbol_bits[0], 1); for(int ind = d_bps; ind > 0; ind--){ @@ -158,7 +158,7 @@ namespace gr { } } //printf("Compare has updated.\n"); - int ham_dist[MN]; + __GR_VLA(int, ham_dist, MN); for(int idx=0; idx < MN; idx++){ ham_dist[idx] = 0; } for(int idx=0; idx < MN; idx++){ //printf("idx = %d of MN = %d\t",idx,MN); @@ -223,7 +223,7 @@ namespace gr { for(int idx = 0; idx < n_symbols; idx++){ in_rotated[idx] = in[start_pointer+idx] * exp(gr_complex(0,2*M_PI*d_offset/MN)); } - float soft_out[n_symbols*d_bps]; + __GR_VLA(float, soft_out, n_symbols * d_bps); d_const.demap_soft(&in_rotated[0], &soft_out[0], n_symbols); //uint8_t hard_out[n_symbols*d_bps]; //d_const.demap_hard(&in_rotated[0], &hard_out[0], n_symbols);