diff options
35 files changed, 114 insertions, 114 deletions
diff --git a/gnuradio-runtime/include/gnuradio/fxpt.h b/gnuradio-runtime/include/gnuradio/fxpt.h index 9ebcd87acd..d43aae6f8c 100644 --- a/gnuradio-runtime/include/gnuradio/fxpt.h +++ b/gnuradio-runtime/include/gnuradio/fxpt.h @@ -41,8 +41,8 @@ namespace gr { */ class GR_RUNTIME_API fxpt { - static const int WORDBITS = 32; - static const int NBITS = 10; + static constexpr int WORDBITS = 32; + static constexpr int NBITS = 10; static const float s_sine_table[1 << NBITS][2]; static const float PI; static const float TAU; diff --git a/gnuradio-runtime/include/gnuradio/io_signature.h b/gnuradio-runtime/include/gnuradio/io_signature.h index dfdd89794e..e62ac79f95 100644 --- a/gnuradio-runtime/include/gnuradio/io_signature.h +++ b/gnuradio-runtime/include/gnuradio/io_signature.h @@ -45,7 +45,7 @@ class GR_RUNTIME_API io_signature public: typedef boost::shared_ptr<io_signature> sptr; - static const int IO_INFINITE = -1; + static constexpr int IO_INFINITE = -1; ~io_signature(); diff --git a/gnuradio-runtime/include/gnuradio/rpccallbackregister_base.h b/gnuradio-runtime/include/gnuradio/rpccallbackregister_base.h index f12c489f05..28ee6e54fb 100644 --- a/gnuradio-runtime/include/gnuradio/rpccallbackregister_base.h +++ b/gnuradio-runtime/include/gnuradio/rpccallbackregister_base.h @@ -29,19 +29,19 @@ typedef uint32_t DisplayType; //! DisplayType Plotting types -const uint32_t DISPNULL = 0x0000; -const uint32_t DISPTIME = 0x0001; -const uint32_t DISPXY = 0x0002; -const uint32_t DISPPSD = 0x0004; -const uint32_t DISPSPEC = 0x0008; -const uint32_t DISPRAST = 0x0010; +constexpr uint32_t DISPNULL = 0x0000; +constexpr uint32_t DISPTIME = 0x0001; +constexpr uint32_t DISPXY = 0x0002; +constexpr uint32_t DISPPSD = 0x0004; +constexpr uint32_t DISPSPEC = 0x0008; +constexpr uint32_t DISPRAST = 0x0010; //! DisplayType Options -const uint32_t DISPOPTCPLX = 0x0100; -const uint32_t DISPOPTLOG = 0x0200; -const uint32_t DISPOPTSTEM = 0x0400; -const uint32_t DISPOPTSTRIP = 0x0800; -const uint32_t DISPOPTSCATTER = 0x1000; +constexpr uint32_t DISPOPTCPLX = 0x0100; +constexpr uint32_t DISPOPTLOG = 0x0200; +constexpr uint32_t DISPOPTSTEM = 0x0400; +constexpr uint32_t DISPOPTSTRIP = 0x0800; +constexpr uint32_t DISPOPTSCATTER = 0x1000; enum priv_lvl_t { RPC_PRIVLVL_ALL = 0, RPC_PRIVLVL_MIN = 9, RPC_PRIVLVL_NONE = 10 }; diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h b/gnuradio-runtime/include/gnuradio/thrift_application_base.h index 2e62e10a03..5671c1f019 100644 --- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h +++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h @@ -33,7 +33,7 @@ namespace { // Time, in milliseconds, to wait between checks to the Thrift runtime to see if // it has fully initialized. -static const unsigned int THRIFTAPPLICATION_ACTIVATION_TIMEOUT_MS(200); +static constexpr unsigned int THRIFTAPPLICATION_ACTIVATION_TIMEOUT_MS(200); }; // namespace namespace apache { diff --git a/gr-audio/lib/jack/jack_sink.h b/gr-audio/lib/jack/jack_sink.h index 6c2ad24ba1..60b501c9bb 100644 --- a/gr-audio/lib/jack/jack_sink.h +++ b/gr-audio/lib/jack/jack_sink.h @@ -54,7 +54,7 @@ class jack_sink : public sink std::string d_device_name; jack_client_t* d_jack_client; - static const int MAX_PORTS = 10; + static constexpr int MAX_PORTS = 10; int d_portcount; jack_port_t* d_jack_output_port[MAX_PORTS]; jack_ringbuffer_t* d_ringbuffer[MAX_PORTS]; diff --git a/gr-audio/lib/jack/jack_source.h b/gr-audio/lib/jack/jack_source.h index e9a93a6561..664a68d876 100644 --- a/gr-audio/lib/jack/jack_source.h +++ b/gr-audio/lib/jack/jack_source.h @@ -54,7 +54,7 @@ class jack_source : public source std::string d_device_name; jack_client_t* d_jack_client; - static const int MAX_PORTS = 10; + static constexpr int MAX_PORTS = 10; int d_portcount; jack_port_t* d_jack_input_port[MAX_PORTS]; jack_ringbuffer_t* d_ringbuffer[MAX_PORTS]; diff --git a/gr-blocks/include/gnuradio/blocks/file_meta_sink.h b/gr-blocks/include/gnuradio/blocks/file_meta_sink.h index f967ea042c..518c5eda07 100644 --- a/gr-blocks/include/gnuradio/blocks/file_meta_sink.h +++ b/gr-blocks/include/gnuradio/blocks/file_meta_sink.h @@ -29,8 +29,8 @@ namespace gr { namespace blocks { -const char METADATA_VERSION = 0; -const size_t METADATA_HEADER_SIZE = 149; +constexpr char METADATA_VERSION = 0; +constexpr size_t METADATA_HEADER_SIZE = 149; enum gr_file_types { GR_FILE_BYTE = 0, diff --git a/gr-blocks/lib/check_lfsr_32k_s_impl.h b/gr-blocks/lib/check_lfsr_32k_s_impl.h index 3830c0b814..291b124c9b 100644 --- a/gr-blocks/lib/check_lfsr_32k_s_impl.h +++ b/gr-blocks/lib/check_lfsr_32k_s_impl.h @@ -47,7 +47,7 @@ private: long d_nright; // # of correct shorts long d_runlength; // # of correct shorts in a row - static const int BUFSIZE = 2048 - 1; // ensure pattern isn't packet aligned + static constexpr int BUFSIZE = 2048 - 1; // ensure pattern isn't packet aligned int d_index; unsigned short d_buffer[BUFSIZE]; diff --git a/gr-blocks/lib/lfsr_32k_source_s_impl.h b/gr-blocks/lib/lfsr_32k_source_s_impl.h index 6a7dcd7cd1..4de24d19a5 100644 --- a/gr-blocks/lib/lfsr_32k_source_s_impl.h +++ b/gr-blocks/lib/lfsr_32k_source_s_impl.h @@ -33,7 +33,7 @@ namespace blocks { class lfsr_32k_source_s_impl : public lfsr_32k_source_s { private: - static const int BUFSIZE = 2048 - 1; // ensure pattern isn't packet aligned + static constexpr int BUFSIZE = 2048 - 1; // ensure pattern isn't packet aligned int d_index; short d_buffer[BUFSIZE]; diff --git a/gr-channels/include/gnuradio/channels/selective_fading_model.h b/gr-channels/include/gnuradio/channels/selective_fading_model.h index 51aa1eab43..2afbd5222e 100644 --- a/gr-channels/include/gnuradio/channels/selective_fading_model.h +++ b/gr-channels/include/gnuradio/channels/selective_fading_model.h @@ -30,8 +30,8 @@ namespace gr { namespace channels { -const float default_delays[] = { 0.0, 0.1, 0.5 }; -const float default_mags[] = { 1.0, 0.8, 0.3 }; +constexpr float default_delays[] = { 0.0, 0.1, 0.5 }; +constexpr float default_mags[] = { 1.0, 0.8, 0.3 }; /*! * \brief fading simulator diff --git a/gr-channels/include/gnuradio/channels/selective_fading_model2.h b/gr-channels/include/gnuradio/channels/selective_fading_model2.h index 4a842b26c4..0c61e0aa9a 100644 --- a/gr-channels/include/gnuradio/channels/selective_fading_model2.h +++ b/gr-channels/include/gnuradio/channels/selective_fading_model2.h @@ -30,8 +30,8 @@ namespace gr { namespace channels { -const float default_delays2[] = { 1.0, 1.9, 2.7 }; -const float default_mags2[] = { 1.0, 0.95, 0.8 }; +constexpr float default_delays2[] = { 1.0, 1.9, 2.7 }; +constexpr float default_mags2[] = { 1.0, 0.95, 0.8 }; /*! * \brief fading simulator diff --git a/gr-digital/include/gnuradio/digital/simple_framer_sync.h b/gr-digital/include/gnuradio/digital/simple_framer_sync.h index 532a9937c0..49501ef795 100644 --- a/gr-digital/include/gnuradio/digital/simple_framer_sync.h +++ b/gr-digital/include/gnuradio/digital/simple_framer_sync.h @@ -42,13 +42,13 @@ namespace digital { * 0xACDDA4E2F28C20FC (padded on right with a zero) * </pre> */ -static const unsigned long long GRSF_SYNC = 0xacdda4e2f28c20fcULL; +static constexpr unsigned long long GRSF_SYNC = 0xacdda4e2f28c20fcULL; -static const int GRSF_BITS_PER_BYTE = 8; -static const int GRSF_SYNC_OVERHEAD = sizeof(GRSF_SYNC); -static const int GRSF_PAYLOAD_OVERHEAD = 1; // 1 byte seqno -static const int GRSF_TAIL_PAD = 1; // one byte trailing padding -static const int GRSF_OVERHEAD = +static constexpr int GRSF_BITS_PER_BYTE = 8; +static constexpr int GRSF_SYNC_OVERHEAD = sizeof(GRSF_SYNC); +static constexpr int GRSF_PAYLOAD_OVERHEAD = 1; // 1 byte seqno +static constexpr int GRSF_TAIL_PAD = 1; // one byte trailing padding +static constexpr int GRSF_OVERHEAD = GRSF_SYNC_OVERHEAD + GRSF_PAYLOAD_OVERHEAD + GRSF_TAIL_PAD; } /* namespace digital */ diff --git a/gr-digital/lib/constellation_receiver_cb_impl.h b/gr-digital/lib/constellation_receiver_cb_impl.h index 45e3755e40..1a31b2a5fa 100644 --- a/gr-digital/lib/constellation_receiver_cb_impl.h +++ b/gr-digital/lib/constellation_receiver_cb_impl.h @@ -78,7 +78,7 @@ private: void set_constellation(constellation_sptr constellation); //! delay line length. - static const unsigned int DLLEN = 8; + static constexpr unsigned int DLLEN = 8; //! delay line plus some length for overflow protection __GR_ATTR_ALIGNED(8) gr_complex d_dl[2 * DLLEN]; diff --git a/gr-digital/lib/framer_sink_1_impl.h b/gr-digital/lib/framer_sink_1_impl.h index b394cb66b7..0d8478f8bf 100644 --- a/gr-digital/lib/framer_sink_1_impl.h +++ b/gr-digital/lib/framer_sink_1_impl.h @@ -33,8 +33,8 @@ class framer_sink_1_impl : public framer_sink_1 private: enum state_t { STATE_SYNC_SEARCH, STATE_HAVE_SYNC, STATE_HAVE_HEADER }; - static const int MAX_PKT_LEN = 4096; - static const int HEADERBITLEN = 32; + static constexpr int MAX_PKT_LEN = 4096; + static constexpr int HEADERBITLEN = 32; msg_queue::sptr d_target_queue; // where to send the packet when received state_t d_state; diff --git a/gr-digital/lib/ofdm_frame_sink_impl.h b/gr-digital/lib/ofdm_frame_sink_impl.h index f3943db519..5d0f0c2677 100644 --- a/gr-digital/lib/ofdm_frame_sink_impl.h +++ b/gr-digital/lib/ofdm_frame_sink_impl.h @@ -33,8 +33,8 @@ class ofdm_frame_sink_impl : public ofdm_frame_sink private: enum state_t { STATE_SYNC_SEARCH, STATE_HAVE_SYNC, STATE_HAVE_HEADER }; - static const int MAX_PKT_LEN = 4096; - static const int HEADERBYTELEN = 4; + static constexpr int MAX_PKT_LEN = 4096; + static constexpr int HEADERBYTELEN = 4; msg_queue::sptr d_target_queue; // where to send the packet when received state_t d_state; diff --git a/gr-digital/lib/packet_sink_impl.h b/gr-digital/lib/packet_sink_impl.h index 9e0a63d009..10d845bca6 100644 --- a/gr-digital/lib/packet_sink_impl.h +++ b/gr-digital/lib/packet_sink_impl.h @@ -33,8 +33,8 @@ class packet_sink_impl : public packet_sink private: enum state_t { STATE_SYNC_SEARCH, STATE_HAVE_SYNC, STATE_HAVE_HEADER }; - static const int MAX_PKT_LEN = 4096; - static const int HEADERBITLEN = 32; + static constexpr int MAX_PKT_LEN = 4096; + static constexpr int HEADERBITLEN = 32; msg_queue::sptr d_target_queue; // where to send the packet when received unsigned long long d_sync_vector; // access code to locate start of packet diff --git a/gr-digital/lib/simple_correlator_impl.h b/gr-digital/lib/simple_correlator_impl.h index dc4c0f3ca4..9819fbae95 100644 --- a/gr-digital/lib/simple_correlator_impl.h +++ b/gr-digital/lib/simple_correlator_impl.h @@ -33,7 +33,7 @@ namespace digital { class simple_correlator_impl : public simple_correlator { private: - static const int OVERSAMPLE = 8; + static constexpr int OVERSAMPLE = 8; enum state_t { ST_LOOKING, ST_UNDER_THRESHOLD, ST_LOCKED }; int d_payload_bytesize; diff --git a/gr-dtv/include/gnuradio/dtv/atsc_consts.h b/gr-dtv/include/gnuradio/dtv/atsc_consts.h index 291bc7ed62..e5d6450d1c 100644 --- a/gr-dtv/include/gnuradio/dtv/atsc_consts.h +++ b/gr-dtv/include/gnuradio/dtv/atsc_consts.h @@ -29,17 +29,17 @@ namespace gr { namespace dtv { // These will go into an mpeg_consts.h once other mod/demods are done -static const int ATSC_MPEG_DATA_LENGTH = 187; -static const int ATSC_MPEG_PKT_LENGTH = 188; // sync + data -static const int ATSC_MPEG_RS_ENCODED_LENGTH = 207; -static const int MPEG_SYNC_BYTE = 0x47; -static const int MPEG_TRANSPORT_ERROR_BIT = 0x80; // top bit of byte after SYNC +static constexpr int ATSC_MPEG_DATA_LENGTH = 187; +static constexpr int ATSC_MPEG_PKT_LENGTH = 188; // sync + data +static constexpr int ATSC_MPEG_RS_ENCODED_LENGTH = 207; +static constexpr int MPEG_SYNC_BYTE = 0x47; +static constexpr int MPEG_TRANSPORT_ERROR_BIT = 0x80; // top bit of byte after SYNC // ATSC specific constants -static const double ATSC_SYMBOL_RATE = 4.5e6 / 286 * 684; // ~10.76 MHz -static const double ATSC_DATA_SEGMENT_RATE = ATSC_SYMBOL_RATE / 832; // ~12.935 kHz -static const int ATSC_DATA_SEGMENT_LENGTH = 832; // includes 4 sync symbols at beginning -static const int ATSC_DSEGS_PER_FIELD = 312; // regular data segs / field +static constexpr double ATSC_SYMBOL_RATE = 4.5e6 / 286 * 684; // ~10.76 MHz +static constexpr double ATSC_DATA_SEGMENT_RATE = ATSC_SYMBOL_RATE / 832; // ~12.935 kHz +static constexpr int ATSC_DATA_SEGMENT_LENGTH = 832; // includes 4 sync symbols at beginning +static constexpr int ATSC_DSEGS_PER_FIELD = 312; // regular data segs / field } /* namespace dtv */ } /* namespace gr */ diff --git a/gr-dtv/lib/atsc/atsc_equalizer_impl.h b/gr-dtv/lib/atsc/atsc_equalizer_impl.h index 70bf046078..787a93b6da 100644 --- a/gr-dtv/lib/atsc/atsc_equalizer_impl.h +++ b/gr-dtv/lib/atsc/atsc_equalizer_impl.h @@ -33,11 +33,11 @@ namespace dtv { class atsc_equalizer_impl : public atsc_equalizer { private: - static const int NTAPS = 64; - static const int NPRETAPS = (int)(NTAPS * 0.8); // probably should be either .2 or .8 + static constexpr int NTAPS = 64; + static constexpr int NPRETAPS = (int)(NTAPS * 0.8); // probably should be either .2 or .8 // the length of the field sync pattern that we know unequivocally - static const int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; + static constexpr int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; float training_sequence1[KNOWN_FIELD_SYNC_LENGTH]; float training_sequence2[KNOWN_FIELD_SYNC_LENGTH]; diff --git a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h index 8399252fa2..e90cf8b8c6 100644 --- a/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h +++ b/gr-dtv/lib/atsc/atsc_field_sync_mux_impl.h @@ -31,7 +31,7 @@ namespace dtv { class atsc_field_sync_mux_impl : public atsc_field_sync_mux { private: - static const int N_SAVED_SYMBOLS = 12; + static constexpr int N_SAVED_SYMBOLS = 12; bool d_already_output_field_sync; unsigned char d_saved_symbols[N_SAVED_SYMBOLS]; diff --git a/gr-dtv/lib/atsc/atsc_fs_checker_impl.h b/gr-dtv/lib/atsc/atsc_fs_checker_impl.h index 2f8325277b..b14cba00e5 100644 --- a/gr-dtv/lib/atsc/atsc_fs_checker_impl.h +++ b/gr-dtv/lib/atsc/atsc_fs_checker_impl.h @@ -32,7 +32,7 @@ namespace dtv { class atsc_fs_checker_impl : public atsc_fs_checker { private: - static const int SRSIZE = 1024; // must be power of two + static constexpr int SRSIZE = 1024; // must be power of two int d_index; // points at oldest sample float d_sample_sr[SRSIZE]; // sample shift register atsc::syminfo d_tag_sr[SRSIZE]; // tag shift register @@ -40,10 +40,10 @@ private: int d_field_num; int d_segment_num; - static const int OFFSET_511 = 4; // offset to second PN 63 pattern - static const int LENGTH_511 = 511; // length of PN 63 pattern - static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern - static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern + static constexpr int OFFSET_511 = 4; // offset to second PN 63 pattern + static constexpr int LENGTH_511 = 511; // length of PN 63 pattern + static constexpr int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern + static constexpr int LENGTH_2ND_63 = 63; // length of PN 63 pattern inline static int wrap(int index) { return index & (SRSIZE - 1); } inline static int incr(int index) { return wrap(index + 1); } diff --git a/gr-dtv/lib/atsc/atsc_pnXXX_impl.h b/gr-dtv/lib/atsc/atsc_pnXXX_impl.h index da07b779e5..7f25b7c0b5 100644 --- a/gr-dtv/lib/atsc/atsc_pnXXX_impl.h +++ b/gr-dtv/lib/atsc/atsc_pnXXX_impl.h @@ -25,7 +25,7 @@ #include <gnuradio/dtv/api.h> -const unsigned char atsc_pn511[511] = { +constexpr unsigned char atsc_pn511[511] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, @@ -59,7 +59,7 @@ const unsigned char atsc_pn511[511] = { 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 }; -const unsigned char atsc_pn63[63] = { 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, +constexpr unsigned char atsc_pn63[63] = { 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0 }; diff --git a/gr-dtv/lib/atsc/atsc_randomize.h b/gr-dtv/lib/atsc/atsc_randomize.h index 48331cdab8..2792c445fc 100644 --- a/gr-dtv/lib/atsc/atsc_randomize.h +++ b/gr-dtv/lib/atsc/atsc_randomize.h @@ -84,8 +84,8 @@ private: unsigned int d_state; - static const unsigned int PRELOAD_VALUE = 0x018f; /* 0xf180 bit reversed */ - static const unsigned int MASK = 0xa638; + static constexpr unsigned int PRELOAD_VALUE = 0x018f; /* 0xf180 bit reversed */ + static constexpr unsigned int MASK = 0xa638; static unsigned char s_output_map[1 << 14]; static bool s_output_map_initialized_p; }; diff --git a/gr-dtv/lib/atsc/atsc_single_viterbi.h b/gr-dtv/lib/atsc/atsc_single_viterbi.h index fbfd673915..739b3ac1c5 100644 --- a/gr-dtv/lib/atsc/atsc_single_viterbi.h +++ b/gr-dtv/lib/atsc/atsc_single_viterbi.h @@ -31,7 +31,7 @@ class atsc_single_viterbi public: atsc_single_viterbi(); - static const unsigned int TB_LEN = 32; + static constexpr unsigned int TB_LEN = 32; /*! * \p INPUT ideally takes on the values +/- 1,3,5,7 diff --git a/gr-dtv/lib/atsc/atsc_syminfo_impl.h b/gr-dtv/lib/atsc/atsc_syminfo_impl.h index c12f47c6b9..971e4416ec 100644 --- a/gr-dtv/lib/atsc/atsc_syminfo_impl.h +++ b/gr-dtv/lib/atsc/atsc_syminfo_impl.h @@ -26,8 +26,8 @@ namespace gr { namespace dtv { namespace atsc { -static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff; -static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = +static constexpr unsigned int SI_SEGMENT_NUM_MASK = 0x1ff; +static constexpr unsigned int SI_FIELD_SYNC_SEGMENT_NUM = SI_SEGMENT_NUM_MASK; // conceptually -1 struct syminfo { diff --git a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h index 9b7160c478..537aaa01c1 100644 --- a/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_trellis_encoder_impl.h @@ -34,10 +34,10 @@ private: bool debug; /* How many separate Trellis encoders / Viterbi decoders run in parallel */ - static const int NCODERS = 12; - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; - static const int INPUT_SIZE = (SEGMENT_SIZE * 12); - static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); + static constexpr int NCODERS = 12; + static constexpr int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; + static constexpr int INPUT_SIZE = (SEGMENT_SIZE * 12); + static constexpr int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); void reset(); void encode(atsc_data_segment out[NCODERS], diff --git a/gr-dtv/lib/atsc/atsc_types.h b/gr-dtv/lib/atsc/atsc_types.h index c27ef1c451..a728351c80 100644 --- a/gr-dtv/lib/atsc/atsc_types.h +++ b/gr-dtv/lib/atsc/atsc_types.h @@ -149,33 +149,33 @@ public: protected: // these three are mutually exclusive // This is a regular data segment. - static const int fl_regular_seg = 0x0001; + static constexpr int fl_regular_seg = 0x0001; // This is a field sync segment, for 1st half of a field. - static const int fl_field_sync1 = 0x0002; + static constexpr int fl_field_sync1 = 0x0002; // This is a field sync segment, for 2nd half of a field. - static const int fl_field_sync2 = 0x0004; + static constexpr int fl_field_sync2 = 0x0004; // This bit is on ONLY when fl_regular_seg is set AND when this is // the first regular data segment AFTER a field sync segment. This // segment causes various processing modules to reset. - static const int fl_first_regular_seg = 0x0008; + static constexpr int fl_first_regular_seg = 0x0008; // which field are we in? - static const int fl_field2 = 0x0010; // else field 1 + static constexpr int fl_field2 = 0x0010; // else field 1 // This bit is set when Reed-Solomon decoding detects an error that it // can't correct. Note that other error detection (e.g. Viterbi) do not // set it, since Reed-Solomon will correct many of those. This bit is // then copied into the final Transport Stream packet so that MPEG // software can see that the 188-byte data segment has been corrupted. - static const int fl_transport_error = 0x0020; + static constexpr int fl_transport_error = 0x0020; }; class atsc_mpeg_packet { public: - static const int NPAD = 68; + static constexpr int NPAD = 68; unsigned char data[ATSC_MPEG_DATA_LENGTH + 1]; // first byte is sync unsigned char _pad_[NPAD]; // pad to power of 2 (256) @@ -194,7 +194,7 @@ public: class atsc_mpeg_packet_no_sync { public: - static const int NPAD = 65; + static constexpr int NPAD = 65; plinfo pli; unsigned char data[ATSC_MPEG_DATA_LENGTH]; unsigned char _pad_[NPAD]; // pad to power of 2 (256) @@ -214,7 +214,7 @@ public: class atsc_mpeg_packet_rs_encoded { public: - static const int NPAD = 45; + static constexpr int NPAD = 45; plinfo pli; unsigned char data[ATSC_MPEG_RS_ENCODED_LENGTH]; unsigned char _pad_[NPAD]; // pad to power of 2 (256) @@ -237,7 +237,7 @@ public: class atsc_data_segment { public: - static const int NPAD = 188; + static constexpr int NPAD = 188; plinfo pli; unsigned char data[ATSC_DATA_SEGMENT_LENGTH]; unsigned char _pad_[NPAD]; // pad to power of 2 (1024) @@ -263,7 +263,7 @@ public: class atsc_soft_data_segment { public: - static const int NPAD = 764; + static constexpr int NPAD = 764; plinfo pli; float data[ATSC_DATA_SEGMENT_LENGTH]; unsigned char _pad_[NPAD]; // pad to power of 2 (4096) diff --git a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h index 07b15efa1f..279e97645b 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h +++ b/gr-dtv/lib/atsc/atsc_viterbi_decoder_impl.h @@ -51,9 +51,9 @@ class atsc_viterbi_decoder_impl : public atsc_viterbi_decoder private: typedef interleaver_fifo<unsigned char> fifo_t; - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 - static const int OUTPUT_SIZE = (SEGMENT_SIZE * 12); - static const int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); + static constexpr int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 + static constexpr int OUTPUT_SIZE = (SEGMENT_SIZE * 12); + static constexpr int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); single_viterbi_t viterbi[NCODERS]; fifo_t* fifo[NCODERS]; diff --git a/gr-dtv/lib/atsc/atsc_viterbi_mux.h b/gr-dtv/lib/atsc/atsc_viterbi_mux.h index 2beb49e08a..5430720ff0 100644 --- a/gr-dtv/lib/atsc/atsc_viterbi_mux.h +++ b/gr-dtv/lib/atsc/atsc_viterbi_mux.h @@ -5,13 +5,13 @@ * Generated by 'atsc_viterbi_gen.cc'. */ -const unsigned int sync_symbol_indices_max = 12; -const unsigned int sync_symbol_indices[12] = { +constexpr unsigned int sync_symbol_indices_max = 12; +constexpr unsigned int sync_symbol_indices[12] = { 0, 832, 1664, 2496, 3328, 4160, 4992, 5824, 6656, 7488, 8320, 9152, }; -const unsigned int enco_which_max = 828; -const unsigned int enco_which_syms[12][828] = { +constexpr unsigned int enco_which_max = 828; +constexpr unsigned int enco_which_syms[12][828] = { /* 0 */ { 4, 16, 28, 40, 52, 64, 76, 88, 100, 112, 124, 136, 148, @@ -818,7 +818,7 @@ const unsigned int enco_which_syms[12][828] = { }, }; -const unsigned int enco_which_dibits[12][828] = { +constexpr unsigned int enco_which_dibits[12][828] = { /* 0 */ { 6, 4, 2, 0, 102, 100, 98, 96, 198, 196, 194, diff --git a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h index 04eded8be7..be12c18ed4 100644 --- a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h +++ b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.h @@ -27,16 +27,16 @@ #include <vector> // This should eventually go into a const file -const int SYMBOLS_PER_FRAME = 68; -const int FRAMES_PER_SUPERFRAME = 4; +constexpr int SYMBOLS_PER_FRAME = 68; +constexpr int FRAMES_PER_SUPERFRAME = 4; -const int SCATTERED_PILOT_SIZE_2k = 142; -const int CONTINUAL_PILOT_SIZE_2k = 45; -const int TPS_PILOT_SIZE_2k = 17; +constexpr int SCATTERED_PILOT_SIZE_2k = 142; +constexpr int CONTINUAL_PILOT_SIZE_2k = 45; +constexpr int TPS_PILOT_SIZE_2k = 17; -const int SCATTERED_PILOT_SIZE_8k = 568; -const int CONTINUAL_PILOT_SIZE_8k = 177; -const int TPS_PILOT_SIZE_8k = 68; +constexpr int SCATTERED_PILOT_SIZE_8k = 568; +constexpr int CONTINUAL_PILOT_SIZE_8k = 177; +constexpr int TPS_PILOT_SIZE_8k = 68; namespace gr { namespace dtv { diff --git a/gr-filter/include/gnuradio/filter/interp_differentiator_taps.h b/gr-filter/include/gnuradio/filter/interp_differentiator_taps.h index 1fc83bdcfc..ca152dd99e 100644 --- a/gr-filter/include/gnuradio/filter/interp_differentiator_taps.h +++ b/gr-filter/include/gnuradio/filter/interp_differentiator_taps.h @@ -23,11 +23,11 @@ * DO NOT EDIT BY HAND. */ -static const int DNTAPS = 8; -static const int DNSTEPS = 128; -static const double DBANDWIDTH = 0.25; +static constexpr int DNTAPS = 8; +static constexpr int DNSTEPS = 128; +static constexpr double DBANDWIDTH = 0.25; -static const float Dtaps[DNSTEPS + 1][DNTAPS] = { +static constexpr float Dtaps[DNSTEPS + 1][DNTAPS] = { // -4 -3 -2 -1 0 1 2 3 mu { -1.97975e-02, 1.09180e-01, diff --git a/gr-filter/include/gnuradio/filter/interpolator_taps.h b/gr-filter/include/gnuradio/filter/interpolator_taps.h index 586bbc9b79..1deecb2d07 100644 --- a/gr-filter/include/gnuradio/filter/interpolator_taps.h +++ b/gr-filter/include/gnuradio/filter/interpolator_taps.h @@ -3,10 +3,10 @@ * DO NOT EDIT BY HAND. */ -static const int NTAPS = 8; -static const int NSTEPS = 128; +static constexpr int NTAPS = 8; +static constexpr int NSTEPS = 128; -static const float taps[NSTEPS + 1][NTAPS] = { +static constexpr float taps[NSTEPS + 1][NTAPS] = { // -4 -3 -2 -1 0 1 2 3 mu { 0.00000e+00, 0.00000e+00, diff --git a/gr-filter/lib/gen_interpolator_taps/gen_interp_differentiator_taps.c b/gr-filter/lib/gen_interpolator_taps/gen_interp_differentiator_taps.c index aadd801149..a162058fd1 100644 --- a/gr-filter/lib/gen_interpolator_taps/gen_interp_differentiator_taps.c +++ b/gr-filter/lib/gen_interpolator_taps/gen_interp_differentiator_taps.c @@ -162,11 +162,11 @@ int main(int argc, char** argv) */\n\n"); - printf("static const int DNTAPS = %4d;\n", ntaps); - printf("static const int DNSTEPS = %4d;\n", nsteps); - printf("static const double DBANDWIDTH = %g;\n\n", global_B); + printf("static constexpr int DNTAPS = %4d;\n", ntaps); + printf("static constexpr int DNSTEPS = %4d;\n", nsteps); + printf("static constexpr double DBANDWIDTH = %g;\n\n", global_B); - printf("static const float Dtaps[DNSTEPS+1][DNTAPS] = {\n"); + printf("static constexpr float Dtaps[DNSTEPS+1][DNTAPS] = {\n"); printf(" // -4 -3 -2 -1 0 " " 1 2 3 mu\n"); diff --git a/gr-filter/lib/gen_interpolator_taps/gen_interpolator_taps.c b/gr-filter/lib/gen_interpolator_taps/gen_interpolator_taps.c index 3b22c74c2b..4dd13a40a2 100644 --- a/gr-filter/lib/gen_interpolator_taps/gen_interpolator_taps.c +++ b/gr-filter/lib/gen_interpolator_taps/gen_interpolator_taps.c @@ -177,11 +177,11 @@ int main(int argc, char** argv) */\n\n"); - printf("static const int NTAPS = %4d;\n", ntaps); - printf("static const int NSTEPS = %4d;\n", nsteps); - printf("static const double BANDWIDTH = %g;\n\n", global_B); + printf("static constexpr int NTAPS = %4d;\n", ntaps); + printf("static constexpr int NSTEPS = %4d;\n", nsteps); + printf("static constexpr double BANDWIDTH = %g;\n\n", global_B); - printf("static const float taps[NSTEPS+1][NTAPS] = {\n"); + printf("static constexpr float taps[NSTEPS+1][NTAPS] = {\n"); printf(" // -4 -3 -2 -1 0 " " 1 2 3 mu\n"); diff --git a/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h b/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h index 5eec015a8c..2722c389ec 100644 --- a/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h +++ b/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h @@ -32,10 +32,10 @@ #include <complex> #include <vector> -static const int SpectrumUpdateEventType = 10005; -static const int SpectrumWindowCaptionEventType = 10008; -static const int SpectrumWindowResetEventType = 10009; -static const int SpectrumFrequencyRangeEventType = 10010; +static constexpr int SpectrumUpdateEventType = 10005; +static constexpr int SpectrumWindowCaptionEventType = 10008; +static constexpr int SpectrumWindowResetEventType = 10009; +static constexpr int SpectrumFrequencyRangeEventType = 10010; class SpectrumUpdateEvent : public QEvent { |