Merge pull request #1310 from reicast/lk/lgtm
Core: Address some obvious lgtm issues
This commit is contained in:
commit
3905d6e9fb
|
@ -302,10 +302,9 @@ function reset() {
|
|||
}
|
||||
|
||||
socket_lm.onmessage =function got_packet(msg) {
|
||||
j = msg.data.split(';');
|
||||
f = 0;
|
||||
var j = msg.data.split(';'), f = 0;
|
||||
while (f < j.length - 1) {
|
||||
i = j[f].split(' ');
|
||||
var i = j[f].split(' ');
|
||||
if (i[0] == 'd') {
|
||||
ctx.strokeStyle = i[1];
|
||||
ctx.beginPath();
|
||||
|
|
|
@ -281,9 +281,6 @@ int core_fclose(core_file* fc)
|
|||
if (f->f) {
|
||||
fclose(f->f);
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
|
||||
delete f;
|
||||
|
||||
|
|
|
@ -396,8 +396,7 @@ int lws_client_socket_service(struct libwebsocket_context *context,
|
|||
* definitively ready from browser pov.
|
||||
*/
|
||||
len = 1;
|
||||
while (wsi->u.hdr.parser_state != WSI_PARSING_COMPLETE &&
|
||||
len > 0) {
|
||||
while (wsi->u.hdr.parser_state != WSI_PARSING_COMPLETE) {
|
||||
n = lws_ssl_capable_read(wsi, &c, 1);
|
||||
lws_latency(context, wsi, "send lws_issue_raw", n, n == 1);
|
||||
switch (n) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
#pragma once
|
||||
#include "deps/zlib/zlib.h"
|
||||
|
||||
#define DEFLATE_FRAME_COMPRESSION_LEVEL_SERVER 1
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "build.h"
|
||||
|
||||
/* The Libwebsocket version */
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
#ifndef NAOMI_CART_H
|
||||
#define NAOMI_CART_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
bool naomi_cart_Read(u32 offset, u32 size, void* dst);
|
||||
void* naomi_cart_GetPtr(u32 offset, u32 size);
|
||||
bool naomi_cart_SelectFile(void* handle);
|
||||
bool naomi_cart_SelectFile(void* handle);
|
||||
|
||||
#endif //NAOMI_CART_H
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef SH4_SCHED_H
|
||||
#define SH4_SCHED_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
/*
|
||||
|
@ -44,4 +47,6 @@ int sh4_sched_elapsed(int id);
|
|||
*/
|
||||
void sh4_sched_tick(int cycles);
|
||||
|
||||
extern u32 sh4_sched_intr;
|
||||
extern u32 sh4_sched_intr;
|
||||
|
||||
#endif //SH4_SCHED_H
|
||||
|
|
|
@ -140,7 +140,7 @@ bool CHDDisc::TryOpen(const wchar* file)
|
|||
|
||||
if (total_frames!=549300 || tracks.size()<3)
|
||||
{
|
||||
printf("WARNING: chd: Total frames is wrong: %d frames in %d tracks\n",total_frames,tracks.size());
|
||||
printf("WARNING: chd: Total frames is wrong: %u frames in %u tracks\n",total_frames,tracks.size());
|
||||
#ifndef NOT_REICAST
|
||||
msgboxf("This is an improper dump!",MBX_ICONEXCLAMATION);
|
||||
#endif
|
||||
|
|
|
@ -243,7 +243,7 @@ bool DiscSwap(u32 fileflags)
|
|||
printf("Loading default image \"%s\"\n",settings.imgread.DefaultImage);
|
||||
if (!InitDrive_(settings.imgread.DefaultImage))
|
||||
{
|
||||
msgboxf("Default image \"%s\" failed to load",MBX_ICONERROR);
|
||||
msgboxf("Default image \"%s\" failed to load",MBX_ICONERROR,settings.imgread.DefaultImage);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -330,7 +330,7 @@ void common_linux_setup()
|
|||
|
||||
settings.profile.run_counts=0;
|
||||
|
||||
printf("Linux paging: %08X %08X %08X\n",sysconf(_SC_PAGESIZE),PAGE_SIZE,PAGE_MASK);
|
||||
printf("Linux paging: %ld %08X %08X\n",sysconf(_SC_PAGESIZE),PAGE_SIZE,PAGE_MASK);
|
||||
verify(PAGE_MASK==(sysconf(_SC_PAGESIZE)-1));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
#ifndef DESCRAMBL_H
|
||||
#define DESCRAMBL_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
void descrambl_file(u32 FAD, u32 file_size, u8* dst);
|
||||
void descrambl_file(u32 FAD, u32 file_size, u8* dst);
|
||||
|
||||
#endif //DESCRAMBL_H
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "types.h"
|
||||
#ifndef REIOS_H
|
||||
#define REIOS_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
bool reios_init(u8* rom, u8* flash);
|
||||
|
||||
|
@ -13,3 +15,5 @@ char* reios_disk_id();
|
|||
extern char reios_software_name[129];
|
||||
|
||||
#define REIOS_OPCODE 0x085B
|
||||
|
||||
#endif //REIOS_H
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
#ifndef REIOS_ELF_H
|
||||
#define REIOS_ELF_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
bool reios_loadElf(const string& elf);
|
||||
bool reios_loadElf(const string& elf);
|
||||
|
||||
#endif //REIOS_ELF_H
|
||||
|
|
|
@ -746,8 +746,6 @@ GLuint gl_CompileShader(const char* shader,GLuint type)
|
|||
|
||||
if (!result && compile_log_len>0)
|
||||
{
|
||||
if (compile_log_len==0)
|
||||
compile_log_len=1;
|
||||
char* compile_log=(char*)malloc(compile_log_len);
|
||||
*compile_log=0;
|
||||
|
||||
|
@ -791,8 +789,6 @@ GLuint gl_CompileAndLink(const char* VertexShader, const char* FragmentShader)
|
|||
|
||||
if (!result && compile_log_len>0)
|
||||
{
|
||||
if (compile_log_len==0)
|
||||
compile_log_len=1;
|
||||
compile_log_len+= 1024;
|
||||
char* compile_log=(char*)malloc(compile_log_len);
|
||||
*compile_log=0;
|
||||
|
@ -1035,7 +1031,7 @@ void tryfit(float* x,float* y)
|
|||
int rep=1;
|
||||
|
||||
//discard values clipped to 0 or 1
|
||||
if (i<128 && y[i]==1 && y[i+1]==1)
|
||||
if (y[i]==1 && y[i+1]==1)
|
||||
continue;
|
||||
|
||||
if (i>0 && y[i]==0 && y[i-1]==0)
|
||||
|
@ -1045,7 +1041,7 @@ void tryfit(float* x,float* y)
|
|||
if (i>0 && y[i]!=1 && y[i-1]==1)
|
||||
rep=10000;
|
||||
|
||||
if (i<128 && y[i]!=0 && y[i+1]==0)
|
||||
if (y[i]!=0 && y[i+1]==0)
|
||||
rep=10000;
|
||||
|
||||
for (int j=0;j<rep;j++)
|
||||
|
|
Loading…
Reference in New Issue