Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup some minor warnings #16378

Merged
merged 3 commits into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Common/Serialize/SerializeFuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ void Do(PointerWrap &p, tm &t);

// This makes it a compile error if you forget to define DoState() on non-POD.
// Which also can be a problem, for example struct tm is non-POD on linux, for whatever reason...
#ifdef _MSC_VER
template<typename T, bool isPOD = std::is_pod<T>::value, bool isPointer = std::is_pointer<T>::value>
#else
template<typename T, bool isPOD = __is_pod(T), bool isPointer = std::is_pointer<T>::value>
#endif
template<typename T, bool isPOD = std::is_standard_layout<T>::value && std::is_trivial<T>::value, bool isPointer = std::is_pointer<T>::value>
struct DoHelper_ {
static void DoArray(PointerWrap &p, T *x, int count) {
for (int i = 0; i < count; ++i)
Expand Down
6 changes: 3 additions & 3 deletions Common/UI/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

namespace UI {

const float ITEM_HEIGHT = 64.f;
const float MIN_TEXT_SCALE = 0.8f;
const float MAX_ITEM_SIZE = 65535.0f;
static constexpr Size ITEM_HEIGHT = 64.f;
static constexpr float MIN_TEXT_SCALE = 0.8f;
static constexpr float MAX_ITEM_SIZE = 65535.0f;

void MeasureBySpec(Size sz, float contentWidth, MeasureSpec spec, float *measured) {
*measured = sz;
Expand Down
10 changes: 4 additions & 6 deletions Common/UI/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ enum FocusDirection {
FOCUS_NEXT_PAGE,
};

enum {
WRAP_CONTENT = -1,
FILL_PARENT = -2,
};
typedef float Size; // can also be WRAP_CONTENT or FILL_PARENT.

static constexpr Size WRAP_CONTENT = -1.0f;
static constexpr Size FILL_PARENT = -2.0f;

// Gravity
enum Gravity {
Expand Down Expand Up @@ -174,8 +174,6 @@ enum class BorderStyle {
ITEM_DOWN_BG,
};

typedef float Size; // can also be WRAP_CONTENT or FILL_PARENT.

enum Orientation {
ORIENT_HORIZONTAL,
ORIENT_VERTICAL,
Expand Down
2 changes: 1 addition & 1 deletion Common/UI/ViewGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace UI {

const float ITEM_HEIGHT = 64.f;
static constexpr Size ITEM_HEIGHT = 64.f;

void ApplyGravity(const Bounds outer, const Margins &margins, float w, float h, int gravity, Bounds &inner) {
inner.w = w;
Expand Down
1 change: 0 additions & 1 deletion Common/VR/VRFramebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <cstdio>
#include <cstdlib>
#include <cstdbool>
#include <cstring>
#include <cmath>
#include <ctime>
Expand Down