GLK: gcc compilation fixes

This commit is contained in:
dreammaster 2018-11-10 18:25:20 +00:00 committed by Paul Gilbert
parent fbed3ed7a3
commit 62315b969d
10 changed files with 24 additions and 38 deletions

View File

@ -142,8 +142,7 @@ bool Gargoyle::GargoyleEngine::hasFeature(EngineFeature f) const {
}
bool GargoyleMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
Gargoyle::GargoyleGameDescription *gd = (Gargoyle::GargoyleGameDescription *)desc;
gd->_filename = ConfMan.get("filename");
const Gargoyle::GargoyleGameDescription *gd = (const Gargoyle::GargoyleGameDescription *)desc;
switch (gd->_interpType) {
case Gargoyle::INTERPRETER_SCOTT:

View File

@ -23,19 +23,7 @@
namespace Gargoyle {
static const GargoyleGameDescription gameDescriptions[] = {
{
{
"Gargoyle",
0,
AD_ENTRY1s("dummy", "0", 0),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
GUIO0()
},
},
{ AD_TABLE_END_MARKER }
{ AD_TABLE_END_MARKER, "", (InterpreterType)0, "" }
};
} // End of namespace Gargoyle

View File

@ -258,7 +258,7 @@ public:
/**
* Set the total number of frames played
*/
void Events::setTotalPlayTicks(uint frames) {
void setTotalPlayTicks(uint frames) {
_frameCounter = frames;
}

View File

@ -164,7 +164,7 @@ public:
/**
* Returns the primary filename for the game
*/
const Common::String &GargoyleEngine::getFilename() const;
const Common::String &getFilename() const;
/**
* Return the game engine's target name

View File

@ -103,7 +103,7 @@ enum Gestalt {
gestalt_LineTerminatorKey = 19,
gestalt_DateTime = 20,
gestalt_Sound2 = 21,
gestalt_GarglkText = 0x1100,
gestalt_GarglkText = 0x1100
};
enum Style {
@ -118,7 +118,7 @@ enum Style {
style_Input = 8,
style_User1 = 9,
style_User2 = 10,
style_NUMSTYLES = 11,
style_NUMSTYLES = 11
};
enum WinType {
@ -127,7 +127,7 @@ enum WinType {
wintype_Blank = 2,
wintype_TextBuffer = 3,
wintype_TextGrid = 4,
wintype_Graphics = 5,
wintype_Graphics = 5
};
enum WinMethod {
@ -143,7 +143,7 @@ enum WinMethod {
winmethod_Border = 0x000,
winmethod_NoBorder = 0x100,
winmethod_BorderMask = 0x100,
winmethod_BorderMask = 0x100
};
enum StyleHint {
@ -162,7 +162,7 @@ enum StyleHint {
stylehint_just_LeftFlush = 0,
stylehint_just_LeftRight = 1,
stylehint_just_Centered = 2,
stylehint_just_RightFlush = 3,
stylehint_just_RightFlush = 3
};
/**
@ -176,7 +176,7 @@ enum giDisp {
gidisp_Class_Window = 0,
gidisp_Class_Stream = 1,
gidisp_Class_Fileref = 2,
gidisp_Class_Schannel = 3,
gidisp_Class_Schannel = 3
};
enum zcolor {

View File

@ -16,7 +16,6 @@ MODULE_OBJS := \
unicode_gen.o \
utils.o \
windows.o \
window_mask.o \
window_graphics.o \
window_pair.o \
window_text_buffer.o \

View File

@ -175,7 +175,7 @@ void Scott::delay(int seconds) {
}
void Scott::fatal(const char *x) {
error(x);
error("%s", x);
}
void Scott::clearScreen(void) {
@ -412,7 +412,7 @@ void Scott::outputNumber(int a) {
}
void Scott::look(void) {
static char *ExitNames[6] = { "North", "South", "East", "West", "Up", "Down" };
const char *const ExitNames[6] = { "North", "South", "East", "West", "Up", "Down" };
Room *r;
int ct, f;
int pos;
@ -555,7 +555,7 @@ Common::Error Scott::saveGameState(int slot, const Common::String &desc) {
glk_put_string_stream(file, msg.c_str());
}
msg = Common::String::format("%lu %d %hd %d %d %hd\n",
msg = Common::String::format("%u %d %hd %d %d %hd\n",
BitFlags, (BitFlags & (1 << DARKBIT)) ? 1 : 0,
MyLoc, CurrentCounter, SavedRoom, GameHeader.LightTime);
glk_put_string_stream(file, msg.c_str());
@ -602,7 +602,7 @@ Common::Error Scott::loadGameState(int slot) {
}
glk_get_line_stream(file, buf, sizeof buf);
sscanf(buf, "%ld %hd %d %d %d %d\n",
sscanf(buf, "%u %hd %d %d %d %d\n",
&BitFlags, &darkFlag, &MyLoc, &CurrentCounter, &SavedRoom,
&GameHeader.LightTime);

View File

@ -850,7 +850,7 @@ void FileStream::putBuffer(const char *buf, size_t len) {
ensureOp(filemode_Write);
for (size_t lx = 0; lx < len; lx++) {
unsigned char ch = ((unsigned char *)buf)[lx];
unsigned char ch = ((const unsigned char *)buf)[lx];
if (!_unicode) {
_outFile->writeByte(ch);
} else if (_textFile) {
@ -1100,7 +1100,7 @@ glui32 FileStream::getBuffer(char *buf, glui32 len) {
for (lx = 0; lx < len; lx++) {
glui32 ch;
ch = getCharUtf8();
if (ch == -1)
if (ch == (glui32)-1)
break;
_readCount++;
if (ch >= 0x100)
@ -1161,7 +1161,7 @@ glui32 FileStream::getBufferUni(glui32 *buf, glui32 len) {
for (lx = 0; lx < len; lx++) {
glui32 ch;
ch = getCharUtf8();
if (ch == -1)
if (ch == (glui32)-1)
break;
_readCount++;
buf[lx] = ch;
@ -1221,7 +1221,7 @@ glui32 FileStream::getLine(char *buf, glui32 len) {
for (lx = 0; lx < len && !gotNewline; lx++) {
glui32 ch;
ch = getCharUtf8();
if (ch == -1)
if (ch == (glui32)-1)
break;
_readCount++;
if (ch >= 0x100)
@ -1295,7 +1295,7 @@ glui32 FileStream::getLineUni(glui32 *ubuf, glui32 len) {
for (lx = 0; lx < (int)len && !gotNewline; lx++) {
glui32 ch;
ch = getCharUtf8();
if (ch == -1)
if (ch == (glui32)-1)
break;
_readCount++;
ubuf[lx] = ch;

View File

@ -44,20 +44,20 @@ enum FileUsage {
fileusage_TypeMask = 0x0f,
fileusage_TextMode = 0x100,
fileusage_BinaryMode = 0x000,
fileusage_BinaryMode = 0x000
};
enum FileMode {
filemode_Write = 0x01,
filemode_Read = 0x02,
filemode_ReadWrite = 0x03,
filemode_WriteAppend = 0x05,
filemode_WriteAppend = 0x05
};
enum SeekMode {
seekmode_Start = 0,
seekmode_Current = 1,
seekmode_End = 2,
seekmode_End = 2
};
struct StreamResult {

View File

@ -43,7 +43,7 @@ TextBufferWindow::TextBufferWindow(Windows *windows, uint32 rock) : Window(windo
_radjn(0), _numChars(0), _chars(nullptr), _attrs(nullptr),
_spaced(0), _dashed(0), _copyBuf(0), _copyPos(0) {
_type = wintype_TextBuffer;
Common::fill(&_history[0], &_history[HISTORYLEN], nullptr);
Common::fill(&_history[0], &_history[HISTORYLEN], (glui32 *)nullptr);
_lines.resize(SCROLLBACK);
_chars = _lines[0]._chars;
@ -908,7 +908,7 @@ void TextBufferWindow::redraw() {
for (tsc = 0; tsc < linelen; tsc++) {
tsw = calcWidth(ln->_chars, ln->_attrs, 0, tsc, spw) / GLI_SUBPIX;
if (tsw + tx >= sx0 ||
tsw + tx + GLI_SUBPIX >= sx0 && ln->_chars[tsc] != ' ') {
((tsw + tx + GLI_SUBPIX) >= sx0 && ln->_chars[tsc] != ' ')) {
lsc = tsc;
selchar = true;
break;