look at this difference
on m68k, casting (uint8_t) in arithmetic operations forces the compiler to use 8bit-size operations ( in Motorola assembly are operations with the suffix ".b"), and this is relevant for how the ALU sets flags in the status register, specifically it's interesting for the overflow flag, which is handled in 2^(8-1) range, 2^(16-1) range, 2^(32-1) range, depending on suffix { ".b", ".w", ". l" }
on MIPS32, casting (uint8_t) in arithmetic operations ... seems to be completely irrelevant, what really matters on my Atlas C compiler is if you cast signed or unsigned. MIPS has no sized operation, everything is supposed to be 32bit. Oh, I still have to check what happens on MIPS64 where the ALU is 64bit.
The casting of pointers has the meaning of setting the operation size
e.g. you cast a pointer to 8bit, the alignment is 1byte, if you type pointer++, it's incremented by 1.
e.g. you cast a pointer to 16bit, the alignment is 2byte, if you type pointer++, it's incremented by 2.
e.g. you cast a pointer to 32bit, the alignment is 4byte, if you type pointer++, it's incremented by 4.
private void hAllo()
{
p_this_t p_this; /* void pointer */
p_uint8_t p_08;
p_uint16_t p_16;
p_uint32_t p_32;
char_t body[] = "0123456789abcdef";
p_this = body;
p_08 = p_this;
p_16 = p_this;
p_32 = p_this;
p_08++;
p_16++;
p_32++;
console_out_char( "08: ", (char_t) dereference(p_08), "\n" );
console_out_char( "16: ", (char_t) dereference(p_16), "\n" );
console_out_char( "32: ", (char_t) dereference(p_32), "\n" );
}
OrangeCube pointers $ obj/hAllo
08: 1
16: 2
32: 4