Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
@@ -185,7 +185,7 @@ GRFParameterInfo::GRFParameterInfo(uint nr) :
|
||||
* @param config The GRFConfig to get the value from.
|
||||
* @return The value of this parameter.
|
||||
*/
|
||||
uint32 GRFParameterInfo::GetValue(struct GRFConfig *config) const
|
||||
uint32_t GRFParameterInfo::GetValue(struct GRFConfig *config) const
|
||||
{
|
||||
/* GB doesn't work correctly with nbits == 32, so handle that case here. */
|
||||
if (this->num_bit == 32) return config->param[this->param_nr];
|
||||
@@ -197,7 +197,7 @@ uint32 GRFParameterInfo::GetValue(struct GRFConfig *config) const
|
||||
* @param config The GRFConfig to set the value in.
|
||||
* @param value The new value.
|
||||
*/
|
||||
void GRFParameterInfo::SetValue(struct GRFConfig *config, uint32 value)
|
||||
void GRFParameterInfo::SetValue(struct GRFConfig *config, uint32_t value)
|
||||
{
|
||||
/* SB doesn't work correctly with nbits == 32, so handle that case here. */
|
||||
if (this->num_bit == 32) {
|
||||
@@ -215,7 +215,7 @@ void GRFParameterInfo::SetValue(struct GRFConfig *config, uint32 value)
|
||||
void GRFParameterInfo::Finalize()
|
||||
{
|
||||
this->complete_labels = true;
|
||||
for (uint32 value = this->min_value; value <= this->max_value; value++) {
|
||||
for (uint32_t value = this->min_value; value <= this->max_value; value++) {
|
||||
if (this->value_names.count(value) == 0) {
|
||||
this->complete_labels = false;
|
||||
break;
|
||||
@@ -228,7 +228,7 @@ void GRFParameterInfo::Finalize()
|
||||
* Called when changing the default palette in advanced settings.
|
||||
* @param new_value Unused.
|
||||
*/
|
||||
void UpdateNewGRFConfigPalette(int32 new_value)
|
||||
void UpdateNewGRFConfigPalette(int32_t new_value)
|
||||
{
|
||||
for (GRFConfig *c = _grfconfig_newgame; c != nullptr; c = c->next) c->SetSuitablePalette();
|
||||
for (GRFConfig *c = _grfconfig_static; c != nullptr; c = c->next) c->SetSuitablePalette();
|
||||
@@ -274,7 +274,7 @@ static bool CalcGRFMD5Sum(GRFConfig *config, Subdirectory subdir)
|
||||
{
|
||||
FILE *f;
|
||||
Md5 checksum;
|
||||
uint8 buffer[1024];
|
||||
uint8_t buffer[1024];
|
||||
size_t len, size;
|
||||
|
||||
/* open the file */
|
||||
@@ -675,7 +675,7 @@ void ScanNewGRFFiles(NewGRFScanCallback *callback)
|
||||
* @param desired_version Requested version
|
||||
* @return The matching grf, if it exists in #_all_grfs, else \c nullptr.
|
||||
*/
|
||||
const GRFConfig *FindGRFConfig(uint32 grfid, FindGRFConfigMode mode, const MD5Hash *md5sum, uint32 desired_version)
|
||||
const GRFConfig *FindGRFConfig(uint32_t grfid, FindGRFConfigMode mode, const MD5Hash *md5sum, uint32_t desired_version)
|
||||
{
|
||||
assert((mode == FGCM_EXACT) != (md5sum == nullptr));
|
||||
const GRFConfig *best = nullptr;
|
||||
@@ -701,7 +701,7 @@ const GRFConfig *FindGRFConfig(uint32 grfid, FindGRFConfigMode mode, const MD5Ha
|
||||
* @param mask GRFID mask to allow for partial matching.
|
||||
* @return The grf config, if it exists, else \c nullptr.
|
||||
*/
|
||||
GRFConfig *GetGRFConfig(uint32 grfid, uint32 mask)
|
||||
GRFConfig *GetGRFConfig(uint32_t grfid, uint32_t mask)
|
||||
{
|
||||
GRFConfig *c;
|
||||
|
||||
|
Reference in New Issue
Block a user