fix some warnings

This commit is contained in:
scribam 2022-11-16 08:55:46 +01:00 committed by flyinghead
parent 75dd5305c4
commit f6532ca27a
17 changed files with 37 additions and 40 deletions

View File

@ -75,17 +75,17 @@ static const double AEG_DSR_Time[64] =
};
// These times come from the documentation but don't sound correct.
// HT uses the AEG decay times instead and it sounds better.
static const double FEG_Time[] =
{
-1, -1, 472800.0, 405200.0, 354400.0, 283600.0, 236400.0, 202800.0,
177200.0, 142000.0, 118400.0, 101200.0, 88800.0, 70800.0, 59200.0, 50800.0,
44400.0, 35600.0, 29600.0, 25200.0, 22000.0, 17600.0, 14800.0, 12800.0,
11200.0, 8800.0, 7200.0, 6400.0, 5600.0, 4400.0, 3680.0, 3160.0,
2760.0, 2220.0, 1840.0, 1560.0, 1360.0, 1080.0, 920.0, 800.0,
680.0, 560.0, 440.0, 392.0, 340.0, 272.0, 228.0, 196.0,
172.0, 158.0, 136.0, 100.0, 88.0, 72.0, 56.0, 48.0,
44.0, 34.0, 28.0, 24.0, 22.0, 17.0, 14.0, 12.0
};
//static const double FEG_Time[] =
//{
// -1, -1, 472800.0, 405200.0, 354400.0, 283600.0, 236400.0, 202800.0,
// 177200.0, 142000.0, 118400.0, 101200.0, 88800.0, 70800.0, 59200.0, 50800.0,
// 44400.0, 35600.0, 29600.0, 25200.0, 22000.0, 17600.0, 14800.0, 12800.0,
// 11200.0, 8800.0, 7200.0, 6400.0, 5600.0, 4400.0, 3680.0, 3160.0,
// 2760.0, 2220.0, 1840.0, 1560.0, 1360.0, 1080.0, 920.0, 800.0,
// 680.0, 560.0, 440.0, 392.0, 340.0, 272.0, 228.0, 196.0,
// 172.0, 158.0, 136.0, 100.0, 88.0, 72.0, 56.0, 48.0,
// 44.0, 34.0, 28.0, 24.0, 22.0, 17.0, 14.0, 12.0
//};
static const float PLFOS_Scale[8] = { 0.f, 3.61f, 7.22f, 14.44f, 28.88f, 57.75f, 115.5f, 231.f };
static int PLFO_Scales[8][256];

View File

