Codechange: rename byte to uint8_t (#12308)

This commit is contained in:
Patric Stout
2024-03-16 23:59:32 +01:00
committed by GitHub
parent bd7120bae4
commit a3cfd23cf9
355 changed files with 1654 additions and 1656 deletions

View File

@@ -200,7 +200,7 @@ static bool CreateMainSurface(uint w, uint h)
_allegro_screen = create_bitmap_ex(bpp, screen->cr - screen->cl, screen->cb - screen->ct);
_screen.width = _allegro_screen->w;
_screen.height = _allegro_screen->h;
_screen.pitch = ((byte*)screen->line[1] - (byte*)screen->line[0]) / (bpp / 8);
_screen.pitch = ((uint8_t*)screen->line[1] - (uint8_t*)screen->line[0]) / (bpp / 8);
_screen.dst_ptr = _allegro_screen->line[0];
/* Initialise the screen so we don't blit garbage to the screen */
@@ -247,8 +247,8 @@ std::vector<int> VideoDriver_Allegro::GetListOfMonitorRefreshRates()
struct AllegroVkMapping {
uint16_t vk_from;
byte vk_count;
byte map_to;
uint8_t vk_count;
uint8_t map_to;
};
#define AS(x, z) {x, 0, z}

View File

@@ -134,7 +134,7 @@
struct CocoaVkMapping {
unsigned short vk_from;
byte map_to;
uint8_t map_to;
};
#define AS(x, z) {x, z}

View File

@@ -108,7 +108,7 @@ const char *VideoDriver_Dedicated::Start(const StringList &)
this->UpdateAutoResolution();
int bpp = BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
_dedicated_video_mem = (bpp == 0) ? nullptr : MallocT<byte>(static_cast<size_t>(_cur_resolution.width) * _cur_resolution.height * (bpp / 8));
_dedicated_video_mem = (bpp == 0) ? nullptr : MallocT<uint8_t>(static_cast<size_t>(_cur_resolution.width) * _cur_resolution.height * (bpp / 8));
_screen.width = _screen.pitch = _cur_resolution.width;
_screen.height = _cur_resolution.height;

View File

@@ -194,8 +194,8 @@ static bool IsOpenGLExtensionSupported(const char *extension)
return false;
}
static byte _gl_major_ver = 0; ///< Major OpenGL version.
static byte _gl_minor_ver = 0; ///< Minor OpenGL version.
static uint8_t _gl_major_ver = 0; ///< Major OpenGL version.
static uint8_t _gl_minor_ver = 0; ///< Minor OpenGL version.
/**
* Check if the current OpenGL version is equal or higher than a given one.
@@ -204,7 +204,7 @@ static byte _gl_minor_ver = 0; ///< Minor OpenGL version.
* @pre OpenGL was initialized.
* @return True if the OpenGL version is equal or higher than the requested one.
*/
bool IsOpenGLVersionAtLeast(byte major, byte minor)
bool IsOpenGLVersionAtLeast(uint8_t major, uint8_t minor)
{
return (_gl_major_ver > major) || (_gl_major_ver == major && _gl_minor_ver >= minor);
}
@@ -944,10 +944,10 @@ bool OpenGLBackend::Resize(int w, int h, bool force)
}
} else if (bpp == 8) {
if (_glClearBufferSubData != nullptr) {
byte b = 0;
uint8_t b = 0;
_glClearBufferSubData(GL_PIXEL_UNPACK_BUFFER, GL_R8, 0, line_pixel_count, GL_RED, GL_UNSIGNED_BYTE, &b);
} else {
ClearPixelBuffer<byte>(line_pixel_count, 0);
ClearPixelBuffer<uint8_t>(line_pixel_count, 0);
}
}
@@ -975,10 +975,10 @@ bool OpenGLBackend::Resize(int w, int h, bool force)
/* Initialize buffer as 0 == no remap. */
if (_glClearBufferSubData != nullptr) {
byte b = 0;
uint8_t b = 0;
_glClearBufferSubData(GL_PIXEL_UNPACK_BUFFER, GL_R8, 0, line_pixel_count, GL_RED, GL_UNSIGNED_BYTE, &b);
} else {
ClearPixelBuffer<byte>(line_pixel_count, 0);
ClearPixelBuffer<uint8_t>(line_pixel_count, 0);
}
_glBindTexture(GL_TEXTURE_2D, this->anim_texture);

View File

@@ -19,7 +19,7 @@
typedef void (*OGLProc)();
typedef OGLProc (*GetOGLProcAddressProc)(const char *proc);
bool IsOpenGLVersionAtLeast(byte major, byte minor);
bool IsOpenGLVersionAtLeast(uint8_t major, uint8_t minor);
const char *FindStringInExtensionList(const char *string, const char *substring);
class OpenGLSprite;

View File

@@ -241,15 +241,15 @@ std::vector<int> VideoDriver_SDL_Base::GetListOfMonitorRefreshRates()
struct SDLVkMapping {
SDL_Keycode vk_from;
byte vk_count;
byte map_to;
uint8_t vk_count;
uint8_t map_to;
bool unprintable;
};
#define AS(x, z) {x, 0, z, false}
#define AM(x, y, z, w) {x, (byte)(y - x), z, false}
#define AM(x, y, z, w) {x, (uint8_t)(y - x), z, false}
#define AS_UP(x, z) {x, 0, z, true}
#define AM_UP(x, y, z, w) {x, (byte)(y - x), z, true}
#define AM_UP(x, y, z, w) {x, (uint8_t)(y - x), z, true}
static const SDLVkMapping _vk_mapping[] = {
/* Pageup stuff + up/down */

View File

@@ -374,12 +374,12 @@ bool VideoDriver_SDL::ClaimMousePointer()
struct SDLVkMapping {
uint16_t vk_from;
byte vk_count;
byte map_to;
uint8_t vk_count;
uint8_t map_to;
};
#define AS(x, z) {x, 0, z}
#define AM(x, y, z, w) {x, (byte)(y - x), z}
#define AM(x, y, z, w) {x, (uint8_t)(y - x), z}
static const SDLVkMapping _vk_mapping[] = {
/* Pageup stuff + up/down */

View File

@@ -56,9 +56,9 @@ bool VideoDriver_Win32Base::ClaimMousePointer()
}
struct Win32VkMapping {
byte vk_from;
byte vk_count;
byte map_to;
uint8_t vk_from;
uint8_t vk_count;
uint8_t map_to;
};
#define AS(x, z) {x, 0, z}