{ &rts_entities[rts_memset], i_mapper_memset },
{ &rts_entities[rts_memcmp], i_mapper_memcmp }
};
- i_record rec[sizeof(mapper)/sizeof(mapper[0])];
- unsigned i, n_map;
+ i_record rec[lengthof(mapper)];
+ size_t n_map = 0;
- for (i = n_map = 0; i < sizeof(mapper)/sizeof(mapper[0]); ++i) {
+ for (size_t i = 0; i != lengthof(mapper); ++i) {
if (*mapper[i].ent != NULL) {
rec[n_map].i_call.kind = INTRINSIC_CALL;
rec[n_map].i_call.i_ent = *mapper[i].ent;
print_option_help(buf, buf2);
}
- size_t const n_options = sizeof(firm_options)/sizeof(firm_options[0]);
- for (size_t k = 0; k < n_options; ++k) {
+ for (size_t k = 0; k != lengthof(firm_options); ++k) {
char buf[1024];
char buf2[1024];
snprintf(buf, sizeof(buf), "-f%s", firm_options[k].option);
}
size_t const len = strlen(opt);
- size_t const n_options = sizeof(firm_options)/sizeof(firm_options[0]);
- for (size_t i = n_options; i != 0;) {
+ for (size_t i = lengthof(firm_options); i != 0;) {
struct params const* const o = &firm_options[--i];
if (len == o->opt_len && strncmp(opt, o->option, len) == 0) {
/* statistic options do accumulate */
{
assert(input.bufpos <= input.bufend);
if (input.bufpos >= input.bufend) {
- size_t n = decode(input.input, input.buf + MAX_PUTBACK,
- sizeof(input.buf)/sizeof(input.buf[0]) - MAX_PUTBACK);
+ size_t const n = decode(input.input, input.buf + MAX_PUTBACK, lengthof(input.buf) - MAX_PUTBACK);
if (n == 0) {
input.c = EOF;
return;
props[ATOMIC_TYPE_WCHAR_T] = props[ATOMIC_TYPE_INT];
/* set struct alignments to the same value as alignment */
- for (size_t i = 0;
- i < sizeof(atomic_type_properties)/sizeof(atomic_type_properties[0]);
- ++i) {
+ for (size_t i = 0; i != lengthof(atomic_type_properties); ++i) {
props[i].struct_alignment = props[i].alignment;
}
}