aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/agt
diff options
context:
space:
mode:
authorPaul Gilbert2019-11-26 20:16:13 -0800
committerPaul Gilbert2019-11-27 21:10:29 -0800
commitc0999ae5ba6800e06c35bb23a9613dd878147618 (patch)
tree494d3ab73ec8abe076cb547fb50bef33babdcae7 /engines/glk/agt
parent88444ddc889e4faee110b637961824fcb8abc448 (diff)
downloadscummvm-rg350-c0999ae5ba6800e06c35bb23a9613dd878147618.tar.gz
scummvm-rg350-c0999ae5ba6800e06c35bb23a9613dd878147618.tar.bz2
scummvm-rg350-c0999ae5ba6800e06c35bb23a9613dd878147618.zip
GLK: AGT: Startup fixes
Diffstat (limited to 'engines/glk/agt')
-rw-r--r--engines/glk/agt/agility.h8
-rw-r--r--engines/glk/agt/agxfile.cpp8
-rw-r--r--engines/glk/agt/util.cpp12
3 files changed, 14 insertions, 14 deletions
diff --git a/engines/glk/agt/agility.h b/engines/glk/agt/agility.h
index 34c125a6a9..b92243086e 100644
--- a/engines/glk/agt/agility.h
+++ b/engines/glk/agt/agility.h
@@ -429,25 +429,25 @@ struct prop_struct {
structures. For global variables, ptr is set to point at the variable
and offset is 0. For fields, offset is set to the offset of the field
in the structure and ptr is set internally */
-typedef struct {
+struct file_info {
int ftype; /* Type in file */
int dtype; /* Data type of field in memory; often ignored */
void *ptr; /* Pointer to variable */
size_t offset; /* Offset of field in structure */
-} file_info;
+} ;
/* This contains all of the information needed to find files. */
#ifndef REPLACE_FC
-typedef struct {
+struct file_context_rec {
char *gamename; /* Name as entered by user */
char *path; /* The path */
char *shortname; /* The filename w/o directory information */
char *ext; /* The preexisting extension/prefix */
filetype ft; /* The filetype corresponding to ext */
int special; /* Used to mark special files, such as UNIX pipes */
-} file_context_rec;
+};
typedef file_context_rec *fc_type;
diff --git a/engines/glk/agt/agxfile.cpp b/engines/glk/agt/agxfile.cpp
index 04729f5959..cd544bb2e5 100644
--- a/engines/glk/agt/agxfile.cpp
+++ b/engines/glk/agt/agxfile.cpp
@@ -751,9 +751,9 @@ static file_info fi_index[] = {
byte Extension 0
*/
-typedef struct {
- unsigned long fileid;
- unsigned long res1; /* Reserved for future use */
+struct file_head_rec {
+ uint32 fileid;
+ uint32 res1; /* Reserved for future use */
uchar res2;
uchar eol_chk1; /* Catch non-binary upload errors */
uchar eol_chk2;
@@ -763,7 +763,7 @@ typedef struct {
uchar extnum;
uchar fallback_ext; /* For non-'R' extensions, this is the 'R' extension
to fall back to. */
-} file_head_rec;
+};
static file_info fi_header[] = {
{FT_UINT32, DT_LONG, NULL, offsetof(file_head_rec, fileid)}, /* File ID */
diff --git a/engines/glk/agt/util.cpp b/engines/glk/agt/util.cpp
index 76b4a63e90..c91e47a74f 100644
--- a/engines/glk/agt/util.cpp
+++ b/engines/glk/agt/util.cpp
@@ -958,7 +958,7 @@ static const uchar zero_block[81] = {0, 0, 0, 0, 0, 0, 0, 0,
0
};
-static void read_filerec(const file_info *rec_desc, const uchar *filedata) {
+static void read_filerec(file_info *rec_desc, const uchar *filedata) {
uchar mask;
rbool past_eob; /* Are we past the end of block? */
const uchar *filebase;
@@ -986,17 +986,17 @@ static void read_filerec(const file_info *rec_desc, const uchar *filedata) {
*p(integer) = fixsign16(filedata[0], filedata[1]);
break;
case FT_UINT16:
- *p(long) = fixu16(filedata[0], filedata[1]);
+ *p(int32) = fixu16(filedata[0], filedata[1]);
break;
case FT_CMDPTR: /* cmd ptr */
case FT_INT32:
- *p(long) = fixsign32(filedata[0], filedata[1],
+ *p(int32) = fixsign32(filedata[0], filedata[1],
filedata[2], filedata[3]);
break;
case FT_UINT32:
if (filedata[3] & 0x80)
agtwarn("File value out of range", 0);
- *p(long) = fixsign32(filedata[0], filedata[1],
+ *p(uint32) = fixsign32(filedata[0], filedata[1],
filedata[2], filedata[3] & 0x7F);
break;
case FT_BYTE:
@@ -1065,7 +1065,7 @@ static void read_filerec(const file_info *rec_desc, const uchar *filedata) {
/* Here is the corresponding routien for _writing_ to files */
/* This copies the contents of a record into a buffer */
-static void write_filerec(const file_info *rec_desc, uchar *filedata) {
+static void write_filerec(file_info *rec_desc, uchar *filedata) {
uchar mask;
mask = 1;
@@ -1412,7 +1412,7 @@ char textgetc(genfile f) {
Common::ReadStream *rs = dynamic_cast<Common::ReadStream *>(f);
assert(rs);
- return rs->readByte();
+ return rs->eos() ? EOF : rs->readByte();
}
void textungetc(genfile f, char c) {