fprintf (fp, "Mobs %4d (%8d bytes), %2d free (%d bytes)\n",
count, count * (int)sizeof (*fch), count2,
count2 * (int)sizeof (*fch));
fprintf (fp, "Mobs %4d (%8u bytes), %2d free (%u bytes)\n",
count, count * (sizeof (*fch)), count2,
count2 * (sizeof (*fch))); /*line 3368*/
fprintf (fp, "Mobs %4d (%8lu bytes), %2d free (%lu bytes)\n",
count, count * (sizeof (*fch)), count2,
count2 * (sizeof (*fch))); /*line 3368*/
fprintf (fp, "Mobs %4d (%8d bytes), %2d free (%d bytes)\n",
count, count * (int)sizeof (*fch), count2,
count2 * (int)sizeof (*fch));
Well, using a small type still helps with structure padding. If you pad to every 4 bytes, and only need 0-255, then using 4 chars is much more memory efficient than using 4 ints. Yes, you still need to worry about the fetching and masking, but really, the masking is a trivial operation anyhow, and in the meantime you've reduced storage by four times (assuming 4-byte ints). (Everybody needs to fetch, so it's a common penalty.)