corrected c-style includes, added static_casts around compile time conversions

there were a lot of lines that needed static_casts to get rid of compiler
errors (c++11 issues) so I added them.  Replaced #include<lib.h>s with
#include<clib>s, and moved them below the local includes
This commit is contained in:
xhainingx 2013-04-13 02:52:13 +00:00
parent 1478ebebeb
commit bc8a01178d
33 changed files with 1665 additions and 1629 deletions

View File

@ -1,15 +1,15 @@
/// \file
/// \brief 6502 assembler and disassembler
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "types.h"
#include "utils/xstring.h"
#include "debug.h"
#include "asm.h"
#include "x6502.h"
#include <cstring>
#include <cstdlib>
#include <cstdio>
///assembles the string to an instruction located at addr, storing opcodes in output buffer
int Assemble(unsigned char *output, int addr, char *str) {
//unsigned char opcode[3] = { 0,0,0 };

View File

@ -21,10 +21,6 @@
/// \file
/// \brief This file contains all code for coordinating the mapping in of the address space external to the NES.
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include "types.h"
#include "fceu.h"
#include "ppu.h"
@ -37,6 +33,11 @@
#include "utils/memory.h"
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <climits>
uint8 *Page[32], *VPage[8];
uint8 **VPageR = VPage;
uint8 *VPageG[8];

View File

@ -18,11 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "types.h"
#include "x6502.h"
@ -33,6 +28,12 @@
#include "driver.h"
#include "utils/memory.h"
#include <string>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cctype>
using namespace std;
static uint8 *CheatRPtrs[64];

View File

@ -39,16 +39,16 @@
* PC Bank -> 'K'
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include "conddebug.h"
#include "types.h"
#include "utils/memory.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
// Next non-whitespace character in string
char next;

View File

@ -1,16 +1,16 @@
/// \file
/// \brief Contains methods related to the build configuration
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
#include "version.h"
#include "fceu.h"
#include "driver.h"
#include "utils/memory.h"
#include <cstring>
#include <cstdio>
#include <cstdlib>
static char *aboutString = 0;
///returns a string suitable for use in an aboutbox

View File

@ -1,9 +1,5 @@
/// \file
/// \brief Implements core debugging facilities
#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -15,6 +11,10 @@
#include "x6502abbrev.h"
#include <cstdlib>
#include <cstring>
int vblankScanLines = 0; //Used to calculate scanlines 240-261 (vblank)
int vblankPixel = 0; //Used to calculate the pixels in vblank

View File

@ -1,5 +1,3 @@
#include <assert.h>
void DrawTextLineBG(uint8 *dest);
void DrawMessage(bool beforeMovie);
void FCEU_DrawRecordingStatus(uint8* XBuf);

View File

@ -1,14 +1,14 @@
#ifndef __DRIVER_H_
#define __DRIVER_H_
#include <stdio.h>
#include <string>
#include <iosfwd>
#include "types.h"
#include "git.h"
#include "file.h"
#include <cstdio>
#include <cstring>
#include <iosfwd>
FILE *FCEUD_UTF8fopen(const char *fn, const char *mode);
inline FILE *FCEUD_UTF8fopen(const std::string &n, const char *mode) { return FCEUD_UTF8fopen(n.c_str(),mode); }
EMUFILE_FILE* FCEUD_UTF8_fstream(const char *n, const char *m);

View File

@ -20,10 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <vector>
#include "emufile.h"
#include "utils/xstring.h"
#include <vector>
bool EMUFILE::readAllBytes(std::vector<u8>* dstbuf, const std::string& fname)
{
EMUFILE_FILE file(fname.c_str(),"rb");
@ -274,4 +275,4 @@ size_t EMUFILE::readdouble(double* val)
size_t ret = read64le(&temp);
*val = u64_to_double(temp);
return ret;
}
}

View File

