1
0
Fork 0

Add part of patch 1235377 of msharov and fix a few small bugs in the return values of the cpu cores

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2593
This commit is contained in:
Peter Veenstra 2006-04-11 19:02:33 +00:00
parent 49870fee9c
commit 132bbffb68
13 changed files with 46 additions and 46 deletions

View file

@ -21,7 +21,7 @@
#include "config.h"
void E_Exit(char * message,...);
void E_Exit(const char * message,...) GCC_ATTRIBUTE( __format__(__printf__, 1, 2));
void MSG_Add(const char*,const char*); //add messages to the internal langaugefile
const char* MSG_Get(char const *); //get messages from the internal langaugafile

View file

@ -14,50 +14,50 @@ enum LOG_TYPES {
enum LOG_SEVERITIES {
LOG_NORMAL,
LOG_WARN,
LOG_WARN,
LOG_ERROR,
};
#if C_DEBUG
class LOG
{
LOG_TYPES d_type;
LOG_SEVERITIES d_severity;
LOG_TYPES d_type;
LOG_SEVERITIES d_severity;
public:
LOG (LOG_TYPES type , LOG_SEVERITIES severity):
d_type(type),
d_severity(severity)
{}
void operator() (char* buf, ...); //../src/debug/debug_gui.cpp
void operator() (char const* buf, ...) GCC_ATTRIBUTE(__format__(__printf__, 2, 3)); //../src/debug/debug_gui.cpp
};
void DEBUG_ShowMsg(char * format,...);
void DEBUG_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2));
#define LOG_MSG DEBUG_ShowMsg
#else //C_DEBUG
struct LOG
{
LOG(LOG_TYPES type, LOG_SEVERITIES severity) { return;}
void operator()(char const* buf) { return;}
void operator()(char const* buf, double f1) { return;}
void operator()(char const* buf, double f1, double f2) { return;}
void operator()(char const* buf, double f1, double f2, double f3) { return;}
void operator()(char const* buf, double f1, double f2, double f3, double f4) { return;}
void operator()(char const* buf, double f1, double f2, double f3, double f4, double f5) { return;}
LOG(LOG_TYPES , LOG_SEVERITIES ) { }
void operator()(char const* ) { }
void operator()(char const* , double ) { }
void operator()(char const* , double , double ) { }
void operator()(char const* , double , double , double ) { }
void operator()(char const* , double , double , double , double ) { }
void operator()(char const* , double , double , double , double , double ) { }
void operator()(char const* buf, char const* s1) { return;}
void operator()(char const* buf, char const* s1, double f1) { return;}
void operator()(char const* buf, char const* s1, double f1,double f2) { return;}
void operator()(char const* buf, double f1, char const* s1) { return;}
void operator()(char const* , char const* ) { }
void operator()(char const* , char const* , double ) { }
void operator()(char const* , char const* , double ,double ) { }
void operator()(char const* , double , char const* ) { }
}; //add missing operators to here
//try to avoid anything smaller than bit32...
void GFX_ShowMsg(char * format,...);
void GFX_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2));
#define LOG_MSG GFX_ShowMsg
#endif //C_DEBUG

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: paging.h,v 1.22 2006-02-09 11:47:48 qbix79 Exp $ */
/* $Id: paging.h,v 1.23 2006-04-11 19:02:33 qbix79 Exp $ */
#ifndef DOSBOX_PAGING_H
#define DOSBOX_PAGING_H
@ -48,6 +48,7 @@ class PageDirectory;
class PageHandler {
public:
virtual ~PageHandler(void) { }
virtual Bitu readb(PhysPt addr);
virtual Bitu readw(PhysPt addr);
virtual Bitu readd(PhysPt addr);

View file

@ -50,6 +50,6 @@ public:
};
typedef void (PROGRAMS_Main)(Program * * make);
void PROGRAMS_MakeFile(char * name,PROGRAMS_Main * main);
void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main);
#endif

View file

