Fix some cases of variables being used uninitialized. Also some unused
variables, writeable strings and dangerously shadowed variables. index(), gamma(), exp() and y0() are POSIX functions and using those names can cause namespace confusion. A number of C files were missing the final newline required by ANSI C and some versions of GCC are pedantic enough to complain about this. These changes simply the scons build, allowing us to get rid of filterWarnings which is simply more trouble than it's worth. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5574 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
03d1438be8
commit
30e437f9e3
|
@ -389,7 +389,7 @@ typedef unsigned int ppc_word;
|
|||
{
|
||||
const char *cnd;
|
||||
|
||||
if (cnd = trap_condition[PPCGETD(in)]) {
|
||||
if ((cnd = trap_condition[PPCGETD(in)]) != NULL) {
|
||||
dp->flags |= dmode;
|
||||
sprintf(dp->opcode,"t%c%s",dmode?'d':'w',cnd);
|
||||
imm(dp,in,0,2,0);
|
||||
|
@ -408,7 +408,7 @@ typedef unsigned int ppc_word;
|
|||
if (i)
|
||||
dp->flags |= PPCF_64;
|
||||
sprintf(dp->opcode,"%si",cmpname[uimm*2+i]);
|
||||
if (i = (int)PPCGETCRD(in)) {
|
||||
if ((i = (int)PPCGETCRD(in))) {
|
||||
sprintf(oper,"cr%c,",'0'+i);
|
||||
dp->operands += 4;
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ typedef unsigned int ppc_word;
|
|||
|
||||
if (d & 0x8000) d |= 0xffff0000;
|
||||
|
||||
if (offs = branch(dp,in,"",(in&2)?1:0,d)) {
|
||||
if ((offs = branch(dp,in,"",(in&2)?1:0,d))) {
|
||||
oper += offs;
|
||||
*oper++ = ',';
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ typedef unsigned int ppc_word;
|
|||
if (i)
|
||||
dp->flags |= PPCF_64;
|
||||
strcpy(dp->opcode,cmpname[((in&PPCIDX2MASK)?2:0)+i]);
|
||||
if (i = (int)PPCGETCRD(in))
|
||||
if ((i = (int)PPCGETCRD(in)))
|
||||
oper += sprintf(oper,"cr%c,",'0'+i);
|
||||
ra_rb(oper,in);
|
||||
}
|
||||
|
@ -633,7 +633,7 @@ typedef unsigned int ppc_word;
|
|||
const char *cnd;
|
||||
int to = (int)PPCGETD(in);
|
||||
|
||||
if (cnd = trap_condition[to]) {
|
||||
if ((cnd = trap_condition[to])) {
|
||||
dp->flags |= dmode;
|
||||
sprintf(dp->opcode,"t%c%s",dmode?'d':'w',cnd);
|
||||
ra_rb(dp->operands,in);
|
||||
|
@ -991,7 +991,6 @@ typedef unsigned int ppc_word;
|
|||
|
||||
static void ps(struct DisasmPara_PPC *dp,ppc_word inst)
|
||||
{
|
||||
ppc_word pc = *dp->iaddr;
|
||||
char *op = dp->opcode;
|
||||
char *pr = dp->operands;
|
||||
switch ((inst>>1)&0x1F)
|
||||
|
@ -1015,7 +1014,7 @@ typedef unsigned int ppc_word;
|
|||
return;
|
||||
case 23:
|
||||
strcpy(op, "ps_sel");
|
||||
sprintf(pr, "p%u>=0?p%u:p%u", FD, FA, FC, FB);
|
||||
sprintf(pr, "p%u>=0?p%u:p%u", FD, FA, FC);
|
||||
return;
|
||||
case 24:
|
||||
strcpy(op, "ps_res");
|
||||
|
@ -1094,19 +1093,19 @@ typedef unsigned int ppc_word;
|
|||
return;
|
||||
case 0:
|
||||
strcpy(op, "ps_cmpu0");
|
||||
sprintf(pr, "ps_cmpu0", FD);
|
||||
sprintf(pr, "ps_cmpu0");
|
||||
return;
|
||||
case 32:
|
||||
strcpy(op,"ps_cmpq0");
|
||||
sprintf(pr, "ps_cmpo0", FD);
|
||||
sprintf(pr, "ps_cmpo0");
|
||||
return;
|
||||
case 64:
|
||||
strcpy(op,"ps_cmpu1");
|
||||
sprintf(pr, "ps_cmpu1", FD);
|
||||
sprintf(pr, "ps_cmpu1");
|
||||
return;
|
||||
case 96:
|
||||
strcpy(op,"ps_cmpo1");
|
||||
sprintf(pr, "ps_cmpo1", FD);
|
||||
sprintf(pr, "ps_cmpo1");
|
||||
return;
|
||||
case 528:
|
||||
strcpy(op,"ps_merge00");
|
||||
|
@ -1126,7 +1125,7 @@ typedef unsigned int ppc_word;
|
|||
return;
|
||||
case 1014:
|
||||
strcpy(op,"dcbz_l");
|
||||
sprintf(pr, "");
|
||||
*pr = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1138,7 +1137,6 @@ typedef unsigned int ppc_word;
|
|||
|
||||
static void ps_mem(struct DisasmPara_PPC *dp,ppc_word inst)
|
||||
{
|
||||
ppc_word pc = *dp->iaddr;
|
||||
char *op = dp->opcode;
|
||||
char *pr = dp->operands;
|
||||
switch (PPCGETIDX(inst))
|
||||
|
@ -1149,7 +1147,7 @@ typedef unsigned int ppc_word;
|
|||
break;
|
||||
case 57:
|
||||
strcpy(op,"psq_lu");
|
||||
sprintf(pr, "", FD);
|
||||
*pr = '\0';
|
||||
break;
|
||||
case 60:
|
||||
strcpy(op,"psq_st");
|
||||
|
|
|
@ -14,9 +14,4 @@ files = [
|
|||
if sys.platform == 'win32':
|
||||
files += [ "stdafx.cpp" ]
|
||||
|
||||
env_bochs = env.Clone(
|
||||
CCFLAGS = env.filterWarnings(env['CCFLAGS']),
|
||||
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
|
||||
)
|
||||
|
||||
env_bochs.StaticLibrary(env['local_libs'] + "bdisasm", files)
|
||||
env.StaticLibrary(env['local_libs'] + "bdisasm", files)
|
||||
|
|
|
@ -6,8 +6,4 @@ files = [
|
|||
"minilzo.c",
|
||||
]
|
||||
|
||||
env_lzo = env.Clone(
|
||||
CCFLAGS = env.filterWarnings(env['CCFLAGS']),
|
||||
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
|
||||
)
|
||||
env_lzo.StaticLibrary(env['local_libs'] + "lzo2", files)
|
||||
env.StaticLibrary(env['local_libs'] + "lzo2", files)
|
||||
|
|
|
@ -29,16 +29,10 @@ files = [
|
|||
'ltable.c',
|
||||
'ltablib.c',
|
||||
'ltm.c',
|
||||
'lua.c',
|
||||
'luac.c',
|
||||
'lundump.c',
|
||||
'lvm.c',
|
||||
'lzio.c',
|
||||
'print.c',
|
||||
]
|
||||
|
||||
env_lua = env.Clone(
|
||||
CCFLAGS = env.filterWarnings(env['CCFLAGS']),
|
||||
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
|
||||
)
|
||||
env_lua.StaticLibrary(env['local_libs'] + "lua", files)
|
||||
env.StaticLibrary(env['local_libs'] + "lua", files)
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef struct lua_TValue {
|
|||
|
||||
|
||||
/* Macros to set values */
|
||||
#define setnilvalue(obj) ((obj)->tt=LUA_TNIL)
|
||||
#define setnilvalue(obj) ((obj)->value.n=0, (obj)->tt=LUA_TNIL)
|
||||
|
||||
#define setnvalue(obj,x) \
|
||||
{ TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; }
|
||||
|
|
|
@ -91,4 +91,4 @@ typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
|
|||
// eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_AUTOMATIC"));
|
||||
// alBufferData(...);
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -14,9 +14,4 @@ files = [
|
|||
"SFML/Network/Unix/SocketHelper.cpp",
|
||||
]
|
||||
|
||||
env_sfml = env.Clone(
|
||||
CCFLAGS = env.filterWarnings(env['CCFLAGS']),
|
||||
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
|
||||
)
|
||||
|
||||
env_sfml.StaticLibrary(env['local_libs'] + "sfml-network", files)
|
||||
env.StaticLibrary(env['local_libs'] + "sfml-network", files)
|
||||
|
|
|
@ -209,7 +209,7 @@ Packet& Packet::operator >>(double& Data)
|
|||
Packet& Packet::operator >>(char* Data)
|
||||
{
|
||||
// First extract string length
|
||||
Uint32 Length;
|
||||
Uint32 Length = 0;
|
||||
*this >> Length;
|
||||
|
||||
if ((Length > 0) && CheckSize(Length))
|
||||
|
@ -227,7 +227,7 @@ Packet& Packet::operator >>(char* Data)
|
|||
Packet& Packet::operator >>(std::string& Data)
|
||||
{
|
||||
// First extract string length
|
||||
Uint32 Length;
|
||||
Uint32 Length = 0;
|
||||
*this >> Length;
|
||||
|
||||
Data.clear();
|
||||
|
@ -245,7 +245,7 @@ Packet& Packet::operator >>(std::string& Data)
|
|||
Packet& Packet::operator >>(wchar_t* Data)
|
||||
{
|
||||
// First extract string length
|
||||
Uint32 Length;
|
||||
Uint32 Length = 0;
|
||||
*this >> Length;
|
||||
|
||||
if ((Length > 0) && CheckSize(Length * sizeof(Int32)))
|
||||
|
@ -253,7 +253,7 @@ Packet& Packet::operator >>(wchar_t* Data)
|
|||
// Then extract characters
|
||||
for (Uint32 i = 0; i < Length; ++i)
|
||||
{
|
||||
Uint32 c;
|
||||
Uint32 c = 0;
|
||||
*this >> c;
|
||||
Data[i] = static_cast<wchar_t>(c);
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ Packet& Packet::operator >>(wchar_t* Data)
|
|||
Packet& Packet::operator >>(std::wstring& Data)
|
||||
{
|
||||
// First extract string length
|
||||
Uint32 Length;
|
||||
Uint32 Length = 0;
|
||||
*this >> Length;
|
||||
|
||||
Data.clear();
|
||||
|
@ -274,7 +274,7 @@ Packet& Packet::operator >>(std::wstring& Data)
|
|||
// Then extract characters
|
||||
for (Uint32 i = 0; i < Length; ++i)
|
||||
{
|
||||
Uint32 c;
|
||||
Uint32 c = 0;
|
||||
*this >> c;
|
||||
Data += static_cast<wchar_t>(c);
|
||||
}
|
||||
|
|
|
@ -9,10 +9,4 @@ files = [
|
|||
'stb_image_aug.c'
|
||||
]
|
||||
|
||||
env_soil = env.Clone(
|
||||
CCFLAGS = env.filterWarnings(env['CCFLAGS']),
|
||||
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
|
||||
parse_flags = ['-fPIC']
|
||||
)
|
||||
|
||||
env_soil.StaticLibrary(env['local_libs'] + "SOIL", files)
|
||||
env.StaticLibrary(env['local_libs'] + "SOIL", files)
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <string.h>
|
||||
|
||||
/* error reporting */
|
||||
char *result_string_pointer = "SOIL initialized";
|
||||
const char *result_string_pointer = "SOIL initialized";
|
||||
|
||||
/* for loading cube maps */
|
||||
enum{
|
||||
|
@ -54,7 +54,7 @@ enum{
|
|||
SOIL_CAPABILITY_PRESENT = 1
|
||||
};
|
||||
|
||||
static int has_cubemap_capability = SOIL_CAPABILITY_UNKNOWN;
|
||||
/* static int has_cubemap_capability = SOIL_CAPABILITY_UNKNOWN; */
|
||||
int query_cubemap_capability( void );
|
||||
#define SOIL_TEXTURE_WRAP_R 0x8072
|
||||
#define SOIL_CLAMP_TO_EDGE 0x812F
|
||||
|
@ -71,15 +71,15 @@ int query_cubemap_capability( void );
|
|||
#define SOIL_PROXY_TEXTURE_CUBE_MAP 0x851B
|
||||
#define SOIL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
||||
/* for non-power-of-two texture */
|
||||
static int has_NPOT_capability = SOIL_CAPABILITY_UNKNOWN;
|
||||
/* static int has_NPOT_capability = SOIL_CAPABILITY_UNKNOWN; */
|
||||
int query_NPOT_capability( void );
|
||||
/* for texture rectangles */
|
||||
static int has_tex_rectangle_capability = SOIL_CAPABILITY_UNKNOWN;
|
||||
/* static int has_tex_rectangle_capability = SOIL_CAPABILITY_UNKNOWN; */
|
||||
int query_tex_rectangle_capability( void );
|
||||
#define SOIL_TEXTURE_RECTANGLE_ARB 0x84F5
|
||||
#define SOIL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
|
||||
/* for using DXT compression */
|
||||
static int has_DXT_capability = SOIL_CAPABILITY_UNKNOWN;
|
||||
/* static int has_DXT_capability = SOIL_CAPABILITY_UNKNOWN; */
|
||||
int query_DXT_capability( void );
|
||||
#define SOIL_RGB_S3TC_DXT1 0x83F0
|
||||
#define SOIL_RGBA_S3TC_DXT1 0x83F1
|
||||
|
@ -1434,7 +1434,7 @@ int
|
|||
}
|
||||
#endif
|
||||
|
||||
unsigned char*
|
||||
unsigned char *
|
||||
SOIL_load_image
|
||||
(
|
||||
const char *filename,
|
||||
|
@ -1442,7 +1442,7 @@ unsigned char*
|
|||
int force_channels
|
||||
)
|
||||
{
|
||||
unsigned char *result = stbi_load( filename,
|
||||
stbi_uc *result = stbi_load( filename,
|
||||
width, height, channels, force_channels );
|
||||
if( result == NULL )
|
||||
{
|
||||
|
@ -1454,7 +1454,7 @@ unsigned char*
|
|||
return result;
|
||||
}
|
||||
|
||||
unsigned char*
|
||||
unsigned char *
|
||||
SOIL_load_image_from_memory
|
||||
(
|
||||
const unsigned char *const buffer,
|
||||
|
@ -1463,7 +1463,7 @@ unsigned char*
|
|||
int force_channels
|
||||
)
|
||||
{
|
||||
unsigned char *result = stbi_load_from_memory(
|
||||
stbi_uc *result = stbi_load_from_memory(
|
||||
buffer, buffer_length,
|
||||
width, height, channels,
|
||||
force_channels );
|
||||
|
|
|
@ -107,7 +107,7 @@ unsigned char* convert_image_to_DXT1(
|
|||
int i, j, x, y;
|
||||
unsigned char ublock[16*3];
|
||||
unsigned char cblock[8];
|
||||
int index = 0, chan_step = 1;
|
||||
int cindex = 0, chan_step = 1;
|
||||
int block_count = 0;
|
||||
/* error check */
|
||||
*out_size = 0;
|
||||
|
@ -172,7 +172,7 @@ unsigned char* convert_image_to_DXT1(
|
|||
/* copy the data from the block into the main block */
|
||||
for( x = 0; x < 8; ++x )
|
||||
{
|
||||
compressed[index++] = cblock[x];
|
||||
compressed[cindex++] = cblock[x];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ unsigned char* convert_image_to_DXT5(
|
|||
int i, j, x, y;
|
||||
unsigned char ublock[16*4];
|
||||
unsigned char cblock[8];
|
||||
int index = 0, chan_step = 1;
|
||||
int cindex = 0, chan_step = 1;
|
||||
int block_count = 0, has_alpha;
|
||||
/* error check */
|
||||
*out_size = 0;
|
||||
|
@ -259,7 +259,7 @@ unsigned char* convert_image_to_DXT5(
|
|||
/* copy the data from the compressed alpha block into the main buffer */
|
||||
for( x = 0; x < 8; ++x )
|
||||
{
|
||||
compressed[index++] = cblock[x];
|
||||
compressed[cindex++] = cblock[x];
|
||||
}
|
||||
/* then compress the color block */
|
||||
++block_count;
|
||||
|
@ -267,7 +267,7 @@ unsigned char* convert_image_to_DXT5(
|
|||
/* copy the data from the compressed color block into the main buffer */
|
||||
for( x = 0; x < 8; ++x )
|
||||
{
|
||||
compressed[index++] = cblock[x];
|
||||
compressed[cindex++] = cblock[x];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,14 +117,14 @@ typedef unsigned char validate_uint32[sizeof(uint32)==4];
|
|||
//
|
||||
|
||||
// this is not threadsafe
|
||||
static char *failure_reason;
|
||||
static const char *failure_reason;
|
||||
|
||||
char *stbi_failure_reason(void)
|
||||
const char *stbi_failure_reason(void)
|
||||
{
|
||||
return failure_reason;
|
||||
}
|
||||
|
||||
static int e(char *str)
|
||||
static int e(const char *str)
|
||||
{
|
||||
failure_reason = str;
|
||||
return 0;
|
||||
|
@ -333,10 +333,10 @@ extern int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, in
|
|||
static float h2l_gamma_i=1.0f/2.2f, h2l_scale_i=1.0f;
|
||||
static float l2h_gamma=2.2f, l2h_scale=1.0f;
|
||||
|
||||
void stbi_hdr_to_ldr_gamma(float gamma) { h2l_gamma_i = 1/gamma; }
|
||||
void stbi_hdr_to_ldr_gamma(float gammafactor) { h2l_gamma_i = 1/gammafactor; }
|
||||
void stbi_hdr_to_ldr_scale(float scale) { h2l_scale_i = 1/scale; }
|
||||
|
||||
void stbi_ldr_to_hdr_gamma(float gamma) { l2h_gamma = gamma; }
|
||||
void stbi_ldr_to_hdr_gamma(float gammafactor) { l2h_gamma = gammafactor; }
|
||||
void stbi_ldr_to_hdr_scale(float scale) { l2h_scale = scale; }
|
||||
#endif
|
||||
|
||||
|
@ -368,6 +368,8 @@ typedef struct
|
|||
static void start_file(stbi *s, FILE *f)
|
||||
{
|
||||
s->img_file = f;
|
||||
s->img_buffer = NULL;
|
||||
s->img_buffer_end = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1128,14 +1130,14 @@ static int process_marker(jpeg *z, int m)
|
|||
L = get16(&z->s)-2;
|
||||
while (L > 0) {
|
||||
uint8 *v;
|
||||
int sizes[16],i,m=0;
|
||||
int sizes[16],i,m2=0;
|
||||
int q = get8(&z->s);
|
||||
int tc = q >> 4;
|
||||
int th = q & 15;
|
||||
if (tc > 1 || th > 3) return e("bad DHT header","Corrupt JPEG");
|
||||
for (i=0; i < 16; ++i) {
|
||||
sizes[i] = get8(&z->s);
|
||||
m += sizes[i];
|
||||
m2 += sizes[i];
|
||||
}
|
||||
L -= 17;
|
||||
if (tc == 0) {
|
||||
|
@ -1145,9 +1147,9 @@ static int process_marker(jpeg *z, int m)
|
|||
if (!build_huffman(z->huff_ac+th, sizes)) return 0;
|
||||
v = z->huff_ac[th].values;
|
||||
}
|
||||
for (i=0; i < m; ++i)
|
||||
for (i=0; i < m2; ++i)
|
||||
v[i] = get8u(&z->s);
|
||||
L -= m;
|
||||
L -= m2;
|
||||
}
|
||||
return L==0;
|
||||
}
|
||||
|
@ -1671,10 +1673,10 @@ static int zbuild_huffman(zhuffman *z, uint8 *sizelist, int num)
|
|||
z->size[c] = (uint8)s;
|
||||
z->value[c] = (uint16)i;
|
||||
if (s <= ZFAST_BITS) {
|
||||
int k = bit_reverse(next_code[s],s);
|
||||
while (k < (1 << ZFAST_BITS)) {
|
||||
z->fast[k] = (uint16) c;
|
||||
k += (1 << s);
|
||||
int k2 = bit_reverse(next_code[s],s);
|
||||
while (k2 < (1 << ZFAST_BITS)) {
|
||||
z->fast[k2] = (uint16) c;
|
||||
k2 += (1 << s);
|
||||
}
|
||||
}
|
||||
++next_code[s];
|
||||
|
@ -1947,12 +1949,12 @@ static int parse_zlib(zbuf *a, int parse_header)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int do_zlib(zbuf *a, char *obuf, int olen, int exp, int parse_header)
|
||||
static int do_zlib(zbuf *a, char *obuf, int olen, int expandable, int parse_header)
|
||||
{
|
||||
a->zout_start = obuf;
|
||||
a->zout = obuf;
|
||||
a->zout_end = obuf + olen;
|
||||
a->z_expandable = exp;
|
||||
a->z_expandable = expandable;
|
||||
|
||||
return parse_zlib(a, parse_header);
|
||||
}
|
||||
|
@ -2092,10 +2094,13 @@ static int create_png_image_raw(png *a, uint8 *raw, uint32 raw_len, int out_n, u
|
|||
a->out = (uint8 *) malloc(x * y * out_n);
|
||||
if (!a->out) return e("outofmem", "Out of memory");
|
||||
if (!stbi_png_partial) {
|
||||
if (s->img_x == x && s->img_y == y)
|
||||
if (raw_len != (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
|
||||
else // interlaced:
|
||||
if (raw_len < (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
|
||||
if (s->img_x == x && s->img_y == y) {
|
||||
if (raw_len != (img_n * x + 1) * y)
|
||||
return e("not enough pixels","Corrupt PNG");
|
||||
} else { // interlaced:
|
||||
if (raw_len < (img_n * x + 1) * y)
|
||||
return e("not enough pixels","Corrupt PNG");
|
||||
}
|
||||
}
|
||||
for (j=0; j < y; ++j) {
|
||||
uint8 *cur = a->out + stride*j;
|
||||
|
@ -2861,7 +2866,7 @@ static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
|
|||
unsigned char *tga_palette = NULL;
|
||||
int i, j;
|
||||
unsigned char raw_data[4];
|
||||
unsigned char trans_data[4];
|
||||
unsigned char trans_data[4] = {0,0,0,0};
|
||||
int RLE_count = 0;
|
||||
int RLE_repeating = 0;
|
||||
int read_next_pixel = 1;
|
||||
|
@ -2995,6 +3000,8 @@ static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp)
|
|||
trans_data[2] = raw_data[0];
|
||||
trans_data[3] = raw_data[3];
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
// clear the reading flag for the next pixel
|
||||
read_next_pixel = 0;
|
||||
|
@ -3305,7 +3312,7 @@ stbi_uc *stbi_psd_load_from_memory (stbi_uc const *buffer, int len, int *x, int
|
|||
#ifndef STBI_NO_HDR
|
||||
static int hdr_test(stbi *s)
|
||||
{
|
||||
char *signature = "#?RADIANCE\n";
|
||||
const char *signature = "#?RADIANCE\n";
|
||||
int i;
|
||||
for (i=0; signature[i]; ++i)
|
||||
if (get8(s) != signature[i])
|
||||
|
@ -3335,10 +3342,10 @@ int stbi_hdr_test_file(FILE *f)
|
|||
#define HDR_BUFLEN 1024
|
||||
static char *hdr_gettoken(stbi *z, char *buffer)
|
||||
{
|
||||
int len=0;
|
||||
char *s = buffer, c = '\0';
|
||||
int len=0;
|
||||
char c = '\0';
|
||||
|
||||
c = get8(z);
|
||||
c = get8(z);
|
||||
|
||||
while (!at_eof(z) && c != '\n') {
|
||||
buffer[len++] = c;
|
||||
|
@ -3645,7 +3652,7 @@ stbi_uc *stbi_hdr_load_rgbe_memory(stbi_uc *buffer, int len, int *x, int *y, int
|
|||
|
||||
static void write8(FILE *f, int x) { uint8 z = (uint8) x; fwrite(&z,1,1,f); }
|
||||
|
||||
static void writefv(FILE *f, char *fmt, va_list v)
|
||||
static void writefv(FILE *f, const char *fmt, va_list v)
|
||||
{
|
||||
while (*fmt) {
|
||||
switch (*fmt++) {
|
||||
|
@ -3661,7 +3668,7 @@ static void writefv(FILE *f, char *fmt, va_list v)
|
|||
}
|
||||
}
|
||||
|
||||
static void writef(FILE *f, char *fmt, ...)
|
||||
static void writef(FILE *f, const char *fmt, ...)
|
||||
{
|
||||
va_list v;
|
||||
va_start(v, fmt);
|
||||
|
@ -3708,7 +3715,7 @@ static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp,
|
|||
}
|
||||
}
|
||||
|
||||
static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, int comp, void *data, int alpha, int pad, char *fmt, ...)
|
||||
static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, int comp, void *data, int alpha, int pad, const char *fmt, ...)
|
||||
{
|
||||
FILE *f = fopen(filename, "wb");
|
||||
if (f) {
|
||||
|
|
|
@ -204,17 +204,17 @@ extern float *stbi_loadf_from_file (FILE *f, int *x, int *y, i
|
|||
#endif
|
||||
extern float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp);
|
||||
|
||||
extern void stbi_hdr_to_ldr_gamma(float gamma);
|
||||
extern void stbi_hdr_to_ldr_gamma(float gammafactor);
|
||||
extern void stbi_hdr_to_ldr_scale(float scale);
|
||||
|
||||
extern void stbi_ldr_to_hdr_gamma(float gamma);
|
||||
extern void stbi_ldr_to_hdr_gamma(float gammafactor);
|
||||
extern void stbi_ldr_to_hdr_scale(float scale);
|
||||
|
||||
#endif // STBI_NO_HDR
|
||||
|
||||
// get a VERY brief reason for failure
|
||||
// NOT THREADSAFE
|
||||
extern char *stbi_failure_reason (void);
|
||||
extern const char *stbi_failure_reason (void);
|
||||
|
||||
// free the loaded image -- this is just free()
|
||||
extern void stbi_image_free (void *retval_from_stbi_load);
|
||||
|
|
|
@ -25,22 +25,6 @@ if env['HAVE_BLUEZ']:
|
|||
if sys.platform == 'darwin':
|
||||
files += [ "io_osx.m", ]
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
env_wiiuse = env.Clone(
|
||||
CCFLAGS = env.filterWarnings(env['CCFLAGS']) + ' -fvisibility=default -x objective-c++',
|
||||
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']) + ' -x objective-c++',
|
||||
)
|
||||
else:
|
||||
env_wiiuse = env.Clone(
|
||||
CCFLAGS = env.filterWarnings(env['CCFLAGS']) + ' -fvisibility=default',
|
||||
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
|
||||
parse_flags = ['-fPIC']
|
||||
)
|
||||
|
||||
libs = [
|
||||
'm',
|
||||
]
|
||||
|
||||
env_wiiuse.StaticLibrary(env['local_libs'] + "wiiuse", files, LIBS=libs)
|
||||
env.StaticLibrary(env['local_libs'] + "wiiuse", files, LIBS='m')
|
||||
|
||||
env['HAVE_WIIUSE'] = 1
|
||||
|
|
|
@ -57,8 +57,6 @@ static void guitar_hero_3_pressed_buttons(struct guitar_hero_3_t* gh3, short now
|
|||
* @return Returns 1 if handshake was successful, 0 if not.
|
||||
*/
|
||||
int guitar_hero_3_handshake(struct wiimote_t* wm, struct guitar_hero_3_t* gh3, byte* data, unsigned short len) {
|
||||
int offset = 0;
|
||||
|
||||
/*
|
||||
* The good fellows that made the Guitar Hero 3 controller
|
||||
* failed to factory calibrate the devices. There is no
|
||||
|
|
|
@ -267,7 +267,6 @@ int wiiuse_io_read(struct wiimote_t* wm) {
|
|||
struct timeval tv;
|
||||
fd_set fds;
|
||||
int r;
|
||||
int i;
|
||||
if (!wm)
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -682,7 +682,7 @@ static float ir_distance(struct ir_dot_t* dot) {
|
|||
* precision for a big increase in usability.
|
||||
*/
|
||||
static int ir_correct_for_bounds(int* x, int* y, enum aspect_t aspect, int offset_x, int offset_y) {
|
||||
int x0, y0;
|
||||
int xzero, yzero;
|
||||
int xs, ys;
|
||||
|
||||
if (aspect == WIIUSE_ASPECT_16_9) {
|
||||
|
@ -693,13 +693,13 @@ static int ir_correct_for_bounds(int* x, int* y, enum aspect_t aspect, int offse
|
|||
ys = WM_ASPECT_4_3_Y;
|
||||
}
|
||||
|
||||
x0 = ((1024 - xs) / 2) + offset_x;
|
||||
y0 = ((768 - ys) / 2) + offset_y;
|
||||
xzero = ((1024 - xs) / 2) + offset_x;
|
||||
yzero = ((768 - ys) / 2) + offset_y;
|
||||
|
||||
if ((*x >= x0)
|
||||
&& (*x <= (x0 + xs))
|
||||
&& (*y >= y0)
|
||||
&& (*y <= (y0 + ys)))
|
||||
if ((*x >= xzero)
|
||||
&& (*x <= (xzero + xs))
|
||||
&& (*y >= yzero)
|
||||
&& (*y <= (yzero + ys)))
|
||||
{
|
||||
*x -= offset_x;
|
||||
*y -= offset_y;
|
||||
|
|
37
SConstruct
37
SConstruct
|
@ -26,10 +26,16 @@ warnings = [
|
|||
'packed',
|
||||
'no-conversion',
|
||||
]
|
||||
# XXX check for the availability of these (in GCC 4.3 or newer)
|
||||
if sys.platform != 'darwin':
|
||||
warnings.append('no-array-bounds')
|
||||
warnings.append('no-unused-result')
|
||||
|
||||
compileFlags = [
|
||||
'-fno-exceptions',
|
||||
'-fno-strict-aliasing',
|
||||
'-msse2',
|
||||
'-fPIC',
|
||||
]
|
||||
|
||||
cppDefines = [
|
||||
|
@ -111,15 +117,18 @@ vars.AddVariables(
|
|||
BoolVariable('shared_soil', 'Use system shared libSOIL', False),
|
||||
BoolVariable('shared_lzo', 'Use system shared liblzo2', False),
|
||||
BoolVariable('shared_sfml', 'Use system shared libsfml-network', False),
|
||||
PathVariable('userdir', 'Set the name of the user data directory in home', '.dolphin-emu', PathVariable.PathAccept),
|
||||
PathVariable('userdir', 'Set the name of the user data directory in home',
|
||||
'.dolphin-emu', PathVariable.PathAccept),
|
||||
EnumVariable('install', 'Choose a local or global installation', 'local',
|
||||
allowed_values = ('local', 'global'),
|
||||
ignorecase = 2
|
||||
),
|
||||
PathVariable('prefix', 'Installation prefix (only used for a global build)', '/usr', PathVariable.PathAccept),
|
||||
PathVariable('destdir', 'Temporary install location (for package building)', None, PathVariable.PathAccept),
|
||||
PathVariable('prefix', 'Installation prefix (only used for a global build)',
|
||||
'/usr', PathVariable.PathAccept),
|
||||
PathVariable('destdir', 'Temporary install location (for package building)',
|
||||
None, PathVariable.PathAccept),
|
||||
EnumVariable('flavor', 'Choose a build flavor', 'release',
|
||||
allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'),
|
||||
allowed_values = ('release','devel','debug','fastlog','prof'),
|
||||
ignorecase = 2
|
||||
),
|
||||
PathVariable('wxconfig', 'Path to the wxconfig', None),
|
||||
|
@ -191,6 +200,7 @@ if (flavour == 'debug'):
|
|||
cppDefines.append('NDEBUG')
|
||||
elif (flavour == 'devel'):
|
||||
compileFlags.append('-ggdb')
|
||||
warnings.append('error')
|
||||
elif (flavour == 'fastlog'):
|
||||
compileFlags.append('-O3')
|
||||
cppDefines.append('DEBUGFAST')
|
||||
|
@ -200,8 +210,6 @@ elif (flavour == 'prof'):
|
|||
elif (flavour == 'release'):
|
||||
compileFlags.append('-O3')
|
||||
compileFlags.append('-fomit-frame-pointer');
|
||||
# XXX please test -Werror builds on Linux and Windows and remove this condition
|
||||
if sys.platform == 'darwin':
|
||||
warnings.append('error')
|
||||
# more warnings
|
||||
if env['lint']:
|
||||
|
@ -238,7 +246,8 @@ tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
|||
}
|
||||
|
||||
#object files
|
||||
env['build_dir'] = os.path.join(basedir, 'Build', platform.system() + '-' + platform.machine() + '-' + env['flavor'] + os.sep)
|
||||
env['build_dir'] = os.path.join(basedir, 'Build',
|
||||
platform.system() + '-' + platform.machine() + '-' + env['flavor'] + os.sep)
|
||||
|
||||
# Static libs go here
|
||||
env['local_libs'] = env['build_dir'] + os.sep + 'libs' + os.sep
|
||||
|
@ -260,7 +269,8 @@ if (env['install'] == 'global'):
|
|||
env['plugin_dir'] = env['prefix'] + 'lib/dolphin-emu/'
|
||||
env['data_dir'] = env['prefix'] + "share/dolphin-emu/"
|
||||
else:
|
||||
env['prefix'] = os.path.join(env['base_dir'] + 'Binary', platform.system() + '-' + platform.machine() + extra + os.sep)
|
||||
env['prefix'] = os.path.join(env['base_dir'] + 'Binary',
|
||||
platform.system() + '-' + platform.machine() + extra + os.sep)
|
||||
env['binary_dir'] = env['prefix']
|
||||
env['plugin_dir'] = env['prefix'] + 'plugins/'
|
||||
env['data_dir'] = env['prefix']
|
||||
|
@ -333,7 +343,8 @@ if not env['SHARED_LZO']:
|
|||
env['SHARED_SFML'] = 0;
|
||||
if env['shared_sfml']:
|
||||
# TODO: Check the version of sfml. It should be at least version 1.5
|
||||
env['SHARED_SFML'] = conf.CheckPKG('sfml-network') and conf.CheckCXXHeader("SFML/Network/Ftp.hpp")
|
||||
env['SHARED_SFML'] = conf.CheckPKG('sfml-network') and \
|
||||
conf.CheckCXXHeader("SFML/Network/Ftp.hpp")
|
||||
if not env['SHARED_SFML']:
|
||||
print "shared sfml-network library not detected"
|
||||
print "falling back to the static library"
|
||||
|
@ -349,8 +360,7 @@ if sys.platform == 'darwin':
|
|||
env['HAVE_X11'] = 0
|
||||
env['CC'] = "gcc-4.2"
|
||||
env['CXX'] = "g++-4.2"
|
||||
env['CFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
|
||||
env['CXXFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
|
||||
env['CCFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
|
||||
env['LINKFLAGS'] += ['-arch' , 'x86_64' , '-arch' , 'i386']
|
||||
conf.Define('MAP_32BIT', 0)
|
||||
else:
|
||||
|
@ -449,14 +459,11 @@ if env['HAVE_WX']:
|
|||
else:
|
||||
print "WX not found or disabled, not building GUI"
|
||||
|
||||
# add methods from utils to env
|
||||
env.AddMethod(utils.filterWarnings)
|
||||
|
||||
rev = utils.GenerateRevFile(env['flavor'],
|
||||
"Source/Core/Common/Src/svnrev_template.h",
|
||||
"Source/Core/Common/Src/svnrev.h")
|
||||
# print a nice progress indication when not compiling
|
||||
Progress(['-\r', '\\\r', '|\r', '/\r'], interval = 5)
|
||||
Progress(['-\r', '\\\r', '|\r', '/\r'], file=open('/dev/tty', 'w'), interval=5)
|
||||
|
||||
# Setup destdir for package building
|
||||
# Warning: The program will not run from this location. It is assumed the
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
import os
|
||||
import platform
|
||||
|
||||
# methods that should be added to env
|
||||
def filterWarnings(self, flags):
|
||||
return ' '.join(
|
||||
flag
|
||||
for flag in flags
|
||||
if not flag.startswith('-W')
|
||||
)
|
||||
|
||||
# taken from scons wiki
|
||||
def CheckPKGConfig(context, version):
|
||||
context.Message( 'Checking for pkg-config version > %s... ' % version)
|
||||
|
@ -28,8 +20,7 @@ def CheckFramework(context, name):
|
|||
}
|
||||
""", '.c')
|
||||
if not ret:
|
||||
context.env.Replace(FRAMEWORKS = lastFRAMEWORKS
|
||||
)
|
||||
context.env.Replace(FRAMEWORKS = lastFRAMEWORKS)
|
||||
|
||||
return ret
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ files = [
|
|||
]
|
||||
|
||||
acenv = env.Clone()
|
||||
acenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
|
||||
if acenv['HAVE_OPENAL']:
|
||||
files += [ 'OpenALStream.cpp', 'aldlist.cpp' ]
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
x.clear();
|
||||
while (number > 0)
|
||||
{
|
||||
unsigned int first;
|
||||
unsigned int first = 0;
|
||||
Do(first);
|
||||
std::string second;
|
||||
Do(second);
|
||||
|
|
|
@ -64,4 +64,4 @@ private:
|
|||
int num_entries_;
|
||||
};
|
||||
|
||||
#endif // _LINEAR_DISKCACHE
|
||||
#endif // _LINEAR_DISKCACHE
|
||||
|
|
|
@ -49,5 +49,4 @@ if sys.platform == 'win32':
|
|||
files += [ "stdafx.cpp" ]
|
||||
|
||||
env_common = env.Clone()
|
||||
env_common.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
env_common.StaticLibrary(env['local_libs'] + "common", files)
|
||||
|
|
|
@ -40,7 +40,7 @@ extern "C" {
|
|||
#include "lstate.h"
|
||||
};
|
||||
|
||||
// TODO Count: 7
|
||||
// TODO Count: 7
|
||||
|
||||
#if defined(DEBUG) || defined(DEBUGFAST)
|
||||
bool Debug = true;
|
||||
|
@ -1111,7 +1111,7 @@ DEFINE_LUA_FUNCTION(emulua_wait, "")
|
|||
|
||||
// we're only calling this to run user events. (a windows-only example of what that means is the canonical Peek/Translate/Dispatch loop)
|
||||
// hopefully this won't actually advance the emulation state in any non-user-input-driven way when called in this context...
|
||||
CoreTiming::Advance();
|
||||
CoreTiming::Advance();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1167,7 +1167,7 @@ void LuaRescueHook(lua_State* L, lua_Debug *dbg)
|
|||
{
|
||||
//lua_sethook(L, NULL, 0, 0);
|
||||
assert(L->errfunc || L->errorJmp);
|
||||
luaL_error(L, info.panic ? info.panicMessage : "terminated by user");
|
||||
luaL_error(L, info.panic ? info.panicMessage : "terminated by user");
|
||||
}
|
||||
|
||||
info.panic = false;
|
||||
|
@ -1382,7 +1382,7 @@ DEFINE_LUA_FUNCTION(emulua_frameadvance, "")
|
|||
if(info.speedMode == SPEEDMODE_MAXIMUM)
|
||||
CPluginManager::GetInstance().GetVideo()->Video_SetRendering(true);
|
||||
Frame::SetFrameStopping(false);
|
||||
*PowerPC::GetStatePtr() = PowerPC::CPU_RUNNING;
|
||||
*PowerPC::GetStatePtr() = PowerPC::CPU_RUNNING;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1410,7 +1410,7 @@ DEFINE_LUA_FUNCTION(emulua_redraw, "")
|
|||
|
||||
DEFINE_LUA_FUNCTION(memory_readbyte, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned char value = Memory::Read_U8(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
|
@ -1418,7 +1418,7 @@ DEFINE_LUA_FUNCTION(memory_readbyte, "address")
|
|||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readbytesigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed char value = (signed char)(Memory::Read_U8(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
|
@ -1426,7 +1426,7 @@ DEFINE_LUA_FUNCTION(memory_readbytesigned, "address")
|
|||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readword, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned short value = Memory::Read_U16(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
|
@ -1434,7 +1434,7 @@ DEFINE_LUA_FUNCTION(memory_readword, "address")
|
|||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readwordsigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed short value = (signed short)(Memory::Read_U16(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
|
@ -1442,7 +1442,7 @@ DEFINE_LUA_FUNCTION(memory_readwordsigned, "address")
|
|||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readdword, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long value = Memory::Read_U32(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
|
@ -1450,7 +1450,7 @@ DEFINE_LUA_FUNCTION(memory_readdword, "address")
|
|||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readdwordsigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed long value = (signed long)(Memory::Read_U32(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, value);
|
||||
|
@ -1458,7 +1458,7 @@ DEFINE_LUA_FUNCTION(memory_readdwordsigned, "address")
|
|||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readqword, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long long value = Memory::Read_U64(address);
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, (lua_Integer)value);
|
||||
|
@ -1466,7 +1466,7 @@ DEFINE_LUA_FUNCTION(memory_readqword, "address")
|
|||
}
|
||||
DEFINE_LUA_FUNCTION(memory_readqwordsigned, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
signed long long value = (signed long long)(Memory::Read_U64(address));
|
||||
lua_settop(L,0);
|
||||
lua_pushinteger(L, (lua_Integer)value);
|
||||
|
@ -1475,28 +1475,28 @@ DEFINE_LUA_FUNCTION(memory_readqwordsigned, "address")
|
|||
|
||||
DEFINE_LUA_FUNCTION(memory_writebyte, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned char value = (unsigned char)(luaL_checkinteger(L,2) & 0xFF);
|
||||
Memory::Write_U8(value, address);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_writeword, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned short value = (unsigned short)(luaL_checkinteger(L,2) & 0xFFFF);
|
||||
Memory::Write_U16(value, address);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_writedword, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long value = (unsigned long)(luaL_checkinteger(L,2));
|
||||
Memory::Write_U32(value, address);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_LUA_FUNCTION(memory_writeqword, "address,value")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long value = (unsigned long)(luaL_checkinteger(L,2));
|
||||
Memory::Write_U64(value, address);
|
||||
return 0;
|
||||
|
@ -1504,7 +1504,7 @@ DEFINE_LUA_FUNCTION(memory_writeqword, "address,value")
|
|||
|
||||
DEFINE_LUA_FUNCTION(memory_readbyterange, "address,length")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
int length = (int)luaL_checkinteger(L,2);
|
||||
|
||||
if(length < 0)
|
||||
|
@ -1533,7 +1533,7 @@ DEFINE_LUA_FUNCTION(memory_readbyterange, "address,length")
|
|||
|
||||
DEFINE_LUA_FUNCTION(memory_isvalid, "address")
|
||||
{
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
unsigned long address = luaL_checkinteger(L,1);
|
||||
lua_settop(L,0);
|
||||
lua_pushboolean(L, Memory::IsRAMAddress(address));
|
||||
return 1;
|
||||
|
@ -2790,7 +2790,7 @@ DEFINE_LUA_FUNCTION(emulua_loadrom, "filename")
|
|||
// Load game specific settings
|
||||
IniFile game_ini;
|
||||
std::string unique_id = StartUp.GetUniqueID();
|
||||
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
|
||||
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
|
||||
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
|
||||
{
|
||||
// General settings
|
||||
|
|
|
@ -141,4 +141,4 @@ void JitIL::fsign(UGeckoInstruction inst)
|
|||
PanicAlert("fsign bleh");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
|
||||
extern const unsigned int frsqrtex_lut[65536];
|
||||
|
||||
#endif //_LUT_frsqrtex_h_
|
||||
#endif //_LUT_frsqrtex_h_
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
|
|
|
@ -30,6 +30,5 @@ files = [
|
|||
]
|
||||
|
||||
acenv = env.Clone()
|
||||
acenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
|
||||
acenv.StaticLibrary(env['local_libs'] + 'dspcore', files, LIBS = [ 'common'] )
|
||||
|
|
|
@ -13,6 +13,5 @@ files = [
|
|||
]
|
||||
|
||||
acenv = env.Clone()
|
||||
acenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
|
||||
acenv.StaticLibrary(env['local_libs'] + 'debugger_ui_util', files)
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
#ifndef _WIN32
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
#include "Common.h"
|
||||
|
|
|
@ -238,8 +238,8 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno
|
|||
if ( NULL == device )
|
||||
return 0;
|
||||
|
||||
ControlState state;
|
||||
// this mode thing will be turned into a switch statement
|
||||
ControlState state = 0;
|
||||
|
||||
switch ( mode )
|
||||
{
|
||||
// OR
|
||||
|
|
|
@ -171,4 +171,5 @@
|
|||
{ kHIDUsage_KeyboardRightShift, "Right Shift" },
|
||||
{ kHIDUsage_KeyboardRightAlt, "Right Alt" },
|
||||
{ kHIDUsage_KeyboardRightGUI, "Right GUI" },
|
||||
/* 0x4E - 0xFFFF Reserved */
|
||||
/* 0x4E - 0xFFFF Reserved */
|
||||
|
||||
|
|
|
@ -39,5 +39,4 @@ if sys.platform == 'linux2':
|
|||
'ControllerInterface/Xlib/Xlib.cpp'
|
||||
]
|
||||
|
||||
icenv.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
icenv.StaticLibrary(env['local_libs'] + "inputcommon", files)
|
||||
|
|
|
@ -121,4 +121,4 @@ bool IsConnected(int Controller)
|
|||
|
||||
} // XInput
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -45,5 +45,4 @@ if env_vcommon['HAVE_OPENCL']:
|
|||
'OpenCL/OCLTextureDecoder.cpp',
|
||||
]
|
||||
|
||||
env_vcommon.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
env_vcommon.StaticLibrary(env['local_libs'] + "videocommon", files)
|
||||
|
|
|
@ -15,8 +15,7 @@ libs = [
|
|||
]
|
||||
|
||||
|
||||
dtenv.Append(CXXFLAGS = [ '-fPIC' ],
|
||||
LIBS = libs)
|
||||
dtenv.Append(LIBS = libs)
|
||||
if sys.platform == 'darwin':
|
||||
dtenv['FRAMEWORKS'] = ['CoreFoundation', 'Cocoa', 'System']
|
||||
|
||||
|
|
|
@ -17,5 +17,4 @@ if env['HAVE_WX']:
|
|||
|
||||
|
||||
env_inputpc = env.Clone()
|
||||
env_inputpc.Append(CXXFLAGS = [ '-fPIC' ])
|
||||
env_inputpc.StaticLibrary(env['local_libs'] + "inputplugincommon", files)
|
||||
|
|
|
@ -46,4 +46,4 @@ void CConfig::Save()
|
|||
ac_Config.Set(file);
|
||||
|
||||
file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "DSP.ini").c_str());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,11 +79,11 @@ void CMailHandler::DoState(PointerWrap &p)
|
|||
if (p.GetMode() == PointerWrap::MODE_READ)
|
||||
{
|
||||
Clear();
|
||||
int sz;
|
||||
int sz = 0;
|
||||
p.Do(sz);
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
u32 mail;
|
||||
u32 mail = 0;
|
||||
p.Do(mail);
|
||||
m_Mails.push(mail);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ if dspenv['HAVE_WX']:
|
|||
]
|
||||
|
||||
dspenv.Append(
|
||||
CXXFLAGS = [ '-fPIC' ],
|
||||
LIBS = [ 'common', 'audiocommon' ],
|
||||
)
|
||||
if sys.platform == 'darwin':
|
||||
|
|
|
@ -26,12 +26,10 @@ if env['HAVE_WX']:
|
|||
lleenv = env.Clone()
|
||||
if env['HAVE_WX']:
|
||||
lleenv.Append(
|
||||
CXXFLAGS = [ '-fPIC' ],
|
||||
LIBS = [ 'dspcore', 'audiocommon', 'common', 'debugger_ui_util' ],
|
||||
)
|
||||
else:
|
||||
lleenv.Append(
|
||||
CXXFLAGS = [ '-fPIC' ],
|
||||
LIBS = [ 'dspcore', 'audiocommon', 'common' ],
|
||||
)
|
||||
if sys.platform == 'darwin':
|
||||
|
|
|
@ -178,4 +178,4 @@ void DoState(unsigned char **ptr, int mode)
|
|||
} // Recording
|
||||
|
||||
|
||||
#endif // RERECORDING
|
||||
#endif // RERECORDING
|
||||
|
|
|
@ -151,4 +151,4 @@ void SetInterlacingMode(const BPCmd &bp)
|
|||
// TODO
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
@ -140,4 +140,4 @@ int GetNumAdapters();
|
|||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -31,4 +31,4 @@ namespace D3D
|
|||
// Utility functions
|
||||
LPDIRECT3DVERTEXSHADER9 CompileAndCreateVertexShader(const char *code, int len);
|
||||
LPDIRECT3DPIXELSHADER9 CompileAndCreatePixelShader(const char *code, int len);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -465,4 +465,4 @@ void DListCache::Cleanup()
|
|||
SETSTAT(stats.numDListsAlive,(int)dlists.size());
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -69,4 +69,4 @@ public:
|
|||
static void Call(u32 _addr, u32 _size);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
void DlgSettings_Show(HINSTANCE hInstance, HWND parent);
|
||||
void DlgSettings_Show(HINSTANCE hInstance, HWND parent);
|
||||
|
|
|
@ -519,4 +519,4 @@ const XFBSource** FramebufferManager::getVirtualXFBSource(u32 xfbAddr, u32 fbWid
|
|||
}
|
||||
|
||||
return &m_overlappingXFBArray[0];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,4 +28,4 @@
|
|||
// A global plugin specification
|
||||
extern PLUGIN_GLOBALS* globals;
|
||||
|
||||
#endif // _GLOBALS_H_
|
||||
#endif // _GLOBALS_H_
|
||||
|
|
|
@ -170,4 +170,4 @@ void D3DVertexFormat::SetupVertexPointers() const
|
|||
D3D::SetVertexDeclaration(d3d_decl);
|
||||
else
|
||||
ERROR_LOG(VIDEO, "invalid d3d decl");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,4 +81,4 @@ struct RGBAFloat
|
|||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -86,4 +86,4 @@ public:
|
|||
static void CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyfmt, int bScaleByHalf, const EFBRectangle &source_rect);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -145,4 +145,4 @@ namespace W32Util
|
|||
{
|
||||
Write(&i,sizeof(char));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,4 +58,4 @@ namespace W32Util
|
|||
}
|
||||
|
||||
|
||||
#endif //__LAMEFILE_H__
|
||||
#endif //__LAMEFILE_H__
|
||||
|
|
|
@ -99,4 +99,4 @@ namespace W32Util
|
|||
CloseClipboard();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,4 +6,4 @@ namespace W32Util
|
|||
HBITMAP CreateBitmapFromARGB(HWND someHwnd, DWORD *image, int w, int h);
|
||||
void NiceSizeFormat(size_t size, char * out);
|
||||
BOOL CopyTextToClipboard(HWND hwnd, char * text);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,4 +224,4 @@ namespace W32Util
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,4 +84,4 @@ namespace W32Util
|
|||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,4 +12,4 @@ namespace W32Util
|
|||
std::string& _strFileName);
|
||||
std::vector<std::string> BrowseForFileNameMultiSelect(bool _bLoad, HWND _hParent, const char *_pTitle,
|
||||
const char *_pInitialFolder,const char *_pFilter,const char *_pExtension);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,4 +79,4 @@ namespace W32Util
|
|||
if (_handle != NULL)
|
||||
SuspendThread(_handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,4 +27,4 @@ void XFUpdatePJ();
|
|||
void LoadXFReg(u32 transferSize, u32 address, u32 *pData);
|
||||
void LoadIndexedXF(u32 val, int array);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -24,4 +24,4 @@ int write_u_long_int ( unsigned long int u_long_int_val, FILE *fileout );
|
|||
int write_u_short_int ( unsigned short int u_short_int_val, FILE *fileout );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
|
|
|
@ -25,8 +25,7 @@ files = [
|
|||
'PostProcessing.cpp',
|
||||
'FramebufferManager.cpp',
|
||||
]
|
||||
compileFlags = [
|
||||
'-fPIC',
|
||||
compileFlags = [
|
||||
]
|
||||
linkFlags = [
|
||||
]
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
|
|
|
@ -226,7 +226,7 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord)
|
|||
bias >>= 1;
|
||||
lod += bias;
|
||||
|
||||
linear = (lod > 0 && (tm0.min_filter & 4) || lod <= 0 && tm0.mag_filter);
|
||||
linear = ((lod > 0 && (tm0.min_filter & 4)) || (lod <= 0 && tm0.mag_filter));
|
||||
|
||||
// order of checks matters
|
||||
// should be:
|
||||
|
|
|
@ -36,9 +36,6 @@ files = [
|
|||
'VideoConfig.cpp',
|
||||
'XFMemLoader.cpp',
|
||||
]
|
||||
compileFlags = [
|
||||
'-fPIC',
|
||||
]
|
||||
linkFlags = [
|
||||
]
|
||||
libs = [
|
||||
|
@ -56,7 +53,7 @@ conf = gfxenv.Configure(custom_tests = tests,
|
|||
|
||||
if sys.platform == 'darwin':
|
||||
gfxenv['FRAMEWORKS'] = ['CoreFoundation', 'System', 'OpenGL', 'Cocoa', 'Cg']
|
||||
compileFlags += ['-x','objective-c++',]
|
||||
compileFlags = ['-x','objective-c++',]
|
||||
files += [ 'cocoaGL.m', ]
|
||||
|
||||
conf.CheckPKG('OpenGL')
|
||||
|
@ -94,7 +91,6 @@ if gfxenv['USE_WX'] and not gfxenv['HAVE_WX']:
|
|||
print "Must have wx to use wxgl"
|
||||
Return()
|
||||
gfxenv.Append(
|
||||
CXXFLAGS = compileFlags,
|
||||
LINKFLAGS = linkFlags,
|
||||
)
|
||||
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
|
|
|
@ -30,8 +30,7 @@ if wmenv['HAVE_WX']:
|
|||
]
|
||||
libs = [ 'common', 'inputcommon' ]
|
||||
|
||||
|
||||
cxxflags = [ '-fPIC' ]
|
||||
cxxflags = [ ]
|
||||
|
||||
if wmenv['HAVE_WIIUSE']:
|
||||
libs += [ 'wiiuse' ]
|
||||
|
|
|
@ -41,4 +41,4 @@ private:
|
|||
int err;
|
||||
static int noinst;
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -63,7 +63,7 @@ wiimote_t** g_WiiMotesFromWiiUse = NULL;
|
|||
Common::Thread* g_pReadThread = NULL;
|
||||
int g_NumberOfWiiMotes;
|
||||
CWiiMote* g_WiiMotes[MAX_WIIMOTES];
|
||||
bool g_Shutdown = false;
|
||||
volatile bool g_Shutdown = false;
|
||||
Common::Event g_StartThread;
|
||||
Common::Event g_StopThreadTemporary;
|
||||
bool g_LocalThread = true;
|
||||
|
|
|
@ -193,4 +193,4 @@ void DoState(unsigned char **ptr, int mode)
|
|||
} // Recording
|
||||
|
||||
|
||||
#endif // RERECORDING
|
||||
#endif // RERECORDING
|
||||
|
|
|
@ -1,31 +1,30 @@
|
|||
# -*- python -*-
|
||||
|
||||
Import('env')
|
||||
import sys
|
||||
|
||||
name = "Plugin_nJoy_SDL"
|
||||
padenv = env.Clone()
|
||||
|
||||
if not env['HAVE_SDL']:
|
||||
print name + " must have SDL to be build"
|
||||
Return()
|
||||
|
||||
files = [
|
||||
'Config.cpp',
|
||||
'nJoy.cpp',
|
||||
'Rumble.cpp',
|
||||
]
|
||||
if padenv['HAVE_WX']:
|
||||
files += [
|
||||
'GUI/AboutBox.cpp',
|
||||
'GUI/ConfigAdvanced.cpp',
|
||||
'GUI/ConfigJoypad.cpp',
|
||||
'GUI/ConfigBox.cpp',
|
||||
]
|
||||
|
||||
padenv.Append(
|
||||
CXXFLAGS = [ '-fPIC' ],
|
||||
LIBS = [ 'common', 'inputcommon' ],
|
||||
)
|
||||
|
||||
padenv.SharedLibrary(env['plugin_dir']+name, files)
|
||||
# -*- python -*-
|
||||
|
||||
Import('env')
|
||||
import sys
|
||||
|
||||
name = "Plugin_nJoy_SDL"
|
||||
padenv = env.Clone()
|
||||
|
||||
if not env['HAVE_SDL']:
|
||||
print name + " must have SDL to be build"
|
||||
Return()
|
||||
|
||||
files = [
|
||||
'Config.cpp',
|
||||
'nJoy.cpp',
|
||||
'Rumble.cpp',
|
||||
]
|
||||
if padenv['HAVE_WX']:
|
||||
files += [
|
||||
'GUI/AboutBox.cpp',
|
||||
'GUI/ConfigAdvanced.cpp',
|
||||
'GUI/ConfigJoypad.cpp',
|
||||
'GUI/ConfigBox.cpp',
|
||||
]
|
||||
|
||||
padenv.Append(
|
||||
LIBS = [ 'common', 'inputcommon' ],
|
||||
)
|
||||
|
||||
padenv.SharedLibrary(env['plugin_dir']+name, files)
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
#define u8 unsigned char
|
||||
#define s8 signed char
|
||||
#define s16 signed short
|
||||
#define s32 signed int
|
||||
#define s32 signed int
|
||||
|
|
|
@ -56,4 +56,4 @@ u32 GetXER()
|
|||
: "=&r"(var)
|
||||
);
|
||||
return var;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
u32 GetCR0();
|
||||
u32 GetCR(u32 num);
|
||||
u32 GetXER();
|
||||
u32 GetXER();
|
||||
|
|
|
@ -17,4 +17,4 @@ void divwoRC(u32 *a, u32 *b, u32 *c, u32 *d);
|
|||
|
||||
void fsqrt(float *a, float *b, float *c, float *d);
|
||||
|
||||
void fsqrtRC(float *a, float *b, float *c, float *d);
|
||||
void fsqrtRC(float *a, float *b, float *c, float *d);
|
||||
|
|
|
@ -13,4 +13,4 @@ void fsqrtRC(float *a, float *b, float *c, float *d)
|
|||
"fsqrt. fr0,%0"
|
||||
: "=&r"(*a)
|
||||
);*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,4 +71,4 @@ void divwoRC(u32 *a, u32 *b, u32 *c, u32 *d)
|
|||
: "r"(*b), "r"(*c)
|
||||
: "cc"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,4 +185,4 @@ void RunInstruction(u32 inst)
|
|||
}
|
||||
if(f)
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,4 +49,4 @@ static inst instructions[] = {
|
|||
};
|
||||
|
||||
|
||||
void RunInstruction(u32 inst);
|
||||
void RunInstruction(u32 inst);
|
||||
|
|
|
@ -25,17 +25,6 @@
|
|||
#include "asm_tables.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
void die(char *msg){}
|
||||
|
||||
void initialise_fat(){}
|
||||
|
||||
void init_crap(){}
|
||||
|
||||
void end(){}
|
||||
#endif
|
||||
|
||||
|
||||
FILE *f = NULL;
|
||||
int main(int argc, char **argv) {
|
||||
init_crap();
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
all:
|
||||
g++ -g -arch ppc dolphintest_asm.cpp asm_tables.cpp Helpers.cpp asm_integer.cpp asm_float.cpp -o Test
|
||||
g++ -g -arch ppc dolphintest_asm.cpp asm_tables.cpp Helpers.cpp asm_integer.cpp asm_float.cpp -o Test
|
||||
|
|
|
@ -112,4 +112,4 @@ public:
|
|||
static void Initialize();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue