void encode_positive_integer_32()

in src/detail/encode_integer.cpp [104:122]


void encode_positive_integer_32(encode_context &context, uint32_t value) {
  #define ENCODE(bits, digits) do { \
    using type = uint_fast ## bits ## _t; \
    return positive<type, digits>::encode(context, type(value)); \
  } while (false)
  #define CUTOFF(bits, digits, cutoff) if (value < cutoff ## UL) ENCODE(bits, digits);
  CUTOFF(32,  1, 10);
  CUTOFF(32,  2, 100);
  CUTOFF(32,  3, 1000);
  CUTOFF(32,  4, 10000);
  CUTOFF(32,  5, 100000);
  CUTOFF(32,  6, 1000000);
  CUTOFF(32,  7, 10000000);
  CUTOFF(32,  8, 100000000);
  CUTOFF(32,  9, 1000000000);
  ENCODE(32, 10);
  #undef CUTOFF
  #undef ENCODE
}