@ -563,12 +563,6 @@ static glm::vec3 getNormal(const T& vtx)
return { (int8_t)vtx.header.nx / 127.f, (int8_t)vtx.header.ny / 127.f, (int8_t)vtx.header.nz / 127.f };
}
template<>
glm::vec3 getNormal(const N2_VERTEX_VNU& vtx)
{
return { vtx.normal.nx, vtx.normal.ny, vtx.normal.nz };
}
template<typename T>
static void setNormal(Vertex& vd, const T& vs)
{

View File

@ -17,7 +17,9 @@ static u32 pvr_numscanlines = 512;
static u32 prv_cur_scanline = -1;
static u32 vblk_cnt;
#if !defined(NDEBUG) || defined(DEBUGFAST)
static float last_fps;
#endif
//54 mhz pixel clock
#define PIXEL_CLOCK (54*1000*1000/2)

View File

@ -486,8 +486,8 @@ static void markObjectListBlocks()
return;
}
}
for (int y = 0; y <= TA_GLOB_TILE_CLIP.tile_y_num; y++)
for (int x = 0; x <= TA_GLOB_TILE_CLIP.tile_x_num; x++)
for (u32 y = 0; y <= TA_GLOB_TILE_CLIP.tile_y_num; y++)
for (u32 x = 0; x <= TA_GLOB_TILE_CLIP.tile_x_num; x++)
{
pvr_write32p(addr, TA_OL_BASE);
addr += opBlockSize;

View File

@ -49,7 +49,6 @@ struct TLB_LinkedEntry {
static TLB_LinkedEntry full_table[65536];
static u32 full_table_size;
static TLB_LinkedEntry *entry_buckets[NBUCKETS];
u32 mmuAddressLUT[0x100000];
static u16 bucket_index(u32 address, int size, u32 asid)
{

View File

@ -512,6 +512,8 @@ void mmu_set_state()
SetMemoryHandlers();
}
u32 mmuAddressLUT[0x100000];
void MMU_init()
{
memset(ITLB_LRU_USE, 0xFF, sizeof(ITLB_LRU_USE));

View File

@ -18,6 +18,7 @@
*/
#include "hw/sh4/sh4_sched.h"
#ifdef TRACE_WINCE_SYSCALLS
#define PUserKData 0x00005800
#define SYSHANDLE_OFFSET 0x004
#define SYS_HANDLE_BASE 64
@ -225,10 +226,8 @@ static const char *wince_methods[][256] = {
},
};
#ifdef TRACE_WINCE_SYSCALLS
extern u32 unresolved_ascii_string;
extern u32 unresolved_unicode_string;
#endif
static inline std::string get_unicode_string(u32 addr)
{
@ -238,9 +237,7 @@ static inline std::string get_unicode_string(u32 addr)
u16 c;
if (!read_mem16(addr, c))
{
#ifdef TRACE_WINCE_SYSCALLS
unresolved_unicode_string = addr;
#endif
return "(page fault)";
}
if (c == 0)
@ -250,6 +247,7 @@ static inline std::string get_unicode_string(u32 addr)
}
return str;
}
static inline std::string get_ascii_string(u32 addr)
{
std::string str;
@ -258,9 +256,7 @@ static inline std::string get_ascii_string(u32 addr)
u8 c;
if (!read_mem8(addr++, c))
{
#ifdef TRACE_WINCE_SYSCALLS
unresolved_ascii_string = addr;
#endif
return "(page fault)";
}
if (c == 0)
@ -352,7 +348,9 @@ static bool print_wince_syscall(u32 address)
return false;
}
#endif
#if defined(FAST_MMU) && defined(USE_WINCE_HACK)
static bool wince_resolve_address(u32 va, TLB_Entry &entry)
{
// WinCE hack
@ -407,3 +405,4 @@ static bool wince_resolve_address(u32 va, TLB_Entry &entry)
return false;
}
#endif

View File

@ -260,7 +260,6 @@ struct PhysicalDrive:Disc
bool PhysicalTrack::Read(u32 FAD,u8* dst,SectorFormat* sector_type,u8* subcode,SubcodeFormat* subcode_type)
{
u32 fmt=0;
static u8 temp[2500];
u32 LBA=FAD-150;

View File

@ -216,6 +216,7 @@ std::string find_user_data_dir()
#endif
}
#ifndef __SWITCH__
static void addDirectoriesFromPath(std::vector<std::string>& dirs, const std::string& path, const std::string& suffix)
{
std::string::size_type pos = 0;
@ -231,6 +232,7 @@ static void addDirectoriesFromPath(std::vector<std::string>& dirs, const std::st
if (pos < path.length())
dirs.push_back(path.substr(pos) + suffix);
}
#endif
// Find a file in the user and system config directories.
// The following folders are checked in this order:

View File

@ -738,8 +738,8 @@ static pico_device *pico_eth_create()
return nullptr;
const u8 mac_addr[6] = { 0xc, 0xa, 0xf, 0xe, 0, 1 };
if (0 != pico_device_init(eth, "ETHPEER", mac_addr))
return nullptr;
if (0 != pico_device_init(eth, "ETHPEER", mac_addr))
return nullptr;
DEBUG_LOG(NETWORK, "Device %s created", eth->name);
@ -1045,8 +1045,8 @@ static void *pico_thread_func(void *)
PICO_IDLE();
}
for (auto it = tcp_listening_sockets.begin(); it != tcp_listening_sockets.end(); it++)
closesocket(it->second);
for (auto it = tcp_listening_sockets.begin(); it != tcp_listening_sockets.end(); it++)
closesocket(it->second);
close_native_sockets();
pico_socket_close(pico_tcp_socket);
pico_socket_close(pico_udp_socket);

View File

@ -54,7 +54,6 @@ struct DynaRBI : RuntimeBlockInfo
}
};
static u32 cycle_counter;
static u64 jmp_stack;
static Arm64UnwindInfo unwinder;

