++i;
}
/* And align the output. */
- i = (nrules * i) % __alignof__ (int32_t);
+ i = (nrules * i) % LOCFILE_ALIGN;
if (i > 0)
do
obstack_1grow (&weightpool, '\0');
- while (++i < __alignof__ (int32_t));
+ while (++i < LOCFILE_ALIGN);
add_locale_raw_obstack (&file, &weightpool);
struct element_t *runp = collate->mbheads[ch];
struct element_t *lastp;
- assert ((obstack_object_size (&extrapool)
- & (__alignof__ (int32_t) - 1)) == 0);
+ assert (LOCFILE_ALIGNED_P (obstack_object_size (&extrapool)));
tablemb[ch] = -obstack_object_size (&extrapool);
struct element_t *curp;
/* Compute how much space we will need. */
- added = ((sizeof (int32_t) + 1 + 2 * (runp->nmbs - 1)
- + __alignof__ (int32_t) - 1)
- & ~(__alignof__ (int32_t) - 1));
- assert ((obstack_object_size (&extrapool)
- & (__alignof__ (int32_t) - 1)) == 0);
+ added = LOCFILE_ALIGN_UP (sizeof (int32_t) + 1
+ + 2 * (runp->nmbs - 1));
+ assert (LOCFILE_ALIGNED_P (obstack_object_size (&extrapool)));
obstack_make_room (&extrapool, added);
/* More than one consecutive entry. We mark this by having
/* Output the weight info. */
weightidx = output_weight (&weightpool, collate, runp);
- added = ((sizeof (int32_t) + 1 + runp->nmbs - 1
- + __alignof__ (int32_t) - 1)
- & ~(__alignof__ (int32_t) - 1));
- assert ((obstack_object_size (&extrapool)
- & (__alignof__ (int32_t) - 1)) == 0);
+ added = LOCFILE_ALIGN_UP (sizeof (int32_t) + 1
+ + runp->nmbs - 1);
+ assert (LOCFILE_ALIGNED_P (obstack_object_size (&extrapool)));
obstack_make_room (&extrapool, added);
obstack_int32_grow_fast (&extrapool, weightidx);
}
/* Add alignment bytes if necessary. */
- while ((obstack_object_size (&extrapool)
- & (__alignof__ (int32_t) - 1)) != 0)
+ while (!LOCFILE_ALIGNED_P (obstack_object_size (&extrapool)))
obstack_1grow_fast (&extrapool, '\0');
/* Next entry. */
}
while (runp != NULL);
- assert ((obstack_object_size (&extrapool)
- & (__alignof__ (int32_t) - 1)) == 0);
+ assert (LOCFILE_ALIGNED_P (obstack_object_size (&extrapool)));
/* If the final entry in the list is not a single character we
add an UNDEFINED entry here. */
if (lastp->nmbs != 1)
{
- int added = ((sizeof (int32_t) + 1 + 1 + __alignof__ (int32_t) - 1)
- & ~(__alignof__ (int32_t) - 1));
+ int added = LOCFILE_ALIGN_UP (sizeof (int32_t) + 1 + 1);
obstack_make_room (&extrapool, added);
obstack_int32_grow_fast (&extrapool, 0);
obstack_1grow_fast (&extrapool, 0);
/* Add alignment bytes if necessary. */
- while ((obstack_object_size (&extrapool)
- & (__alignof__ (int32_t) - 1)) != 0)
+ while (!LOCFILE_ALIGNED_P (obstack_object_size (&extrapool)))
obstack_1grow_fast (&extrapool, '\0');
}
}
/* Add padding to the tables if necessary. */
- while ((obstack_object_size (&weightpool) & (__alignof__ (int32_t) - 1))
- != 0)
+ while (!LOCFILE_ALIGNED_P (obstack_object_size (&weightpool)))
obstack_1grow (&weightpool, 0);
/* Now add the four tables. */
/* Up to the next entry. */
cp += nhere;
- if ((1 + nhere) % __alignof__ (int32_t) != 0)
- cp += __alignof__ (int32_t) - (1 + nhere) % __alignof__ (int32_t);
+ if (!LOCFILE_ALIGNED_P (1 + nhere))
+ cp += LOCFILE_ALIGN - (1 + nhere) % LOCFILE_ALIGN;
}
else
{
{
/* Cannot be in this range. */
cp += 2 * nhere;
- if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0)
- cp += (__alignof__ (int32_t)
- - (1 + 2 * nhere) % __alignof__ (int32_t));
+ if (!LOCFILE_ALIGNED_P (1 + 2 * nhere))
+ cp += (LOCFILE_ALIGN
+ - (1 + 2 * nhere) % LOCFILE_ALIGN);
continue;
}
{
/* Cannot be in this range. */
cp += 2 * nhere;
- if ((1 + 2 * nhere) % __alignof__ (int32_t) != 0)
- cp += (__alignof__ (int32_t)
- - (1 + 2 * nhere) % __alignof__ (int32_t));
+ if (!LOCFILE_ALIGNED_P (1 + 2 * nhere))
+ cp += (LOCFILE_ALIGN
+ - (1 + 2 * nhere) % LOCFILE_ALIGN);
continue;
}