reduce diff to windows frotz
authorborg323 <4010067-borg323@users.noreply.gitlab.com>
Mon, 8 Jul 2019 23:03:53 +0000 (02:03 +0300)
committerborg323 <4010067-borg323@users.noreply.gitlab.com>
Mon, 8 Jul 2019 23:10:12 +0000 (02:10 +0300)
src/common/buffer.c
src/common/object.c
src/common/process.c
src/common/quetzal.c
src/common/random.c
src/common/text.c

index 12508d8c5b0c66831e998eebc8fb93a8f199bf6c..a9895ff5d144ffb957f4a2c7c41132df67cf9cd4 100644 (file)
@@ -30,6 +30,20 @@ static int bufpos = 0;
 
 static zchar prev_c = 0;
 
+/*
+ * init_buffer
+ *
+ * Initialize buffer variables.
+ *
+ */
+
+void init_buffer(void)
+{
+    memset(buffer, 0, sizeof (zchar) * TEXT_BUFFER_SIZE);
+    bufpos = 0;
+    prev_c = 0;
+}
+
 /*
  * flush_buffer
  *
@@ -52,12 +66,7 @@ void flush_buffer (void)
 
     buffer[bufpos] = 0;
 
-
-    locked = TRUE;
-
-    stream_word (buffer);
-
-    locked = FALSE;
+    locked = TRUE; stream_word (buffer); locked = FALSE;
 
     /* Reset the buffer */
 
@@ -129,15 +138,3 @@ void new_line (void)
 }/* new_line */
 
 
-/*
- * init_buffer
- *
- * Initialize buffer variables.
- *
- */
-void init_buffer(void)
-{
-    memset(buffer, 0, sizeof (zchar) * TEXT_BUFFER_SIZE);
-    bufpos = 0;
-    prev_c = 0;
-}
index 296f654437ee9c12c0805cb40a1ca87c6e8b6761..d2dc7e65385337ce179c56ba8336a41c7cd9c470 100644 (file)
  * Calculate the address of an object.
  *
  */
+
 static zword object_address (zword obj)
 {
-/*    zchar obj_num[10]; */
-
     /* Check object number */
 
     if (obj > ((h_version <= V3) ? 255 : MAX_OBJECT)) {
index 9187b0bbd293b3514dbf76a8f8de20d795576208..86e392909de6cc3204fdde8679fb090537e315fa 100644 (file)
@@ -180,8 +180,7 @@ void (*ext_opcodes[0x1d]) (void) = {
 void init_process (void)
 {
     finished = 0;
-} /* init_process */
-
+}
 
 /*
  * load_operand
index 53707edee00ea1889f925498392c0b59cbff0202..b50cb3f42f3496b2307ac0eb375d523c010dd824 100644 (file)
 #define get_c fgetc
 #define put_c fputc
 
-/*
- * externs
- */
-
 typedef unsigned long zlong;
 
 /*
index 541a32d2ea90af60deb6c47bd6c81436b13d04f5..0c5d16f272cac86b3985b79957aef1ea17d474b7 100644 (file)
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "frotz.h"
index 920a6c2b0966e82cebc80807f8af317298c57b98..7cbc61048e3bbbb2b0c550fa5f42b22ca57ee62a 100644 (file)
@@ -243,13 +243,15 @@ static void load_string (zword addr, zword length)
  * Encode the Unicode text in the global "decoded" string then write
  * the result to the global "encoded" array. (This is used to look up
  * words in the dictionary.) Up to V3 the vocabulary resolution is
- * two, since V4 it is three words. Because each word contains three
- * Z-characters, that makes six or nine Z-characters respectively.
- * Longer words are chopped to the proper size, shorter words are are
- * padded out with 5's. For word completion we pad with 0s and 31s,
- * the minimum and maximum Z-characters.
+ * two, since V4 it is three words.
+ * Because each word contains three Z-characters, that makes six or
+ * nine Z-characters respectively. Longer words are chopped to the
+ * proper size, shorter words are are padded out with 5's. For word
+ * completion we pad with 0s and 31s, the minimum and maximum
+ * Z-characters.
  *
  */
+
 static void encode_text (int padding)
 {
     static zchar again[] = { 'a', 'g', 'a', 'i', 'n', 0 };
@@ -325,9 +327,8 @@ static void encode_text (int padding)
 
 }/* encode_text */
 
-
 /*
- * z_check_unicode, test if a unicode character can be read and printed.
+ * z_check_unicode, test if a unicode character can be printed (bit 0) and read (bit 1).
  *
  *     zargs[0] = Unicode
  *
@@ -433,7 +434,7 @@ static void decode_text (enum string_type st, zword addr)
            byte_addr = (long) addr << 2;
        else if (h_version <= V7)
            byte_addr = ((long) addr << 2) + ((long) h_strings_offset << 3);
-       else /* h_version == V8 */
+       else /* (h_version == V8) */
            byte_addr = (long) addr << 3;
 
        if (byte_addr >= story_size)
@@ -545,8 +546,8 @@ static void decode_text (enum string_type st, zword addr)
        *ptr = 0;
 
 }/* decode_text */
-#undef outchar
 
+#undef outchar
 
 /*
  * z_new_line, print a new line.