From aca1e9612d0f759c76c53398b2e4df74a91a2841 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 9 May 2019 13:03:12 +0100 Subject: [PATCH] revert back from max_sizeof(...) to macros --- lib/include/srslte/asn1/asn1_utils.h | 18 +-- lib/include/srslte/asn1/rrc_asn1.h | 225 +++++++++++++++++++-------- 2 files changed, 166 insertions(+), 77 deletions(-) diff --git a/lib/include/srslte/asn1/asn1_utils.h b/lib/include/srslte/asn1/asn1_utils.h index 7ec82a13b..74f23eb28 100644 --- a/lib/include/srslte/asn1/asn1_utils.h +++ b/lib/include/srslte/asn1/asn1_utils.h @@ -788,15 +788,15 @@ union alignment_t { uint32_t* ptr; }; #define MAX2(a, b) ((a) > (b)) ? (a) : (b) -template -constexpr size_t max_size(const It b, const It e) -{ - return ((b == e) ? 0 : ((b + 1 == e) ? *b : MAX2(max_size(b, b + (e - b) / 2), max_size(b + (e - b) / 2, e)))); -} -constexpr size_t max_sizeof(const std::initializer_list& l) -{ - return max_size(l.begin(), l.end()); -} +#define MAX4(a, b, c, d) MAX2((MAX2(a, b)), MAX2(c, d)) +#define MAX8(a, b, c, d, e, f, g, h) MAX2((MAX4(a, b, c, d)), (MAX4(e, f, g, h))) +#define MAX12(a, b, c, d, e, f, g, h, i, j, k, l) MAX2((MAX8(a, b, c, d, e, f, g, h)), (MAX4(i, j, k, l))) +#define MAX16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \ + MAX2((MAX8(a, b, c, d, e, f, g, h)), (MAX8(i, j, k, l, m, n, o, p))) +#define MAX32( \ + a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1) \ + MAX2((MAX16(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)), \ + (MAX16(a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1))) template class choice_buffer_t diff --git a/lib/include/srslte/asn1/rrc_asn1.h b/lib/include/srslte/asn1/rrc_asn1.h index 2ab4ffecc..3780744f7 100644 --- a/lib/include/srslte/asn1/rrc_asn1.h +++ b/lib/include/srslte/asn1/rrc_asn1.h @@ -3555,8 +3555,7 @@ struct carrier_freqs_geran_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -10301,13 +10300,38 @@ struct sib_info_item_c { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -11070,8 +11094,7 @@ struct p_c_and_cbsr_r13_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -13044,8 +13067,8 @@ struct cqi_report_aperiodic_hybrid_r14_s { } private: - types type_; - choice_buffer_t c; + types type_; + choice_buffer_t c; void destroy_(); }; @@ -15023,8 +15046,8 @@ struct rlc_cfg_r15_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -16885,9 +16908,8 @@ struct rlc_cfg_c { } private: - types type_; - choice_buffer_t - c; + types type_; + choice_buffer_t c; void destroy_(); }; @@ -19947,8 +19969,7 @@ struct pucch_cfg_ded_r13_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -24109,8 +24130,8 @@ struct redirected_carrier_info_r15_ies_c { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -24642,8 +24663,8 @@ struct dl_ccch_msg_type_c { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -27631,8 +27652,8 @@ struct security_cfg_ho_v1530_s { } private: - types type_; - choice_buffer_t c; + types type_; + choice_buffer_t c; void destroy_(); }; @@ -32866,10 +32887,22 @@ struct eutra_event_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -33449,9 +33482,14 @@ struct report_cfg_inter_rat_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -33905,8 +33943,14 @@ struct meas_obj_to_add_mod_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -34059,8 +34103,14 @@ struct meas_obj_to_add_mod_ext_r13_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -35654,8 +35704,10 @@ struct rrc_conn_release_v920_ies_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -37165,8 +37217,10 @@ struct redirected_carrier_info_c { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -37707,8 +37761,8 @@ struct mob_from_eutra_cmd_r9_ies_s { } private: - types type_; - choice_buffer_t c; + types type_; + choice_buffer_t c; void destroy_(); }; @@ -39199,11 +39253,22 @@ struct dl_dcch_msg_type_c { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -39891,8 +39956,8 @@ struct paging_ue_id_c { } private: - types type_; - choice_buffer_t), sizeof(imsi_l), sizeof(s_tmsi_s)})> c; + types type_; + choice_buffer_t), sizeof(imsi_l), sizeof(s_tmsi_s), 0)> c; void destroy_(); }; @@ -45571,9 +45636,14 @@ struct meas_results_s { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -49218,12 +49288,22 @@ struct ul_dcch_msg_type_c { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -49434,11 +49514,22 @@ struct ul_dcch_msg_type_c { private: types type_; - choice_buffer_t + choice_buffer_t c; void destroy_(); @@ -55243,10 +55334,8 @@ struct cells_triggered_list_item_c_ { } private: - types type_; - choice_buffer_t - c; + types type_; + choice_buffer_t c; void destroy_(); };