Skip to content

Commit

Permalink
Be consistent about using non-namespaced versions of standard integer…
Browse files Browse the repository at this point in the history
… types, see #470
  • Loading branch information
mikke89 committed Jun 4, 2023
1 parent f09cc28 commit 313cbab
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Backends/RmlUi_Backend_GLFW_VK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <RmlUi/Core/Core.h>
#include <RmlUi/Core/FileInterface.h>
#include <GLFW/glfw3.h>
#include <cstdint>
#include <stdint.h>
#include <thread>

static void SetupCallbacks(GLFWwindow* window);
Expand Down
1 change: 1 addition & 0 deletions Include/RmlUi/Core/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "../Config/Config.h"
#include "Traits.h"
#include <cstdlib>
#include <stdint.h>
#include <memory>

namespace Rml {
Expand Down
8 changes: 4 additions & 4 deletions Samples/basic/bitmapfont/src/FontEngineBitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int FontFaceBitmap::GenerateString(const String& string, const Vector2f& string_

int FontFaceBitmap::GetKerning(Character left, Character right) const
{
std::uint64_t key = (((std::uint64_t)left << 32) | (std::uint64_t)right);
uint64_t key = (((uint64_t)left << 32) | (uint64_t)right);

auto it = kerning.find(key);
if (it != kerning.end())
Expand Down Expand Up @@ -271,13 +271,13 @@ void FontParserBitmap::HandleElementStart(const String& name, const Rml::XMLAttr
}
else if (name == "kerning")
{
std::uint64_t first = (std::uint64_t)Get(attributes, "first", 0);
std::uint64_t second = (std::uint64_t)Get(attributes, "second", 0);
uint64_t first = (uint64_t)Get(attributes, "first", 0);
uint64_t second = (uint64_t)Get(attributes, "second", 0);
int amount = Get(attributes, "amount", 0);

if (first != 0 && second != 0 && amount != 0)
{
std::uint64_t key = ((first << 32) | second);
uint64_t key = ((first << 32) | second);
kerning[key] = amount;
}
}
Expand Down
3 changes: 1 addition & 2 deletions Samples/basic/bitmapfont/src/FontEngineBitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <RmlUi/Core/BaseXMLParser.h>
#include <RmlUi/Core/Texture.h>
#include <RmlUi/Core/Types.h>
#include <cstdint>

class FontFaceBitmap;

Expand All @@ -55,7 +54,7 @@ struct BitmapGlyph {
using FontGlyphs = Rml::UnorderedMap<Character, BitmapGlyph>;

// Mapping of combined (left, right) character to kerning in pixels.
using FontKerning = Rml::UnorderedMap<std::uint64_t, int>;
using FontKerning = Rml::UnorderedMap<uint64_t, int>;

class FontFaceBitmap {
public:
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/ElementStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ElementDefinition;
class PropertiesIterator;
enum class RelativeTarget;

enum class PseudoClassState : std::uint8_t { Clear = 0, Set = 1, Override = 2 };
enum class PseudoClassState : uint8_t { Clear = 0, Set = 1, Override = 2 };
using PseudoClassMap = SmallUnorderedMap<String, PseudoClassState>;

/**
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/FontEngineDefault/FontFaceHandleDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ class FontFaceHandleDefault final : public NonCopyMoveable {
FontLayerCache layer_cache;

// Pre-cache kerning pairs for some ascii subset of all characters.
using AsciiPair = std::uint16_t;
using KerningIntType = std::int16_t;
using AsciiPair = uint16_t;
using KerningIntType = int16_t;
using KerningPairs = UnorderedMap<AsciiPair, KerningIntType>;
KerningPairs kerning_pair_cache;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Layout/FlexFormattingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct FlexItem {
float hypothetical_main_size; // Outer size

// Used for resolving flexible length
enum class Violation : std::uint8_t { None = 0, Min, Max };
enum class Violation : uint8_t { None = 0, Min, Max };
bool frozen;
Violation violation;
float target_main_size; // Outer size
Expand Down
2 changes: 1 addition & 1 deletion Source/Lottie/ElementLottie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void ElementLottie::UpdateTexture()
const size_t total_bytes = bytes_per_line * render_dimensions.y;
byte* p_data = texture_data.get();

rlottie::Surface surface(reinterpret_cast<std::uint32_t*>(p_data), render_dimensions.x, render_dimensions.y, bytes_per_line);
rlottie::Surface surface(reinterpret_cast<uint32_t*>(p_data), render_dimensions.x, render_dimensions.y, bytes_per_line);
animation->renderSync(next_frame, surface);

// Swizzle the channel order from rlottie's BGRA to RmlUi's RGBA, and change pre-multiplied to post-multiplied alpha.
Expand Down

0 comments on commit 313cbab

Please sign in to comment.