Permalink
Browse files

Merge pull request #10192 from unknownbrackets/minor

Warning fixes
  • Loading branch information...
hrydgard committed Nov 26, 2017
2 parents 5655b79 + 53b76b1 commit 2b271db79025a0670860a0f1be5e6e8893472430
@@ -50,7 +50,7 @@ const char *GetStringErrorMsg(int errCode) {
err_strw, buff_size, NULL);
static __declspec(thread) char err_str[buff_size] = {};
snprintf(err_str, buff_size, ConvertWStringToUTF8(err_strw).c_str());
snprintf(err_str, buff_size, "%s", ConvertWStringToUTF8(err_strw).c_str());
#else
static __thread char err_str[buff_size] = {};
@@ -468,7 +468,8 @@ bool DisassembleSPIRV(std::vector<uint32_t> spirv, std::string *output) {
uint32_t d = spirv[i];
int wordCount = d >> 16;
int opcode = d & 0xFFFF;
const OpInfo &op = opInfo[opcode];
// Force to a valid index in the array.
const OpInfo &op = opInfo[opcode >= (int)ARRAY_SIZE(opInfo) ? 0 : opcode];
int target = (i < (int)spirv.size() - 1) ? spirv[(i + 1)] : 0; // Not always, but used often enough that we get it here.
int source, source2, resType;
std::string name;
@@ -1648,18 +1648,21 @@ u32 __KernelDeleteThread(SceUID threadID, int exitStatus, const char *reason)
}
t->Cleanup();
}
// Before triggering, set v0. It'll be restored if one is called.
RETURN(error);
t->nt.status = THREADSTATUS_DEAD;
// Before triggering, set v0. It'll be restored if one is called.
RETURN(error);
t->nt.status = THREADSTATUS_DEAD;
if (__KernelThreadTriggerEvent((t->nt.attr & PSP_THREAD_ATTR_KERNEL) != 0, threadID, THREADEVENT_DELETE)) {
// Don't delete it yet. We'll delete later.
pendingDeleteThreads.push_back(threadID);
return 0;
if (__KernelThreadTriggerEvent((t->nt.attr & PSP_THREAD_ATTR_KERNEL) != 0, threadID, THREADEVENT_DELETE)) {
// Don't delete it yet. We'll delete later.
pendingDeleteThreads.push_back(threadID);
return 0;
} else {
return kernelObjects.Destroy<Thread>(threadID);
}
} else {
return kernelObjects.Destroy<Thread>(threadID);
RETURN(error);
return error;
}
}
@@ -176,7 +176,7 @@ u32 sceKernelLibcGettimeofday(u32 timeAddr, u32 tzAddr)
std::string KernelTimeNowFormatted() {
time_t emulatedTime = (time_t)start_time + (u32)(CoreTiming::GetGlobalTimeUs() / 1000000ULL);
tm* timePtr = localtime(&emulatedTime);
bool DST = timePtr->tm_isdst;
bool DST = timePtr->tm_isdst != 0;
u8 seconds = timePtr->tm_sec;
u8 minutes = timePtr->tm_min;
u8 hours = timePtr->tm_hour;
@@ -187,4 +187,4 @@ std::string KernelTimeNowFormatted() {
u16 years = timePtr->tm_year + 1900;
std::string timestamp = StringFromFormat("%04d-%02d-%02d_%02d-%02d-%02d", years, months, days, hours, minutes, seconds);
return timestamp;
}
}
@@ -171,7 +171,7 @@ void TextureReplacer::ParseHashRange(const std::string &key, const std::string &
return;
}
const u64 rangeKey = ((u64)addr << 32) | (fromW << 16) | fromH;
const u64 rangeKey = ((u64)addr << 32) | ((u64)fromW << 16) | fromH;
hashranges_[rangeKey] = WidthHeightPair(toW, toH);
}
@@ -511,7 +511,7 @@ std::string TextureReplacer::HashName(u64 cachekey, u32 hash, int level) {
}
bool TextureReplacer::LookupHashRange(u32 addr, int &w, int &h) {
const u64 rangeKey = ((u64)addr << 32) | (w << 16) | h;
const u64 rangeKey = ((u64)addr << 32) | ((u64)w << 16) | h;
auto range = hashranges_.find(rangeKey);
if (range != hashranges_.end()) {
const WidthHeightPair &wh = range->second;
@@ -156,7 +156,6 @@ bool ConvertToVulkanGLSL(std::string *dest, TranslatedShaderMetadata *destMetada
std::string line;
std::stringstream instream(src);
while (std::getline(instream, line)) {
char buffer[256];
int vecSize, num;
if (line.find("uniform bool") != std::string::npos) {
continue;
@@ -1,4 +1,19 @@
#pragma once
// Copyright (c) 2014- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "GPU/Common/StencilCommon.h"
@@ -2364,7 +2364,7 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
#ifndef MOBILE_DEVICE
CBreakPoints::ExecMemCheck(srcBasePtr + (srcY * srcStride + srcX) * bpp, false, height * srcStride * bpp, currentMIPS->pc);
CBreakPoints::ExecMemCheck(dstBasePtr + (srcY * dstStride + srcX) * bpp, true, height * dstStride * bpp, currentMIPS->pc);
CBreakPoints::ExecMemCheck(dstBasePtr + (dstY * dstStride + dstX) * bpp, true, height * dstStride * bpp, currentMIPS->pc);
#endif
// TODO: Correct timing appears to be 1.9, but erring a bit low since some of our other timing is inaccurate.
@@ -22,10 +22,10 @@ uint32_t colorAlpha(uint32_t rgb, float alpha) {
uint32_t alphaMul(uint32_t color, float alphaMul) {
uint32_t rgb = color & 0xFFFFFF;
uint32_t alpha = color >> 24;
int32_t alpha = color >> 24;
alpha *= alphaMul;
if (alpha < 0) alpha = 0.0f;
if (alpha > 255) alpha = 255.0f;
if (alpha < 0) alpha = 0;
if (alpha > 255) alpha = 255;
return (alpha << 24) | (rgb & 0xFFFFFF);
}
@@ -174,7 +174,7 @@ void TextDrawerAndroid::DrawString(DrawBuffer &target, const char *str, float x,
entry->lastUsedFrame = frameCount_;
draw_->BindTexture(0, entry->texture);
} else {
double size;
double size = 0.0;
auto iter = fontMap_.find(fontHash_);
if (iter != fontMap_.end()) {
size = iter->second.size;
@@ -82,7 +82,7 @@
#define PPSSPP_PLATFORM_WINDOWS 1
// UWP trickery
#if defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_PARTITION)
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
#define PPSSPP_PLATFORM_UWP 1
#ifdef _M_ARM
#define PPSSPP_ARCH_ARM_HARDFP 1

0 comments on commit 2b271db

Please sign in to comment.