Global: Fix some int/size_t conversion warnings.

This commit is contained in:
Unknown W. Brackets 2022-03-13 12:03:48 -07:00
parent da4b9e82f3
commit ffbd9bbe98
6 changed files with 9 additions and 9 deletions

View File

@ -831,7 +831,7 @@ void VulkanQueueRunner::LogRenderPass(const VKRStep &pass, bool verbose) {
INFO_LOG(G3D, "RENDER %s Begin(%s, draws: %d, %dx%d, %s, %s, %s)", pass.tag, framebuf, r.numDraws, w, h, RenderPassActionName(r.color), RenderPassActionName(r.depth), RenderPassActionName(r.stencil));
// TODO: Log these in detail.
for (int i = 0; i < pass.preTransitions.size(); i++) {
for (int i = 0; i < (int)pass.preTransitions.size(); i++) {
INFO_LOG(G3D, " PRETRANSITION: %s %s -> %s", pass.preTransitions[i].fb->tag.c_str(), AspectToString(pass.preTransitions[i].aspect), ImageLayoutToString(pass.preTransitions[i].targetLayout));
}

View File

@ -221,7 +221,7 @@ void ThreadManager::EnqueueTask(Task *task) {
}
// Find a thread with no outstanding work.
_assert_(maxThread <= global_->threads_.size());
_assert_(maxThread <= (int)global_->threads_.size());
for (int threadNum = minThread; threadNum < maxThread; threadNum++) {
ThreadContext *thread = global_->threads_[threadNum];
if (thread->queue_size.load() == 0) {

View File

@ -192,7 +192,7 @@ void RestoreRegisterEvent(int &event_type, const char *name, TimedCallback callb
event_type = -1;
if (event_type == -1)
event_type = nextEventTypeRestoreId++;
if (event_type >= event_types.size()) {
if (event_type >= (int)event_types.size()) {
// Give it any unused event id starting from the end.
// Older save states with messed up ids have gaps near the end.
for (int i = (int)event_types.size() - 1; i >= 0; --i) {
@ -202,7 +202,7 @@ void RestoreRegisterEvent(int &event_type, const char *name, TimedCallback callb
}
}
}
_assert_msg_(event_type >= 0 && event_type < event_types.size(), "Invalid event type %d", event_type);
_assert_msg_(event_type >= 0 && event_type < (int)event_types.size(), "Invalid event type %d", event_type);
event_types[event_type] = EventType{ callback, name };
usedEventTypes.insert(event_type);
restoredEventTypes.insert(event_type);

View File

@ -186,7 +186,7 @@ void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo, bool hasOK) {
// Without the scrollbar, we have 390 total pixels.
float WRAP_WIDTH = 340.0f;
if (UTF8StringNonASCIICount(text.c_str()) >= text.size() / 4) {
if ((size_t)UTF8StringNonASCIICount(text.c_str()) >= text.size() / 4) {
WRAP_WIDTH = 376.0f;
if (text.size() > 12) {
messageStyle.scale = 0.6f;

View File

@ -599,7 +599,7 @@ bool IsKeyMapped(int device, int key) {
bool ReplaceSingleKeyMapping(int btn, int index, KeyDef key) {
// Check for duplicate
for (int i = 0; i < g_controllerMap[btn].size(); ++i) {
for (int i = 0; i < (int)g_controllerMap[btn].size(); ++i) {
if (i != index && g_controllerMap[btn][i] == key) {
g_controllerMap[btn].erase(g_controllerMap[btn].begin()+index);
g_controllerMapGeneration++;

View File

@ -228,7 +228,7 @@ bool PresentationCommon::UpdatePostShader() {
bool usePreviousFrame = false;
bool usePreviousAtOutputResolution = false;
for (int i = 0; i < shaderInfo.size(); ++i) {
for (size_t i = 0; i < shaderInfo.size(); ++i) {
const ShaderInfo *next = i + 1 < shaderInfo.size() ? shaderInfo[i + 1] : nullptr;
if (!BuildPostShader(shaderInfo[i], next)) {
DestroyPostShader();
@ -712,7 +712,7 @@ void PresentationCommon::CopyToOutput(OutputFlags flags, int uvRotation, float u
// This is the last pass and we're going direct to the backbuffer after this.
// Redirect output to a separate framebuffer to keep the previous frame.
previousIndex_++;
if (previousIndex_ >= previousFramebuffers_.size())
if (previousIndex_ >= (int)previousFramebuffers_.size())
previousIndex_ = 0;
postShaderFramebuffer = previousFramebuffers_[previousIndex_];
}
@ -734,7 +734,7 @@ void PresentationCommon::CopyToOutput(OutputFlags flags, int uvRotation, float u
// Pick the next to render to.
previousIndex_++;
if (previousIndex_ >= previousFramebuffers_.size())
if (previousIndex_ >= (int)previousFramebuffers_.size())
previousIndex_ = 0;
Draw::Framebuffer *postShaderFramebuffer = previousFramebuffers_[previousIndex_];