@ -25,20 +25,20 @@ THE SOFTWARE.
#ifndef EMUFILE_H
#define EMUFILE_H
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <string>
#include <stdarg.h>
#include "emufile_types.h"
#ifdef _MSC_VER
#include <io.h>
#endif
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cstdarg>
#include <vector>
#include <algorithm>
#include <string>
class EMUFILE {
protected:
bool failbit;

View File

@ -18,12 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -49,7 +43,6 @@
#include "file.h"
#include "vsuni.h"
#include "ines.h"
#ifdef WIN32
#include "drivers/win/pref.h"
@ -65,9 +58,6 @@ extern int32 fps_scale_frameadvance;
extern void RefreshThrottleFPS();
#endif
#include <fstream>
#include <sstream>
#ifdef _S9XLUA_H
#include "fceulua.h"
#endif
@ -86,6 +76,16 @@ extern void RefreshThrottleFPS();
#include "drivers/sdl/sdl.h"
#endif
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cstdarg>
#include <ctime>
using namespace std;
int AFon = 1, AFoff = 1, AutoFireOffset = 0; //For keeping track of autofire settings
@ -98,14 +98,20 @@ bool AutoResumePlay = false;
char romNameWhenClosingEmulator[2048] = {0};
FCEUGI::FCEUGI()
: filename(0)
, archiveFilename(0) {
: filename(0),
archiveFilename(0) {
//printf("%08x",opsize); // WTF?!
}
FCEUGI::~FCEUGI() {
if (filename) delete filename;
if (archiveFilename) delete archiveFilename;
if (filename) {
free(filename);
filename = NULL;
}
if (archiveFilename) {
delete archiveFilename;
archiveFilename = NULL;
}
}
bool CheckFileExists(const char* filename) {

File diff suppressed because it is too large Load Diff

View File

@ -18,10 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -37,6 +33,10 @@
#include "driver.h"
#include "movie.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
// TODO: Add code to put a delay in between the time a disk is inserted
// and the when it can be successfully read/written to. This should
// prevent writes to wrong places OR add code to prevent disk ejects

View File

@ -18,18 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fstream>
#ifndef WIN32
#include <zlib.h>
#endif
#include "types.h"
#include "file.h"
@ -49,6 +37,19 @@
#include "driver.h"
#include "utils/xstring.h"
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cstdarg>
#include <sys/types.h>
#include <sys/stat.h>
#include <fstream>
#ifndef WIN32
#include <zlib.h>
#endif
using namespace std;
bool bindSavestate = true; //Toggle that determines if a savestate filename will include the movie filename

View File

@ -3,11 +3,12 @@
#define MAX_MOVIEFILENAME_LEN 80
#include <string>
#include <iostream>
#include "types.h"
#include "emufile.h"
#include <string>
#include <iostream>
extern bool bindSavestate;
struct FCEUFILE {

View File

@ -1,8 +1,6 @@
/// \file
/// \brief Sound filtering code
#include <math.h>
#include <stdio.h>
#include "types.h"
#include "sound.h"
@ -12,6 +10,9 @@
#include "fcoeffs.h"
#include <cmath>
#include <cstdio>
static int32 sq2coeffs[SQ2NCOEFFS];
static int32 coeffs[NCOEFFS];

View File

@ -19,10 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -42,6 +38,10 @@
#include "vsuni.h"
#include "driver.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
extern SFORMAT FCEUVSUNI_STATEINFO[];
//mbg merge 6/29/06 - these need to be global

View File

@ -19,10 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string>
#include <ostream>
#include <string.h>
#include "types.h"
#include "x6502.h"
@ -52,6 +48,11 @@
#include "drivers/win/window.h"
#include "drivers/win/ntview.h"
#include "drivers/win/taseditor.h"
#include <string>
#include <ostream>
#include <cstring>
extern bool mustRewindNow;
#endif // WIN32

View File

@ -1,10 +1,11 @@
#ifndef _INPUT_H_
#define _INPUT_H_
#include <ostream>
#include "git.h"
#include <ostream>
void LagCounterToggle(void);
class MovieRecord;

View File

@ -1,16 +1,3 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <zlib.h>
#include <assert.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#ifdef __linux
#include <unistd.h>
#define SetCurrentDir chdir
@ -48,6 +35,20 @@
extern TASEDITOR_LUA taseditor_lua;
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cassert>
#include <cstdlib>
#include <cmath>
#include <zlib.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
bool CheckLua()
{
#ifdef WIN32
@ -3115,7 +3116,7 @@ static int hex2int(lua_State *L, char c) {
static const struct ColorMapping
{
const char* name;
int value;
unsigned int value;
}
s_colorMapping [] =
{

View File

@ -1,13 +1,3 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <zlib.h>
#include <iomanip>
#include <fstream>
#include <limits.h>
#include <stdarg.h>
#include "emufile.h"
#include "version.h"
#include "types.h"
@ -39,11 +29,20 @@
#include "./drivers/win/common.h"
#include "./drivers/win/window.h"
extern void AddRecentMovieFile(const char *filename);
#include "./drivers/win/taseditor.h"
extern bool mustEngageTaseditor;
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iomanip>
#include <fstream>
#include <climits>
#include <cstdarg>
#include <zlib.h>
using namespace std;
#define MOVIE_VERSION 3

View File

@ -1,15 +1,15 @@
#ifndef __MOVIE_H_
#define __MOVIE_H_
#include "input/zapper.h"
#include "utils/guid.h"
#include "utils/md5.h"
#include <vector>
#include <map>
#include <string>
#include <ostream>
#include <stdlib.h>
#include "input/zapper.h"
#include "utils/guid.h"
#include "utils/md5.h"
#include <cstdlib>
struct FCEUFILE;

View File

@ -19,15 +19,6 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
//#include <unistd.h> //mbg merge 7/17/06 removed
#include <zlib.h>
#include "types.h"
#include "file.h"
#include "utils/endian.h"
@ -39,6 +30,15 @@
#include "driver.h"
#include "utils/memory.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
//#include <unistd.h> //mbg merge 7/17/06 removed
#include <zlib.h>
int FCEUnetplay=0;
static uint8 netjoy[4]; // Controller cache.

View File

@ -21,11 +21,6 @@
/// \file
/// \brief implements a built-in NSF player. This is a perk--not a part of the emu core
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -47,6 +42,11 @@
#define M_PI 3.14159265358979323846
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
static uint8 SongReload;
static int CurrentSong;

View File

@ -18,11 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "types.h"
#include "file.h"
@ -42,6 +37,11 @@
#define M_PI 3.14159265358979323846
#endif
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
static int ntsccol=0;
static int ntsctint=46+10;
static int ntschue=72;
@ -98,9 +98,34 @@ void FCEUI_SetNTSCTH(int n, int tint, int hue)
static uint8 lastd=0;
void SetNESDeemph(uint8 d, int force)
{
static uint16 rtmul[7]={32768*1.239,32768*.794,32768*1.019,32768*.905,32768*1.023,32768*.741,32768*.75};
static uint16 gtmul[7]={32768*.915,32768*1.086,32768*.98,32768*1.026,32768*.908,32768*.987,32768*.75};
static uint16 btmul[7]={32768*.743,32768*.882,32768*.653,32768*1.277,32768*.979,32768*.101,32768*.75};
static uint16 rtmul[]={
static_cast<uint16>(32768*1.239),
static_cast<uint16>(32768*.794),
static_cast<uint16>(32768*1.019),
static_cast<uint16>(32768*.905),
static_cast<uint16>(32768*1.023),
static_cast<uint16>(32768*.741),
static_cast<uint16>(32768*.75)
};
static uint16 gtmul[]={
static_cast<uint16>(32768*.915),
static_cast<uint16>(32768*1.086),
static_cast<uint16>(32768*.98),
static_cast<uint16>(32768*1.026),
static_cast<uint16>(32768*.908),
static_cast<uint16>(32768*.987),
static_cast<uint16>(32768*.75)
};
static uint16 btmul[]={
static_cast<uint16>(32768*.743),
static_cast<uint16>(32768*.882),
static_cast<uint16>(32768*.653),
static_cast<uint16>(32768*1.277),
static_cast<uint16>(32768*.979),
static_cast<uint16>(32768*.101),
static_cast<uint16>(32768*.75)
};
uint32 r,g,b;
int x;

View File

@ -19,10 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -41,6 +37,10 @@
#include "driver.h"
#include "debug.h"
#include <cstring>
#include <cstdio>
#include <cstdlib>
#define VBlankON (PPU[0] & 0x80) //Generate VBlank NMI
#define Sprite16 (PPU[0] & 0x20) //Sprites 8x16/8x8
#define BGAdrHI (PPU[0] & 0x10) //BG pattern adr $0000/$1000

View File

@ -18,11 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "types.h"
#include "x6502.h"
@ -33,6 +28,10 @@
#include "wave.h"
#include "debug.h"
#include <cstdlib>
#include <cstdio>
#include <cstring>
static uint32 wlookup1[32];
static uint32 wlookup2[203];

View File

@ -20,15 +20,6 @@
// TODO: Add (better) file io error checking
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <unistd.h> //mbg merge 7/17/06 removed
#include <vector>
#include <fstream>
#include "version.h"
#include "types.h"
#include "x6502.h"
@ -58,6 +49,15 @@
#include "drivers/win/ramwatch.h"
#endif
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
//#include <unistd.h> //mbg merge 7/17/06 removed
#include <vector>
#include <fstream>
using namespace std;
static void (*SPreSave)(void);

View File

@ -22,11 +22,6 @@
/* **INCOMPLETE** */
/* Override stuff: CHR RAM instead of CHR ROM, mirroring. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "types.h"
#include "fceu.h"
#include "cart.h"
@ -40,6 +35,10 @@
#include "input.h"
#include "driver.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
typedef struct {
char ID[4];
uint32 info;

View File

@ -18,16 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIN32
#include <stdint.h>
#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <zlib.h>
#include "types.h"
#include "video.h"
#include "fceu.h"
@ -55,6 +45,16 @@
#include "drivers/videolog/nesvideos-piece.h"
#endif
#ifdef WIN32
#include <stdint.h>
#endif
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cstdarg>
#include <zlib.h>
uint8 *XBuf=NULL;
uint8 *XBackBuf=NULL;
int ClipSidesOffset=0; //Used to move displayed messages when Clips left and right sides is checked

View File

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <stdio.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -30,6 +27,9 @@
#include "state.h"
#include "driver.h"
#include <cstring>
#include <cstdio>
#define IOPTION_GUN 0x1
#define IOPTION_SWAPDIRAB 0x2

View File

@ -1,6 +1,3 @@
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
#include "fceu.h"
@ -8,6 +5,9 @@
#include "sound.h"
#include "wave.h"
#include <cstdio>
#include <cstdlib>
static FILE *soundlog=0;
static long wsize;

View File

@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include "types.h"
#include "x6502.h"
#include "fceu.h"
@ -29,6 +28,8 @@
#endif
#include "x6502abbrev.h"
#include <cstring>
X6502 X;
uint32 timestamp;
void (*MapIRQHook)(int a);