[Scummvm-git-logs] scummvm master -> b3ab0cf3ce1a650480c7e05af79d4f6b1c516b07

dreammaster paulfgilbert at gmail.com
Sun Jul 21 20:31:41 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b3ab0cf3ce JANITORIAL: Glk engine block formatting


Commit: b3ab0cf3ce1a650480c7e05af79d4f6b1c516b07
    https://github.com/scummvm/scummvm/commit/b3ab0cf3ce1a650480c7e05af79d4f6b1c516b07
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-07-21T11:31:33-07:00

Commit Message:
JANITORIAL: Glk engine block formatting

Changed paths:
    engines/glk/frotz/processor_buffer.cpp
    engines/glk/frotz/quetzal.cpp
    engines/glk/glk_dispa.cpp
    engines/glk/hugo/hugo.cpp


diff --git a/engines/glk/frotz/processor_buffer.cpp b/engines/glk/frotz/processor_buffer.cpp
index 9473411..734a530 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 64929c0..79747bd 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 2b71086..e08064e 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 72db1a2..06285a4 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;





More information about the Scummvm-git-logs mailing list