View Single Post
Old March 16, 2020, 05:41   #5
Join Date: Aug 2019
Posts: 210
backwardsEric is on a distinguished road
Originally Posted by DavidMedley View Post
Confirming: "s32b" means "signed 32 bit integer"? Example:
	s32b new_mana, new_mana_frac;
If so, why use this construction instead of "signed long int"? Or just "long" for brevity?
Yes, it means a 32-bit signed integer. If one uses long, you don't have a guarantee about the size. For instance, when compiling 64-bit applications on Linux or Mac OS, a long is a 64-bit signed integer. There's a standard way of referring to integers with a known number of bits (int32_t, uint32_t, ....), and you'll see that used in h-basic.h to define what s32b is. But those types were introduced after Angband was originally written, and it's understandable that Angband adopted its own convention.
backwardsEric is offline   Reply With Quote