@ -45,7 +45,7 @@ char *ltrim(char *str);
char *rtrim(char *str);
char *trim(char * str);
bool ScanCMDBool(char * cmd,char * check);
bool ScanCMDBool(char * cmd,char const * const check);
char * ScanCMDRemain(char * cmd);
char * StripWord(char *&cmd);
bool IsDecWord(char * word);

View file

@ -52,7 +52,7 @@ Bitu PageHandler::readd(PhysPt addr) {
(readb(addr+3) << 24);
}
void PageHandler::writeb(PhysPt addr,Bitu val) {
void PageHandler::writeb(PhysPt addr,Bitu /*val*/) {
E_Exit("No byte handler for write to %d",addr);
};
@ -67,11 +67,11 @@ void PageHandler::writed(PhysPt addr,Bitu val) {
writeb(addr+3,(Bit8u) (val >> 24));
};
HostPt PageHandler::GetHostReadPt(Bitu phys_page) {
HostPt PageHandler::GetHostReadPt(Bitu /*phys_page*/) {
return 0;
}
HostPt PageHandler::GetHostWritePt(Bitu phys_page) {
HostPt PageHandler::GetHostWritePt(Bitu /*phys_page*/) {
return 0;
}
@ -111,7 +111,7 @@ static struct {
static Bits PageFaultCore(void) {
CPU_CycleLeft+=CPU_Cycles;
CPU_Cycles=1;
Bitu ret=CPU_Core_Full_Run();
Bits ret=CPU_Core_Full_Run();
CPU_CycleLeft+=CPU_Cycles;
if (ret<0) E_Exit("Got a dosbox close machine in pagefault core?");
if (ret)

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: debug_gui.cpp,v 1.28 2006-02-09 11:47:48 qbix79 Exp $ */
/* $Id: debug_gui.cpp,v 1.29 2006-04-11 19:02:33 qbix79 Exp $ */
#include "dosbox.h"
@ -34,7 +34,7 @@
#include "debug_inc.h"
struct _LogGroup {
char * front;
char const* front;
bool enabled;
};
#include <list>
@ -52,7 +52,7 @@ extern int old_cursor_state;
void DEBUG_ShowMsg(char * format,...) {
void DEBUG_ShowMsg(char const* format,...) {
char buf[512];
va_list msg;
@ -97,7 +97,7 @@ void DEBUG_RefreshPage(char scroll) {
wrefresh(dbg.win_out);
}
void LOG::operator() (char* format, ...){
void LOG::operator() (char const* format, ...){
char buf[512];
va_list msg;
va_start(msg,format);
@ -188,8 +188,7 @@ static void MakePairs(void) {
init_pair(PAIR_BLACK_GREY, COLOR_BLACK /*| FOREGROUND_INTENSITY */, COLOR_WHITE);
init_pair(PAIR_GREY_RED, COLOR_WHITE/*| FOREGROUND_INTENSITY */, COLOR_RED);
}
static void LOG_Destroy(Section* sec) {
static void LOG_Destroy(Section*) {
if(debuglog) fclose(debuglog);
}

View file

@ -29,7 +29,7 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) {
Bitu hadChange = 0;
#if (SBPP == 9)
for (Bits x=render.src.width;x>0;) {
if (*(Bit32u*)src == *(Bit32u*)cache && !(
if (*(Bit32u const*)src == *(Bit32u*)cache && !(
render.pal.modified[src[0]] |
render.pal.modified[src[1]] |
render.pal.modified[src[2]] |
@ -40,7 +40,7 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) {
line0+=4*SCALERWIDTH;
#else
for (Bits x=render.src.width;x>0;) {
if (*(Bitu*)src == *(Bitu*)cache) {
if (*(Bitu const*)src == *(Bitu*)cache) {
x-=(sizeof(Bitu)/sizeof(SRCTYPE));
src+=(sizeof(Bitu)/sizeof(SRCTYPE));
cache+=(sizeof(Bitu)/sizeof(SRCTYPE));

View file

@ -129,7 +129,7 @@ static void conc3d(Cache,SBPP,DBPP) (const void * s) {
if (pixel != fc[x]) {
#else
for (Bitu x=0;x<SCALER_BLOCKSIZE;x+=sizeof(Bitu)/sizeof(SRCTYPE)) {
if (*(Bitu*)&src[x] != *(Bitu*)&sc[x]) {
if (*(Bitu const*)&src[x] != *(Bitu*)&sc[x]) {
#endif
do {
fc[x] = PMAKE(src[x]);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdlmain.cpp,v 1.113 2006-03-29 12:26:07 qbix79 Exp $ */
/* $Id: sdlmain.cpp,v 1.114 2006-04-11 19:02:33 qbix79 Exp $ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -1216,7 +1216,7 @@ void GFX_Events() {
* Fixes some bugs when -noconsole is used in a read only directory */
static bool no_stdout = false;
void GFX_ShowMsg(char * format,...) {
void GFX_ShowMsg(char const* format,...) {
char buf[512];
va_list msg;
va_start(msg,format);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: iohandler.cpp,v 1.20 2006-02-09 11:47:49 qbix79 Exp $ */
/* $Id: iohandler.cpp,v 1.21 2006-04-11 19:02:33 qbix79 Exp $ */
#include <string.h>
#include "dosbox.h"
@ -29,10 +29,10 @@
IO_WriteHandler * io_writehandlers[3][IO_MAX];
IO_ReadHandler * io_readhandlers[3][IO_MAX];
static Bitu IO_ReadBlocked(Bitu port,Bitu iolen) {
static Bitu IO_ReadBlocked(Bitu /*port*/,Bitu /*iolen*/) {
return ~0;
}
static void IO_WriteBlocked(Bitu port,Bitu val,Bitu iolen) {
static void IO_WriteBlocked(Bitu /*port*/,Bitu /*val*/,Bitu /*iolen*/) {
}
static Bitu IO_ReadDefault(Bitu port,Bitu iolen) {
@ -150,7 +150,7 @@ static struct {
static Bits IOFaultCore(void) {
CPU_CycleLeft+=CPU_Cycles;
CPU_Cycles=1;
Bitu ret=CPU_Core_Full_Run();
Bits ret=CPU_Core_Full_Run();
CPU_CycleLeft+=CPU_Cycles;
if (ret<0) E_Exit("Got a dosbox close machine in IO-fault core?");
if (ret)
@ -377,7 +377,7 @@ public:
static IO* test;
void IO_Destroy(Section* sec) {
void IO_Destroy(Section*) {
delete test;
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: programs.cpp,v 1.25 2006-04-10 12:06:07 qbix79 Exp $ */
/* $Id: programs.cpp,v 1.26 2006-04-11 19:02:33 qbix79 Exp $ */
#include <vector>
#include <ctype.h>
@ -51,7 +51,7 @@ static Bit8u exe_block[]={
static std::vector<PROGRAMS_Main*> internal_progs;
void PROGRAMS_MakeFile(char * name,PROGRAMS_Main * main) {
void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main) {
Bit8u * comdata=(Bit8u *)malloc(32); //MEM LEAK
memcpy(comdata,&exe_block,sizeof(exe_block));
comdata[CB_POS]=call_program&0xff;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: support.cpp,v 1.29 2006-02-09 11:47:57 qbix79 Exp $ */
/* $Id: support.cpp,v 1.30 2006-04-11 19:02:33 qbix79 Exp $ */
#include <string.h>
#include <stdlib.h>
@ -65,7 +65,7 @@ char *trim(char *str) {
}
bool ScanCMDBool(char * cmd,char * check) {
bool ScanCMDBool(char * cmd,char const * const check) {
char * scan=cmd;size_t c_len=strlen(check);
while ((scan=strchr(scan,'/'))) {
/* found a / now see behind it */
@ -145,7 +145,7 @@ double ConvDblWord(char * word) {
static char buf[1024]; //greater scope as else it doesn't always gets thrown right (linux/gcc2.95)
void E_Exit(char * format,...) {
void E_Exit(const char * format,...) {
#if C_DEBUG && C_HEAVY_DEBUG
DEBUG_HeavyWriteLogInstruction();
#endif