Merge branch 'master' into jgrpp

Remove 'byte' typedef
This commit is contained in:
Jonathan G Rennison
2024-05-07 17:21:50 +01:00
376 changed files with 2220 additions and 2152 deletions

View File

@@ -111,9 +111,9 @@ enum NIType {
struct NIProperty {
const char *name; ///< A (human readable) name for the property
ptrdiff_t offset; ///< Offset of the variable in the class
byte read_size; ///< Number of bytes (i.e. byte, word, dword etc)
byte prop; ///< The number of the property
byte type;
uint8_t read_size; ///< Number of bytes (i.e. byte, word, dword etc)
uint8_t prop; ///< The number of the property
uint8_t type;
};
@@ -122,11 +122,11 @@ struct NIProperty {
* information on when they actually apply.
*/
struct NICallback {
const char *name; ///< The human readable name of the callback
ptrdiff_t offset; ///< Offset of the variable in the class
byte read_size; ///< The number of bytes (i.e. byte, word, dword etc) to read
byte cb_bit; ///< The bit that needs to be set for this callback to be enabled
uint16_t cb_id; ///< The number of the callback
const char *name; ///< The human readable name of the callback
ptrdiff_t offset; ///< Offset of the variable in the class
uint8_t read_size; ///< The number of bytes (i.e. byte, word, dword etc) to read
uint8_t cb_bit; ///< The bit that needs to be set for this callback to be enabled
uint16_t cb_id; ///< The number of the callback
};
/** Mask to show no bit needs to be enabled for the callback. */
static const int CBM_NO_BIT = UINT8_MAX;
@@ -800,7 +800,7 @@ struct NewGRFInspectWindow : Window {
if (nif->properties != nullptr) {
this->DrawString(r, i++, "Properties:");
for (const NIProperty *nip = nif->properties; nip->name != nullptr; nip++) {
const void *ptr = (const byte *)base + nip->offset;
const void *ptr = (const uint8_t *)base + nip->offset;
uint value;
switch (nip->read_size) {
case 1: value = *(const uint8_t *)ptr; break;
@@ -832,7 +832,7 @@ struct NewGRFInspectWindow : Window {
this->DrawString(r, i++, "Callbacks:");
for (const NICallback *nic = nif->callbacks; nic->name != nullptr; nic++) {
if (nic->cb_bit != CBM_NO_BIT) {
const void *ptr = (const byte *)base_spec + nic->offset;
const void *ptr = (const uint8_t *)base_spec + nic->offset;
uint value;
switch (nic->read_size) {
case 1: value = *(const uint8_t *)ptr; break;