View File

@ -317,7 +317,7 @@ void DrawSorted(bool multipass)
//if any drawing commands, draw them
if (!pidx_sort.empty())
{
u32 count=pidx_sort.size();
std::size_t count = pidx_sort.size();
{
//set some 'global' modes for all primitives
@ -326,7 +326,7 @@ void DrawSorted(bool multipass)
glcache.StencilFunc(GL_ALWAYS,0,0);
glcache.StencilOp(GL_KEEP,GL_KEEP,GL_REPLACE);
for (u32 p=0; p<count; p++)
for (std::size_t p = 0; p < count; p++)
{
const PolyParam* params = pidx_sort[p].ppid;
if (pidx_sort[p].count>2) //this actually happens for some games. No idea why ..
@ -368,7 +368,7 @@ void DrawSorted(bool multipass)
glcache.DepthFunc(GL_GEQUAL);
glcache.DepthMask(GL_TRUE);
for (u32 p = 0; p < count; p++)
for (std::size_t p = 0; p < count; p++)
{
const PolyParam* params = pidx_sort[p].ppid;
if (pidx_sort[p].count > 2 && !params->isp.ZWriteDis) {

View File

@ -1694,7 +1694,7 @@ static void gui_display_settings()
OptionCheckbox("Widescreen Game Cheats", config::WidescreenGameHacks,
"Modify the game so that it displays in 16:9 anamorphic format and use horizontal screen stretching. Only some games are supported.");
const std::array<float, 5> aniso{ 1, 2, 4, 8, 16 };
const std::array<int, 5> aniso{ 1, 2, 4, 8, 16 };
const std::array<std::string, 5> anisoText{ "Disabled", "2x", "4x", "8x", "16x" };
u32 afSelected = 0;
for (u32 i = 0; i < aniso.size(); i++)
@ -2826,7 +2826,7 @@ void gui_display_osd()
ImGui::Begin("##osd", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoNav
| ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoBackground);
ImGui::SetWindowFontScale(1.5);
ImGui::TextColored(ImVec4(1, 1, 0, 0.7), "%s", message.c_str());
ImGui::TextColored(ImVec4(1, 1, 0, 0.7f), "%s", message.c_str());
ImGui::End();
}
imguiDriver->displayCrosshairs();

View File

@ -101,7 +101,7 @@ protected:
| vk::BufferUsageFlagBits::eStorageBuffer));
}
return mainBuffers[bufferIndex].get();
};
}
void MakeBuffers(int width, int height);
virtual vk::Format GetColorFormat() const = 0;

View File

@ -23,6 +23,7 @@
#include "vmallocator.h"
#include "vulkan_context.h"
#if !defined(NDEBUG) || defined(DEBUGFAST)
VKAPI_ATTR static void VKAPI_CALL vmaAllocateDeviceMemoryCallback(
VmaAllocator allocator,
uint32_t memoryType,
@ -44,6 +45,7 @@ VKAPI_ATTR static void VKAPI_CALL vmaFreeDeviceMemoryCallback(
}
static const VmaDeviceMemoryCallbacks memoryCallbacks = { vmaAllocateDeviceMemoryCallback, vmaFreeDeviceMemoryCallback };
#endif
void VMAllocator::Init(vk::PhysicalDevice physicalDevice, vk::Device device, vk::Instance instance)
{

View File

@ -281,9 +281,9 @@ void UpdateInputState()
#endif
}
#ifndef USE_SDL
static HWND hWnd;
#ifndef USE_SDL
// Windows class name to register
#define WINDOW_CLASS "nilDC"
static int window_x, window_y;

View File

@ -184,7 +184,6 @@ static void setupWindowMenu(void)
static void setupHelpMenu(void)
{
NSMenu *helpMenu;
NSString *title;
NSMenuItem *helpMenuItem;
NSMenuItem *menuItem;