aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-18 15:06:07 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit9bc637947603643c02b27a5c0954564811603bd7 (patch)
tree70baf8286cf4a736df1ec4b151f2f3bdd202e391
parentdfe497cb79b52a4835700f806e5eb5a17543dd37 (diff)
downloadscummvm-rg350-9bc637947603643c02b27a5c0954564811603bd7.tar.gz
scummvm-rg350-9bc637947603643c02b27a5c0954564811603bd7.tar.bz2
scummvm-rg350-9bc637947603643c02b27a5c0954564811603bd7.zip
GLK: Change lots of comments from multiline to single line
-rw-r--r--engines/glk/blorb.h4
-rw-r--r--engines/glk/frotz/frotz.cpp28
-rw-r--r--engines/glk/frotz/mem.cpp4
-rw-r--r--engines/glk/frotz/processor_screen.cpp9
-rw-r--r--engines/glk/frotz/processor_table.cpp22
-rw-r--r--engines/glk/frotz/processor_text.cpp6
-rw-r--r--engines/glk/streams.cpp4
-rw-r--r--engines/glk/unicode.cpp6
-rw-r--r--engines/glk/unicode.h2
-rw-r--r--engines/glk/window_graphics.cpp6
-rw-r--r--engines/glk/window_pair.h2
-rw-r--r--engines/glk/window_text_buffer.h10
-rw-r--r--engines/glk/windows.cpp2
13 files changed, 51 insertions, 54 deletions
diff --git a/engines/glk/blorb.h b/engines/glk/blorb.h
index 352d01aadc..ae9c5032fc 100644
--- a/engines/glk/blorb.h
+++ b/engines/glk/blorb.h
@@ -85,7 +85,9 @@ enum {
*/
typedef struct giblorb_map_struct giblorb_map_t;
-/* giblorb_result_t: Result when you try to load a chunk. */
+/**
+ * giblorb_result_t: Result when you try to load a chunk.
+ */
typedef struct giblorb_result_struct {
glui32 chunknum; // The chunk number (for use in giblorb_unload_chunk(), etc.)
union {
diff --git a/engines/glk/frotz/frotz.cpp b/engines/glk/frotz/frotz.cpp
index 58287900d9..95cdb22ee9 100644
--- a/engines/glk/frotz/frotz.cpp
+++ b/engines/glk/frotz/frotz.cpp
@@ -62,7 +62,7 @@ Common::Error Frotz::saveGameData(strid_t file) {
int skip;
int i;
- /* Open game file */
+ // Open game file
if ((gfp = frotzopenprompt(FILE_SAVE)) == nullptr)
goto finished;
@@ -71,7 +71,7 @@ Common::Error Frotz::saveGameData(strid_t file) {
success = save_quetzal(gfp, story_fp, blorb_ofs);
}
else {
- /* Write game file */
+ // Write game file
fputc((int)hi(h_release), gfp);
fputc((int)lo(h_release), gfp);
@@ -108,15 +108,14 @@ Common::Error Frotz::saveGameData(strid_t file) {
else skip++;
}
- /* Close game file and check for errors */
+ // Close game file and check for errors
if (fclose(gfp) == EOF || ferror(story_fp)) {
print_string("Error writing save file\n");
goto finished;
}
- /* Success */
-
+ // Success
success = 1;
#endif
return Common::kNoError;
@@ -129,8 +128,7 @@ Common::Error Frotz::loadGameData(strid_t file) {
zword addr;
int i;
- /* Open game file */
-
+ // Open game file
if ((gfp = frotzopenprompt(FILE_RESTORE)) == nullptr)
goto finished;
@@ -138,7 +136,7 @@ Common::Error Frotz::loadGameData(strid_t file) {
success = restore_quetzal (gfp, story_fp, blorb_ofs);
} else {
- /* Load game file */
+ // Load game file
release = (unsigned) fgetc (gfp) << 8;
release |= fgetc (gfp);
@@ -146,8 +144,7 @@ Common::Error Frotz::loadGameData(strid_t file) {
() fgetc (gfp);
() fgetc (gfp);
- /* Check the release number */
-
+ // Check the release number
if (release == h_release) {
pc = (long) fgetc (gfp) << 16;
@@ -176,14 +173,12 @@ Common::Error Frotz::loadGameData(strid_t file) {
() fgetc (story_fp);
}
- /* Check for errors */
-
+ // Check for errors
if (ferror (gfp) || ferror (story_fp) || addr != h_dynamic_size)
success = -1;
else
- /* Success */
-
+ // Success
success = 2;
} else print_string ("Invalid save file\n");
@@ -191,15 +186,14 @@ Common::Error Frotz::loadGameData(strid_t file) {
if ((short) success >= 0) {
- /* Close game file */
-
+ // Close game file
fclose (gfp);
if ((short) success > 0) {
zbyte old_screen_rows;
zbyte old_screen_cols;
- /* In V3, reset the upper window. */
+ // In V3, reset the upper window.
if (h_version == V3)
split_window (0);
diff --git a/engines/glk/frotz/mem.cpp b/engines/glk/frotz/mem.cpp
index da0acaa69f..12e860add2 100644
--- a/engines/glk/frotz/mem.cpp
+++ b/engines/glk/frotz/mem.cpp
@@ -176,8 +176,8 @@ void Mem::restart_header(void) {
SET_BYTE(H_SCREEN_COLS, h_screen_cols);
}
- /* It's less trouble to use font size 1x1 for V5 games, especially
- because of a bug in the unreleased German version of "Zork 1" */
+ // It's less trouble to use font size 1x1 for V5 games, especially because of
+ // a bug in the unreleased German version of "Zork 1"
if (h_version != V6) {
screen_x_size = (zword)h_screen_cols;
diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp
index c0d8ca1e2a..6ee7f1d071 100644
--- a/engines/glk/frotz/processor_screen.cpp
+++ b/engines/glk/frotz/processor_screen.cpp
@@ -312,7 +312,8 @@ void Processor::z_set_font() {
store (curr_font);
break;
- case 1: /* normal font */
+ case 1:
+ // normal font
prev_font = curr_font;
curr_font = 1;
zargs[0] = 0xf000; // tickle tickle!
@@ -320,7 +321,8 @@ void Processor::z_set_font() {
store (prev_font);
break;
- case 4: /* fixed-pitch font*/
+ case 4:
+ // fixed-pitch font
prev_font = curr_font;
curr_font = 4;
zargs[0] = 0xf000; // tickle tickle!
@@ -355,7 +357,8 @@ void Processor::z_set_text_style() {
if (zargs[0] == 0)
curstyle = 0;
- else if (zargs[0] != 0xf000) /* not tickle time */
+ else if (zargs[0] != 0xf000)
+ // not tickle time
curstyle |= zargs[0];
if (h_flags & FIXED_FONT_FLAG || curr_font == 4)
diff --git a/engines/glk/frotz/processor_table.cpp b/engines/glk/frotz/processor_table.cpp
index c586355038..57afc760b2 100644
--- a/engines/glk/frotz/processor_table.cpp
+++ b/engines/glk/frotz/processor_table.cpp
@@ -31,17 +31,17 @@ void Processor::z_copy_table() {
zbyte value;
int i;
- if (zargs[1] == 0) /* zero table */
-
- for (i = 0; i < size; i++)
- storeb((zword) (zargs[0] + i), 0);
-
- else if ((short) size < 0 || zargs[0] > zargs[1]) /* copy forwards */
-
- for (i = 0; i < (((short) size < 0) ? - (short) size : size); i++) {
- addr = zargs[0] + i;
- LOW_BYTE(addr, value);
- storeb((zword) (zargs[1] + i), value);
+ if (zargs[1] == 0) {
+ // zero table
+ for (i = 0; i < size; i++)
+ storeb((zword)(zargs[0] + i), 0);
+ } else if ((short) size < 0 || zargs[0] > zargs[1]) {
+ // copy forwards
+ for (i = 0; i < (((short)size < 0) ? -(short)size : size); i++) {
+ addr = zargs[0] + i;
+ LOW_BYTE(addr, value);
+ storeb((zword)(zargs[1] + i), value);
+ }
} else {
// copy backwards
for (i = size - 1; i >= 0; i--) {
diff --git a/engines/glk/frotz/processor_text.cpp b/engines/glk/frotz/processor_text.cpp
index 3cfe50b44a..abb0430742 100644
--- a/engines/glk/frotz/processor_text.cpp
+++ b/engines/glk/frotz/processor_text.cpp
@@ -444,15 +444,13 @@ void Processor::decode_text(enum string_type st, zword addr) {
void Processor::print_num(zword value) {
int i;
- /* Print sign */
-
+ // Print sign
if ((short)value < 0) {
print_char('-');
value = -(short)value;
}
- /* Print absolute value */
-
+ // Print absolute value
for (i = 10000; i != 0; i /= 10)
if (value >= i || i == 1)
print_char('0' + (value / i) % 10);
diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp
index b491b89dfe..911f6d92bb 100644
--- a/engines/glk/streams.cpp
+++ b/engines/glk/streams.cpp
@@ -652,7 +652,7 @@ glui32 MemoryStream::getLine(char *buf, glui32 len) {
if (len == 0)
return 0;
- len -= 1; /* for the terminal null */
+ len -= 1; // for the terminal null
if (!_unicode) {
if (_bufPtr >= _bufEnd) {
len = 0;
@@ -1294,7 +1294,7 @@ glui32 FileStream::getLineUni(glui32 *ubuf, glui32 len) {
ubuf[lx] = '\0';
return lx;
} else if (_textFile) {
- len -= 1; /* for the terminal null */
+ len -= 1; // for the terminal null
gotNewline = false;
for (lx = 0; lx < (int)len && !gotNewline; lx++) {
glui32 ch;
diff --git a/engines/glk/unicode.cpp b/engines/glk/unicode.cpp
index d9f2ee111f..909f4ee284 100644
--- a/engines/glk/unicode.cpp
+++ b/engines/glk/unicode.cpp
@@ -93,7 +93,7 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa
}
if (res != 0xFFFFFFFF || res == ch) {
- /* simple case */
+ // simple case
if (outcount < len)
outbuf[outcount] = res;
outcount++;
@@ -102,7 +102,7 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa
target = (isfirst ? dest_spec_first : dest_spec_rest);
- /* complicated cases */
+ // complicated cases
GET_CASE_SPECIAL(ch, &special);
if (!special) {
warning("inconsistency in cgunigen.c");
@@ -112,7 +112,7 @@ glui32 bufferChangeCase(glui32 *buf, glui32 len, glui32 numchars, BufferChangeCa
speccount = *(ptr++);
if (speccount == 1) {
- /* simple after all */
+ // simple after all
if (outcount < len)
outbuf[outcount] = ptr[0];
outcount++;
diff --git a/engines/glk/unicode.h b/engines/glk/unicode.h
index 3165d398b3..f49a841616 100644
--- a/engines/glk/unicode.h
+++ b/engines/glk/unicode.h
@@ -27,7 +27,7 @@
namespace Glk {
-typedef glui32 gli_case_block_t[2]; /* upper, lower */
+typedef glui32 gli_case_block_t[2]; // upper, lower
enum BufferChangeCase { CASE_UPPER = 0, CASE_LOWER = 1, CASE_TITLE = 2, CASE_IDENT = 3 };
enum BufferChangeCond { COND_ALL = 0, COND_LINESTART = 1 };
diff --git a/engines/glk/window_graphics.cpp b/engines/glk/window_graphics.cpp
index f81313e111..b18e2b27e6 100644
--- a/engines/glk/window_graphics.cpp
+++ b/engines/glk/window_graphics.cpp
@@ -143,7 +143,7 @@ void GraphicsWindow::eraseRect(bool whole, const Rect &box) {
hy0 = _bbox.top + y0;
hy1 = _bbox.top + y1;
- /* zero out hyperlinks for these coordinates */
+ // zero out hyperlinks for these coordinates
g_vm->_selection->putHyperlink(0, hx0, hy0, hx1, hy1);
_surface->fillRect(Rect(x0, y0, x1, y1), MKTAG(_bgnd[0], _bgnd[1], _bgnd[2], 0));
@@ -173,7 +173,7 @@ void GraphicsWindow::fillRect(glui32 color, const Rect &box) {
hy0 = _bbox.top + y0;
hy1 = _bbox.top + y1;
- /* zero out hyperlinks for these coordinates */
+ // zero out hyperlinks for these coordinates
g_vm->_selection->putHyperlink(0, hx0, hy0, hx1, hy1);
_surface->fillRect(Rect(x0, y0, x1, y1), MKTAG(col[0], col[1], col[2], 0));
@@ -225,7 +225,7 @@ void GraphicsWindow::drawPicture(Picture *src, int x0, int y0, int width, int h
hy0 = _bbox.top + y0;
hy1 = _bbox.top + y1;
- /* zero out or set hyperlink for these coordinates */
+ // zero out or set hyperlink for these coordinates
g_vm->_selection->putHyperlink(linkval, hx0, hy0, hx1, hy1);
w = sx1 - sx0;
diff --git a/engines/glk/window_pair.h b/engines/glk/window_pair.h
index dabae775cf..b58819261c 100644
--- a/engines/glk/window_pair.h
+++ b/engines/glk/window_pair.h
@@ -34,7 +34,7 @@ class PairWindow : public Window {
public:
Window *_child1, *_child2;
- /* split info... */
+ // split info...
glui32 _dir; ///< winmethod_Left, Right, Above, or Below
bool _vertical, _backward; ///< flags
glui32 _division; ///< winmethod_Fixed or winmethod_Proportional
diff --git a/engines/glk/window_text_buffer.h b/engines/glk/window_text_buffer.h
index 728919f46a..86b0319b75 100644
--- a/engines/glk/window_text_buffer.h
+++ b/engines/glk/window_text_buffer.h
@@ -107,17 +107,17 @@ public:
int _radjw;
int _radjn;
- /* Command history. */
+ // Command history.
Common::Array<Common::U32String> _history;
int _historyPos;
int _historyFirst, _historyPresent;
- /* for paging */
+ // for paging
int _lastSeen;
int _scrollPos;
int _scrollMax;
- /* for line input */
+ // for line input
void *_inBuf; ///< unsigned char* for latin1, glui32* for unicode
int _inMax;
long _inFence;
@@ -128,10 +128,10 @@ public:
glui32 _echoLineInput;
glui32 *_lineTerminators;
- /* style hints and settings */
+ // style hints and settings
WindowStyle _styles[style_NUMSTYLES];
- /* for copy selection */
+ // for copy selection
glui32 *_copyBuf;
int _copyPos;
public:
diff --git a/engines/glk/windows.cpp b/engines/glk/windows.cpp
index 4db231c530..1e53f25ef1 100644
--- a/engines/glk/windows.cpp
+++ b/engines/glk/windows.cpp
@@ -88,7 +88,7 @@ Window *Windows::windowOpen(Window *splitwin, glui32 method, glui32 size,
return nullptr;
}
- /* ignore method and size now */
+ // ignore method and size now
oldparent = nullptr;
} else {
if (!splitwin) {