OSDN Git Service

fake_{text,name}_sizeの変数をわざわざ使わずに、FAKE_{NAME,TEXT}_SIZEの定数を直接使うようにした。
authorhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 22 Jan 2002 14:55:21 +0000 (14:55 +0000)
committerhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 22 Jan 2002 14:55:21 +0000 (14:55 +0000)
src/externs.h
src/init1.c
src/init2.c

index 99e7dfd..688130b 100644 (file)
@@ -745,10 +745,6 @@ extern errr init_v_info(void);
 extern void init_file_paths(char *path);
 extern void init_angband(void);
 extern errr init_buildings(void);
-#ifdef ALLOW_TEMPLATES
-extern u32b fake_name_size;
-extern u32b fake_text_size;
-#endif /* ALLOW_TEMPLATES */
 
 /* load.c */
 extern errr rd_savefile_new(void);
index d525c4a..f3448aa 100644 (file)
@@ -659,7 +659,7 @@ static cptr d_info_flags1[] =
 static bool add_text(u32b *offset, header *head, cptr buf)
 {
        /* Hack -- Verify space */
-       if (head->text_size + strlen(buf) + 8 > fake_text_size)
+       if (head->text_size + strlen(buf) + 8 > FAKE_TEXT_SIZE)
                return (FALSE);
 
        /* New text? */
@@ -689,7 +689,7 @@ static bool add_text(u32b *offset, header *head, cptr buf)
 static bool add_name(u32b *offset, header *head, cptr buf)
 {
        /* Hack -- Verify space */
-       if (head->name_size + strlen(buf) + 8 > fake_name_size)
+       if (head->name_size + strlen(buf) + 8 > FAKE_NAME_SIZE)
                return (FALSE);
 
        /* New name? */
index 9675322..8b120c0 100644 (file)
@@ -245,14 +245,6 @@ int error_line;
 
 
 /*
- * Hack -- help initialize the fake "name" and "text" arrays when
- * parsing an "ascii" template file.
- */
-u32b fake_name_size;
-u32b fake_text_size;
-
-
-/*
  * Standard error message text
  */
 cptr err_str[PARSE_ERROR_MAX] =
@@ -479,16 +471,12 @@ static errr init_info(cptr filename, header *head,
        {
                /*** Make the fake arrays ***/
 
-               /* Assume the size of "*_name" and "*_text" */
-               fake_name_size = FAKE_NAME_SIZE;
-               fake_text_size = FAKE_TEXT_SIZE;
-
                /* Allocate the "*_info" array */
                C_MAKE(head->info_ptr, head->info_size, char);
 
                /* Hack -- make "fake" arrays */
-               if (name) C_MAKE(head->name_ptr, fake_name_size, char);
-               if (text) C_MAKE(head->text_ptr, fake_text_size, char);
+               if (name) C_MAKE(head->name_ptr, FAKE_NAME_SIZE, char);
+               if (text) C_MAKE(head->text_ptr, FAKE_TEXT_SIZE, char);
 
                if (info) (*info) = head->info_ptr;
                if (name) (*name) = head->name_ptr;
@@ -596,12 +584,8 @@ static errr init_info(cptr filename, header *head,
                C_KILL(head->info_ptr, head->info_size, char);
 
                /* Hack -- Free the "fake" arrays */
-               if (name) C_KILL(head->name_ptr, fake_name_size, char);
-               if (text) C_KILL(head->text_ptr, fake_text_size, char);
-
-               /* Forget the array sizes */
-               fake_name_size = 0;
-               fake_text_size = 0;
+               if (name) C_KILL(head->name_ptr, FAKE_NAME_SIZE, char);
+               if (text) C_KILL(head->text_ptr, FAKE_TEXT_SIZE, char);
 
 #endif /* ALLOW_TEMPLATES */