aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2019-07-21 11:31:33 -0700
committerPaul Gilbert2019-07-21 11:31:33 -0700
commitb3ab0cf3ce1a650480c7e05af79d4f6b1c516b07 (patch)
tree6776e900506f40f65039370a309e9da2c6d7d6ee
parent954f5142cb9b1f8b6ea4e608a71b07fdfcc4e8ca (diff)
downloadscummvm-rg350-b3ab0cf3ce1a650480c7e05af79d4f6b1c516b07.tar.gz
scummvm-rg350-b3ab0cf3ce1a650480c7e05af79d4f6b1c516b07.tar.bz2
scummvm-rg350-b3ab0cf3ce1a650480c7e05af79d4f6b1c516b07.zip
JANITORIAL: Glk engine block formatting
-rw-r--r--engines/glk/frotz/processor_buffer.cpp3
-rw-r--r--engines/glk/frotz/quetzal.cpp3
-rw-r--r--engines/glk/glk_dispa.cpp6
-rw-r--r--engines/glk/hugo/hugo.cpp28
4 files changed, 14 insertions, 26 deletions
diff --git a/engines/glk/frotz/processor_buffer.cpp b/engines/glk/frotz/processor_buffer.cpp
index 9473411b51..734a5309fc 100644
--- a/engines/glk/frotz/processor_buffer.cpp
+++ b/engines/glk/frotz/processor_buffer.cpp
@@ -177,8 +177,7 @@ void Processor::runtimeError(ErrorCode errNum) {
if (_err_report_mode == ERR_REPORT_ONCE) {
print_string(" (will ignore further occurrences)");
- }
- else {
+ } else {
print_string(" (occurence ");
print_long(_errorCount[errNum - 1], 10);
print_char(')');
diff --git a/engines/glk/frotz/quetzal.cpp b/engines/glk/frotz/quetzal.cpp
index 64929c0f5b..79747bde21 100644
--- a/engines/glk/frotz/quetzal.cpp
+++ b/engines/glk/frotz/quetzal.cpp
@@ -78,8 +78,7 @@ bool Quetzal::save(Common::WriteStream *svf, Processor *proc, const Common::Stri
if (c == 0) {
// It's a run of equal bytes
++j;
- }
- else {
+ } else {
// Write out any run there may be.
if (j > 0) {
for (; j > 0x100; j -= 0x100) {
diff --git a/engines/glk/glk_dispa.cpp b/engines/glk/glk_dispa.cpp
index 2b7108641c..e08064e989 100644
--- a/engines/glk/glk_dispa.cpp
+++ b/engines/glk/glk_dispa.cpp
@@ -1038,8 +1038,7 @@ void GlkAPI::gidispatch_call(uint32 funcnum, uint32 numargs, gluniversal_t *argl
arglist[3]._opaqueref = dat.window;
arglist[4]._uint = dat.val1;
arglist[5]._uint = dat.val2;
- }
- else {
+ } else {
glk_cancel_line_event((Window *)arglist[0]._opaqueref, nullptr);
}
break;
@@ -1308,8 +1307,7 @@ void GlkAPI::gidispatch_call(uint32 funcnum, uint32 numargs, gluniversal_t *argl
arglist[1]._sint = dat.high_sec;
arglist[2]._uint = dat.low_sec;
arglist[3]._sint = dat.microsec;
- }
- else {
+ } else {
glk_current_time(nullptr);
}
break;
diff --git a/engines/glk/hugo/hugo.cpp b/engines/glk/hugo/hugo.cpp
index 72db1a2489..06285a470f 100644
--- a/engines/glk/hugo/hugo.cpp
+++ b/engines/glk/hugo/hugo.cpp
@@ -172,15 +172,13 @@ Common::Error Hugo::readSaveData(Common::SeekableReadStream *rs) {
/* Check serial number */
if (!hugo_fgets(testserial, 9, rs)) goto RestoreError;
- if (strcmp(testserial, serial))
- {
+ if (strcmp(testserial, serial)) {
GUIErrorMessage("Save file created by different version.");
goto RestoreError;
}
/* Restore variables */
- for (k=0; k<MAXGLOBALS+MAXLOCALS; k++)
- {
+ for (k = 0; k<MAXGLOBALS + MAXLOCALS; k++) {
if ((lbyte = hugo_fgetc(rs))==EOF || (hbyte = hugo_fgetc(rs))==EOF)
goto RestoreError;
var[k] = lbyte + hbyte * 256;
@@ -191,23 +189,18 @@ Common::Error Hugo::readSaveData(Common::SeekableReadStream *rs) {
if (hugo_fseek(game, objtable*16L, SEEK_SET)) goto RestoreError;
i = 0;
- while (i<codeend-(long)(objtable*16L))
- {
+ while (i<codeend-(long)(objtable*16L)) {
if ((hbyte = hugo_fgetc(rs))==EOF && hugo_ferror(rs)) goto RestoreError;
- if (hbyte==0)
- {
+ if (hbyte == 0) {
if ((lbyte = hugo_fgetc(rs))==EOF && hugo_ferror(rs)) goto RestoreError;
SETMEM(objtable*16L+i, (unsigned char)lbyte);
i++;
/* Skip byte in game file */
if (hugo_fgetc(game)==EOF) goto RestoreError;
- }
- else
- {
- while (hbyte--)
- {
+ } else {
+ while (hbyte--) {
/* Get unchanged game file byte */
if ((lbyte = hugo_fgetc(game))==EOF) goto RestoreError;
SETMEM(objtable*16L+i, (unsigned char)lbyte);
@@ -259,8 +252,7 @@ Common::Error Hugo::writeGameData(Common::WriteStream *ws) {
if (hugo_fputs(serial, ws) == EOF) goto SaveError;
/* Save variables */
- for (c = 0; c<MAXGLOBALS + MAXLOCALS; c++)
- {
+ for (c = 0; c<MAXGLOBALS + MAXLOCALS; c++) {
hbyte = (unsigned int)var[c] / 256;
lbyte = (unsigned int)var[c] - hbyte * 256;
if (hugo_fputc(lbyte, ws) == EOF || hugo_fputc(hbyte, ws) == EOF) goto SaveError;
@@ -275,15 +267,15 @@ Common::Error Hugo::writeGameData(Common::WriteStream *ws) {
hbyte = MEM(objtable * 16L + i);
/* If memory same as original game file */
- if (lbyte == hbyte && samecount<255) samecount++;
+ if (lbyte == hbyte && samecount < 255)
+ samecount++;
/* If memory differs (or samecount exceeds 1 byte) */
else {
if (samecount)
if (hugo_fputc(samecount, ws) == EOF) goto SaveError;
- if (lbyte != hbyte)
- {
+ if (lbyte != hbyte) {
if (hugo_fputc(0, ws) == EOF) goto SaveError;
if (hugo_fputc(hbyte, ws) == EOF) goto SaveError;
samecount = 0;