diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index 7abfa13db..362037527 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -36,22 +36,22 @@ namespace { // Validates that a Type is of a particular size and that its alignment is <= the size of the type. // Done with templates so that error messages include actual size. template -struct assert_eq : std::true_type { +struct AssertEq : std::true_type { static_assert(A == B, "A == B not satisfied"); }; template -struct assert_lte : std::true_type { +struct AssertLte : std::true_type { static_assert(A <= B, "A <= B not satisfied"); }; template -struct check_size : assert_eq, assert_lte { +struct CheckSize : AssertEq, AssertLte { }; // Check sizes and alignments of the structs that we decrypt and encrypt. // The decryption algorithm treats them as a stream of 32-bit uints, so the // sizes must be exact as there cannot be any padding. -static_assert(check_size<_HASHENTRY, 4 * 4>::value, "sizeof(_HASHENTRY) == 4 * 4 && alignof(_HASHENTRY) <= 4 * 4 not satisfied"); -static_assert(check_size<_BLOCKENTRY, 4 * 4>::value, "sizeof(_BLOCKENTRY) == 4 * 4 && alignof(_BLOCKENTRY) <= 4 * 4 not satisfied"); +static_assert(CheckSize<_HASHENTRY, 4 * 4>::value, "sizeof(_HASHENTRY) == 4 * 4 && alignof(_HASHENTRY) <= 4 * 4 not satisfied"); +static_assert(CheckSize<_BLOCKENTRY, 4 * 4>::value, "sizeof(_BLOCKENTRY) == 4 * 4 && alignof(_BLOCKENTRY) <= 4 * 4 not satisfied"); const char *DirToString(std::ios::seekdir dir) { diff --git a/Source/qol/itemlabels.cpp b/Source/qol/itemlabels.cpp index 2df92eb20..4b66fd807 100644 --- a/Source/qol/itemlabels.cpp +++ b/Source/qol/itemlabels.cpp @@ -18,13 +18,13 @@ namespace devilution { namespace { -struct itemLabel { +struct ItemLabel { int id, width; Point pos; std::string text; }; -std::vector labelQueue; +std::vector labelQueue; bool altPressed = false; bool isLabelHighlighted = false; @@ -88,7 +88,7 @@ void AddItemToLabelQueue(int id, int x, int y) y *= 2; } x -= nameWidth / 2; - labelQueue.push_back(itemLabel { id, nameWidth, { x, y }, textOnGround }); + labelQueue.push_back(ItemLabel { id, nameWidth, { x, y }, textOnGround }); } bool IsMouseOverGameArea() @@ -121,8 +121,8 @@ void DrawItemNameLabels(const CelOutputBuffer &out) do { canShow = true; for (unsigned int j = 0; j < i; ++j) { - itemLabel &a = labelQueue[i]; - itemLabel &b = labelQueue[j]; + ItemLabel &a = labelQueue[i]; + ItemLabel &b = labelQueue[j]; if (abs(b.pos.y - a.pos.y) < Height + BorderY) { int widthA = a.width + BorderX + MarginX * 2; int widthB = b.width + BorderX + MarginX * 2; @@ -145,7 +145,7 @@ void DrawItemNameLabels(const CelOutputBuffer &out) } while (!canShow); } - for (const itemLabel &label : labelQueue) { + for (const ItemLabel &label : labelQueue) { ItemStruct &itm = items[label.id]; if (MousePosition.x >= label.pos.x && MousePosition.x < label.pos.x + label.width && MousePosition.y >= label.pos.y - Height + MarginY && MousePosition.y < label.pos.y + MarginY) {