@@ -85,7 +85,7 @@ class basic_pbf_writer {
8585
8686 void add_field (pbf_tag_type tag, pbf_wire_type type) {
8787 protozero_assert (((tag > 0 && tag < 19000 ) || (tag > 19999 && tag <= ((1U << 29U ) - 1 ))) && " tag out of range" );
88- const uint32_t b = (tag << 3U ) | uint32_t (type);
88+ const uint32_t b = (tag << 3U ) | static_cast < uint32_t > (type);
8989 add_varint (b);
9090 }
9191
@@ -105,7 +105,7 @@ class basic_pbf_writer {
105105 }
106106
107107 template <typename T, typename It>
108- void add_packed_fixed (pbf_tag_type tag, It first, It last, std::input_iterator_tag /* unused*/ ) {
108+ void add_packed_fixed (pbf_tag_type tag, It first, It last, std::input_iterator_tag /* unused*/ ) { // NOLINT(performance-unnecessary-value-param)
109109 if (first == last) {
110110 return ;
111111 }
@@ -118,7 +118,7 @@ class basic_pbf_writer {
118118 }
119119
120120 template <typename T, typename It>
121- void add_packed_fixed (pbf_tag_type tag, It first, It last, std::forward_iterator_tag /* unused*/ ) {
121+ void add_packed_fixed (pbf_tag_type tag, It first, It last, std::forward_iterator_tag /* unused*/ ) { // NOLINT(performance-unnecessary-value-param)
122122 if (first == last) {
123123 return ;
124124 }
@@ -133,7 +133,7 @@ class basic_pbf_writer {
133133 }
134134
135135 template <typename It>
136- void add_packed_varint (pbf_tag_type tag, It first, It last) {
136+ void add_packed_varint (pbf_tag_type tag, It first, It last) { // NOLINT(performance-unnecessary-value-param)
137137 if (first == last) {
138138 return ;
139139 }
@@ -146,7 +146,7 @@ class basic_pbf_writer {
146146 }
147147
148148 template <typename It>
149- void add_packed_svarint (pbf_tag_type tag, It first, It last) {
149+ void add_packed_svarint (pbf_tag_type tag, It first, It last) { // NOLINT(performance-unnecessary-value-param)
150150 if (first == last) {
151151 return ;
152152 }
@@ -162,7 +162,7 @@ class basic_pbf_writer {
162162 // a length-delimited field. The length has to fit into pbf_length_type,
163163 // and a varint needs 8 bit for every 7 bit.
164164 enum : int {
165- reserve_bytes = sizeof (pbf_length_type) * 8 / 7 + 1
165+ reserve_bytes = ( sizeof (pbf_length_type) * 8 / 7 ) + 1
166166 };
167167
168168 // If m_rollpack_pos is set to this special value, it means that when
@@ -181,7 +181,7 @@ class basic_pbf_writer {
181181 buffer_customization<TBuffer>::append_zeros (m_data, std::size_t (reserve_bytes));
182182 } else {
183183 m_rollback_pos = size_is_known;
184- add_length_varint (tag, pbf_length_type (size));
184+ add_length_varint (tag, static_cast < pbf_length_type> (size));
185185 reserve (size);
186186 }
187187 m_pos = buffer_customization<TBuffer>::size (m_data);
@@ -391,7 +391,7 @@ class basic_pbf_writer {
391391 add_field (tag, pbf_wire_type::varint);
392392 protozero_assert (m_pos == 0 && " you can't add fields to a parent basic_pbf_writer if there is an existing basic_pbf_writer for a submessage" );
393393 protozero_assert (m_data);
394- m_data->push_back (char (value));
394+ m_data->push_back (static_cast < char > (value));
395395 }
396396
397397 /* *
@@ -401,7 +401,7 @@ class basic_pbf_writer {
401401 * @param value Value to be written
402402 */
403403 void add_enum (pbf_tag_type tag, int32_t value) {
404- add_tagged_varint (tag, uint64_t (value));
404+ add_tagged_varint (tag, static_cast < uint64_t > (value));
405405 }
406406
407407 /* *
@@ -411,7 +411,7 @@ class basic_pbf_writer {
411411 * @param value Value to be written
412412 */
413413 void add_int32 (pbf_tag_type tag, int32_t value) {
414- add_tagged_varint (tag, uint64_t (value));
414+ add_tagged_varint (tag, static_cast < uint64_t > (value));
415415 }
416416
417417 /* *
@@ -441,7 +441,7 @@ class basic_pbf_writer {
441441 * @param value Value to be written
442442 */
443443 void add_int64 (pbf_tag_type tag, int64_t value) {
444- add_tagged_varint (tag, uint64_t (value));
444+ add_tagged_varint (tag, static_cast < uint64_t > (value));
445445 }
446446
447447 /* *
@@ -541,7 +541,7 @@ class basic_pbf_writer {
541541 protozero_assert (m_pos == 0 && " you can't add fields to a parent basic_pbf_writer if there is an existing basic_pbf_writer for a submessage" );
542542 protozero_assert (m_data);
543543 protozero_assert (size <= std::numeric_limits<pbf_length_type>::max ());
544- add_length_varint (tag, pbf_length_type (size));
544+ add_length_varint (tag, static_cast < pbf_length_type> (size));
545545 buffer_customization<TBuffer>::append (m_data, value, size);
546546 }
547547
@@ -602,7 +602,7 @@ class basic_pbf_writer {
602602 size_t sum_size = 0 ;
603603 (void )std::initializer_list<size_t >{sum_size += values.size ()...};
604604 protozero_assert (sum_size <= std::numeric_limits<pbf_length_type>::max ());
605- add_length_varint (tag, pbf_length_type (sum_size));
605+ add_length_varint (tag, static_cast < pbf_length_type> (sum_size));
606606 buffer_customization<TBuffer>::reserve_additional (m_data, sum_size);
607607 (void )std::initializer_list<int >{(buffer_customization<TBuffer>::append (m_data, values.data (), values.size ()), 0 )...};
608608 }
@@ -697,7 +697,7 @@ class basic_pbf_writer {
697697 * @param last Iterator pointing one past the end of data
698698 */
699699 template <typename InputIterator>
700- void add_packed_bool (pbf_tag_type tag, InputIterator first, InputIterator last) {
700+ void add_packed_bool (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
701701 add_packed_varint (tag, first, last);
702702 }
703703
@@ -711,7 +711,7 @@ class basic_pbf_writer {
711711 * @param last Iterator pointing one past the end of data
712712 */
713713 template <typename InputIterator>
714- void add_packed_enum (pbf_tag_type tag, InputIterator first, InputIterator last) {
714+ void add_packed_enum (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
715715 add_packed_varint (tag, first, last);
716716 }
717717
@@ -725,7 +725,7 @@ class basic_pbf_writer {
725725 * @param last Iterator pointing one past the end of data
726726 */
727727 template <typename InputIterator>
728- void add_packed_int32 (pbf_tag_type tag, InputIterator first, InputIterator last) {
728+ void add_packed_int32 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
729729 add_packed_varint (tag, first, last);
730730 }
731731
@@ -739,7 +739,7 @@ class basic_pbf_writer {
739739 * @param last Iterator pointing one past the end of data
740740 */
741741 template <typename InputIterator>
742- void add_packed_sint32 (pbf_tag_type tag, InputIterator first, InputIterator last) {
742+ void add_packed_sint32 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
743743 add_packed_svarint (tag, first, last);
744744 }
745745
@@ -753,7 +753,7 @@ class basic_pbf_writer {
753753 * @param last Iterator pointing one past the end of data
754754 */
755755 template <typename InputIterator>
756- void add_packed_uint32 (pbf_tag_type tag, InputIterator first, InputIterator last) {
756+ void add_packed_uint32 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
757757 add_packed_varint (tag, first, last);
758758 }
759759
@@ -767,7 +767,7 @@ class basic_pbf_writer {
767767 * @param last Iterator pointing one past the end of data
768768 */
769769 template <typename InputIterator>
770- void add_packed_int64 (pbf_tag_type tag, InputIterator first, InputIterator last) {
770+ void add_packed_int64 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
771771 add_packed_varint (tag, first, last);
772772 }
773773
@@ -781,7 +781,7 @@ class basic_pbf_writer {
781781 * @param last Iterator pointing one past the end of data
782782 */
783783 template <typename InputIterator>
784- void add_packed_sint64 (pbf_tag_type tag, InputIterator first, InputIterator last) {
784+ void add_packed_sint64 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
785785 add_packed_svarint (tag, first, last);
786786 }
787787
@@ -795,7 +795,7 @@ class basic_pbf_writer {
795795 * @param last Iterator pointing one past the end of data
796796 */
797797 template <typename InputIterator>
798- void add_packed_uint64 (pbf_tag_type tag, InputIterator first, InputIterator last) {
798+ void add_packed_uint64 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
799799 add_packed_varint (tag, first, last);
800800 }
801801
@@ -817,7 +817,7 @@ class basic_pbf_writer {
817817 * @param last Iterator pointing one past the end of data
818818 */
819819 template <typename ValueType, typename InputIterator>
820- void add_packed_fixed (pbf_tag_type tag, InputIterator first, InputIterator last) {
820+ void add_packed_fixed (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
821821 static_assert (std::is_same<ValueType, uint32_t >::value ||
822822 std::is_same<ValueType, int32_t >::value ||
823823 std::is_same<ValueType, int64_t >::value ||
@@ -838,7 +838,7 @@ class basic_pbf_writer {
838838 * @param last Iterator pointing one past the end of data
839839 */
840840 template <typename InputIterator>
841- void add_packed_fixed32 (pbf_tag_type tag, InputIterator first, InputIterator last) {
841+ void add_packed_fixed32 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
842842 add_packed_fixed<uint32_t , InputIterator>(tag, first, last,
843843 typename std::iterator_traits<InputIterator>::iterator_category{});
844844 }
@@ -853,7 +853,7 @@ class basic_pbf_writer {
853853 * @param last Iterator pointing one past the end of data
854854 */
855855 template <typename InputIterator>
856- void add_packed_sfixed32 (pbf_tag_type tag, InputIterator first, InputIterator last) {
856+ void add_packed_sfixed32 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
857857 add_packed_fixed<int32_t , InputIterator>(tag, first, last,
858858 typename std::iterator_traits<InputIterator>::iterator_category{});
859859 }
@@ -868,7 +868,7 @@ class basic_pbf_writer {
868868 * @param last Iterator pointing one past the end of data
869869 */
870870 template <typename InputIterator>
871- void add_packed_fixed64 (pbf_tag_type tag, InputIterator first, InputIterator last) {
871+ void add_packed_fixed64 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
872872 add_packed_fixed<uint64_t , InputIterator>(tag, first, last,
873873 typename std::iterator_traits<InputIterator>::iterator_category{});
874874 }
@@ -883,7 +883,7 @@ class basic_pbf_writer {
883883 * @param last Iterator pointing one past the end of data
884884 */
885885 template <typename InputIterator>
886- void add_packed_sfixed64 (pbf_tag_type tag, InputIterator first, InputIterator last) {
886+ void add_packed_sfixed64 (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
887887 add_packed_fixed<int64_t , InputIterator>(tag, first, last,
888888 typename std::iterator_traits<InputIterator>::iterator_category{});
889889 }
@@ -898,7 +898,7 @@ class basic_pbf_writer {
898898 * @param last Iterator pointing one past the end of data
899899 */
900900 template <typename InputIterator>
901- void add_packed_float (pbf_tag_type tag, InputIterator first, InputIterator last) {
901+ void add_packed_float (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
902902 add_packed_fixed<float , InputIterator>(tag, first, last,
903903 typename std::iterator_traits<InputIterator>::iterator_category{});
904904 }
@@ -913,7 +913,7 @@ class basic_pbf_writer {
913913 * @param last Iterator pointing one past the end of data
914914 */
915915 template <typename InputIterator>
916- void add_packed_double (pbf_tag_type tag, InputIterator first, InputIterator last) {
916+ void add_packed_double (pbf_tag_type tag, InputIterator first, InputIterator last) { // NOLINT(performance-unnecessary-value-param)
917917 add_packed_fixed<double , InputIterator>(tag, first, last,
918918 typename std::iterator_traits<InputIterator>::iterator_category{});
919919 }
0 commit comments