Adding of _t to (u)int types, and WChar to char32_t

See: eaae0bb5e
This commit is contained in:
Jonathan G Rennison
2024-01-07 16:41:53 +00:00
parent 55d78a23be
commit 97e6f3062e
655 changed files with 7555 additions and 7555 deletions

View File

@@ -173,7 +173,7 @@ WidgetDimensions WidgetDimensions::scaled = {};
*/
static inline RectPadding ScaleGUITrad(const RectPadding &r)
{
return {(uint8)ScaleGUITrad(r.left), (uint8)ScaleGUITrad(r.top), (uint8)ScaleGUITrad(r.right), (uint8)ScaleGUITrad(r.bottom)};
return {(uint8_t)ScaleGUITrad(r.left), (uint8_t)ScaleGUITrad(r.top), (uint8_t)ScaleGUITrad(r.right), (uint8_t)ScaleGUITrad(r.bottom)};
}
/**
@@ -540,7 +540,7 @@ static inline void DrawInset(const Rect &r, Colours colour, TextColour text_colo
* @param resize_x Matrix resize unit size.
* @param resize_y Matrix resize unit size.
*/
static inline void DrawMatrix(const Rect &r, Colours colour, bool clicked, uint16 data, uint resize_x, uint resize_y)
static inline void DrawMatrix(const Rect &r, Colours colour, bool clicked, uint16_t data, uint resize_x, uint resize_y)
{
DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, (clicked) ? FR_LOWERED : FR_NONE);
@@ -618,8 +618,8 @@ static inline void DrawVerticalScrollbar(const Rect &r, Colours colour, bool up_
/* track positions. These fractions are based on original 1x dimensions, but scale better. */
int left = r.left + r.Width() * 3 / 11; /* left track is positioned 3/11ths from the left */
int right = r.left + r.Width() * 8 / 11; /* right track is positioned 8/11ths from the left */
const uint8 bl = WidgetDimensions::scaled.bevel.left;
const uint8 br = WidgetDimensions::scaled.bevel.right;
const uint8_t bl = WidgetDimensions::scaled.bevel.left;
const uint8_t br = WidgetDimensions::scaled.bevel.right;
/* draw shaded lines */
GfxFillRect(left - bl, r.top + height, left - 1, r.bottom - height, c1);
@@ -657,8 +657,8 @@ static inline void DrawHorizontalScrollbar(const Rect &r, Colours colour, bool l
/* track positions. These fractions are based on original 1x dimensions, but scale better. */
int top = r.top + r.Height() * 3 / 11; /* top track is positioned 3/11ths from the top */
int bottom = r.top + r.Height() * 8 / 11; /* bottom track is positioned 8/11ths from the top */
const uint8 bt = WidgetDimensions::scaled.bevel.top;
const uint8 bb = WidgetDimensions::scaled.bevel.bottom;
const uint8_t bt = WidgetDimensions::scaled.bevel.top;
const uint8_t bb = WidgetDimensions::scaled.bevel.bottom;
/* draw shaded lines */
GfxFillRect(r.left + width, top - bt, r.right - width, top - 1, c1);
@@ -1120,7 +1120,7 @@ void NWidgetResizeBase::SetMinimalSizeAbsolute(uint min_x, uint min_y)
* @param spacing Extra unscaled spacing (eg WidgetDimensions::unscaled.framerect.Vertical()) of the widget.
* @param size Font size of text.
*/
void NWidgetResizeBase::SetMinimalTextLines(uint8 min_lines, uint8 spacing, FontSize size)
void NWidgetResizeBase::SetMinimalTextLines(uint8_t min_lines, uint8_t spacing, FontSize size)
{
this->uz_text_lines = min_lines;
this->uz_text_spacing = spacing;
@@ -1229,7 +1229,7 @@ NWidgetCore::NWidgetCore(WidgetType tp, Colours colour, WidgetID index, uint fil
* @param widget_data Data to use.
* @param tool_tip Tool tip string to use.
*/
void NWidgetCore::SetDataTip(uint32 widget_data, StringID tool_tip)
void NWidgetCore::SetDataTip(uint32_t widget_data, StringID tool_tip)
{
this->widget_data = widget_data;
this->tool_tip = tool_tip;
@@ -1504,7 +1504,7 @@ void NWidgetPIPContainer::AdjustPaddingForZoom()
* @param pip_post Additional space after the last child widget (below for the
* vertical container, at the right for the horizontal container).
*/
void NWidgetPIPContainer::SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post)
void NWidgetPIPContainer::SetPIP(uint8_t pip_pre, uint8_t pip_inter, uint8_t pip_post)
{
this->uz_pip_pre = pip_pre;
this->uz_pip_inter = pip_inter;
@@ -2210,7 +2210,7 @@ void NWidgetBackground::Add(std::unique_ptr<NWidgetBase> &&nwid)
* vertical container, at the right for the horizontal container).
* @note Using this function implies that the widget has (or will have) child widgets.
*/
void NWidgetBackground::SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post)
void NWidgetBackground::SetPIP(uint8_t pip_pre, uint8_t pip_inter, uint8_t pip_post)
{
if (this->child == nullptr) {
this->child = std::make_unique<NWidgetVertical>();
@@ -2262,7 +2262,7 @@ void NWidgetBackground::SetupSmallestSize(Window *w)
if (this->type == WWT_FRAME) {
/* Account for the size of the frame's text if that exists */
this->child->padding = WidgetDimensions::scaled.frametext;
this->child->padding.top = std::max<uint8>(WidgetDimensions::scaled.frametext.top, this->widget_data != STR_NULL ? GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.frametext.top / 2 : 0);
this->child->padding.top = std::max<uint8_t>(WidgetDimensions::scaled.frametext.top, this->widget_data != STR_NULL ? GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.frametext.top / 2 : 0);
this->smallest_x += this->child->padding.Horizontal();
this->smallest_y += this->child->padding.Vertical();
@@ -2427,7 +2427,7 @@ void NWidgetViewport::Draw(const Window *w)
* @param follow_flags Type of viewport, see #InitializeWindowViewport().
* @param zoom Zoom level.
*/
void NWidgetViewport::InitializeViewport(Window *w, uint32 follow_flags, ZoomLevel zoom)
void NWidgetViewport::InitializeViewport(Window *w, uint32_t follow_flags, ZoomLevel zoom)
{
InitializeWindowViewport(w, this->pos_x, this->pos_y, this->current_x, this->current_y, follow_flags, zoom);
w->viewport_widget = this;
@@ -2482,7 +2482,7 @@ int Scrollbar::GetScrolledRowFromWidget(int clickpos, const Window * const w, Wi
* @param key_code The pressed key code.
* @return ES_NOT_HANDLED when another key than the 6 specific keys was pressed, otherwise ES_HANDLED.
*/
EventState Scrollbar::UpdateListPositionOnKeyPress(int &list_position, uint16 keycode) const
EventState Scrollbar::UpdateListPositionOnKeyPress(int &list_position, uint16_t keycode) const
{
int new_pos = list_position;
switch (keycode) {