OSDN Git Service

[Refactor] #40463 Removed unused preprocessor MACH_O_CARBON
authorHourier <hourier@users.sourceforge.jp>
Thu, 4 Jun 2020 09:00:35 +0000 (18:00 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 4 Jun 2020 09:00:35 +0000 (18:00 +0900)
17 files changed:
src/cmd-io/cmd-diary.c
src/cmd-io/cmd-dump.c
src/cmd-io/cmd-knowledge.c
src/cmd-io/cmd-macro.c
src/cmd-io/cmd-process-screen.c
src/cmd/cmd-visuals.c
src/io/files-util.c
src/io/save.c
src/io/write-diary.c
src/knowledge/knowledge-quests.c
src/main/init.c
src/object/object1.c
src/system/h-config.h
src/util/util.c
src/util/util.h
src/wizard/wizard-special-process.c
src/wizard/wizard-spoiler.c

index f894cbc..fd0c7de 100644 (file)
@@ -109,7 +109,6 @@ static void do_cmd_erase_diary(void)
  */
 void do_cmd_diary(player_type *creature_ptr)
 {
-       FILE_TYPE(FILE_TYPE_TEXT);
        screen_save();
        int i;
        while (TRUE)
index 83a9cef..a30163b 100644 (file)
@@ -77,7 +77,6 @@ void do_cmd_colors(player_type *creature_ptr, void(*process_autopick_file_comman
        char tmp[160];
        char buf[1024];
        FILE *auto_dump_stream;
-       FILE_TYPE(FILE_TYPE_TEXT);
        screen_save();
        while (TRUE)
        {
index cd0ef70..fde289d 100644 (file)
@@ -19,7 +19,6 @@ void do_cmd_knowledge(player_type *creature_ptr)
 {
        int i, p = 0;
        bool need_redraw = FALSE;
-       FILE_TYPE(FILE_TYPE_TEXT);
        screen_save();
        while (TRUE)
        {
index 274db22..64251f6 100644 (file)
@@ -14,7 +14,6 @@ static void macro_dump(FILE **fpp, concptr fname)
        static concptr mark = "Macro Dump";
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
-       FILE_TYPE(FILE_TYPE_TEXT);
        if (!open_auto_dump(fpp, buf, mark)) return;
 
        auto_dump_printf(*fpp, _("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
@@ -113,7 +112,6 @@ static errr keymap_dump(concptr fname)
        }
 
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
-       FILE_TYPE(FILE_TYPE_TEXT);
        if (!open_auto_dump(&auto_dump_stream, buf, mark)) return -1;
 
        auto_dump_printf(auto_dump_stream, _("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
@@ -153,7 +151,6 @@ void do_cmd_macros(player_type *creature_ptr, void(*process_autopick_file_comman
        char buf[1024];
        FILE *auto_dump_stream;
        BIT_FLAGS mode = rogue_like_commands ? KEYMAP_MODE_ROGUE : KEYMAP_MODE_ORIG;
-       FILE_TYPE(FILE_TYPE_TEXT);
        screen_save();
        while (TRUE)
        {
index 5ba4c14..fe1ef4b 100644 (file)
@@ -181,7 +181,6 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
 {
        TERM_LEN wid, hgt;
        Term_get_size(&wid, &hgt);
-       FILE_TYPE(FILE_TYPE_TEXT);
        FILE *fff;
        fff = my_fopen(filename, "w");
        if (!check_screen_html_can_open(fff, filename, message)) return;
@@ -287,7 +286,6 @@ static bool do_cmd_save_screen_text(int wid, int hgt)
        FILE *fff;
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "w");
        if (!check_screen_text_can_open(fff, buf)) return FALSE;
 
index 16f2ba6..64ea7a9 100644 (file)
@@ -75,7 +75,6 @@ void do_cmd_visuals(player_type *creature_ptr, void(*process_autopick_file_comma
        concptr empty_symbol = "<< ? >>";
        if (use_bigtile) empty_symbol = "<< ?? >>";
 
-       FILE_TYPE(FILE_TYPE_TEXT);
        screen_save();
        while (TRUE)
        {
index 87d6f7f..5a37a42 100644 (file)
@@ -50,9 +50,6 @@ errr file_character(player_type *creature_ptr, concptr name, update_playtime_pf
 {
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
-
-       FILE_TYPE(FILE_TYPE_TEXT);
-
        int     fd = fd_open(buf, O_RDONLY);
        if (fd >= 0)
        {
@@ -279,7 +276,6 @@ errr counts_write(player_type *creature_ptr, int where, u32b count)
        safe_setuid_drop();
        if (fd < 0)
        {
-               FILE_TYPE(FILE_TYPE_DATA);
                safe_setuid_grab();
                fd = fd_make(buf, 0644);
                safe_setuid_drop();
index b7c8b94..7cdc91c 100644 (file)
@@ -1425,8 +1425,6 @@ static bool wr_savefile_new(player_type *player_ptr)
  */
 static bool save_player_aux(player_type *player_ptr, char *name)
 {
-       FILE_TYPE(FILE_TYPE_SAVE);
-
        /* Grab permissions */
        safe_setuid_grab();
 
@@ -1800,9 +1798,6 @@ bool save_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mod
        /* No file yet */
        fff = NULL;
 
-       /* File type is "SAVE" */
-       FILE_TYPE(FILE_TYPE_SAVE);
-
        /* Grab permissions */
        safe_setuid_grab();
 
index 191965d..55b2250 100644 (file)
@@ -55,7 +55,6 @@ static bool open_diary_file(FILE **fff, bool *disable_diary)
        sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
-       FILE_TYPE(FILE_TYPE_TEXT);
        *fff = my_fopen(buf, "a");
        if (*fff) return TRUE;
 
index 6b556d5..f9f20ae 100644 (file)
@@ -29,7 +29,6 @@
   */
 void do_cmd_checkquest(player_type *creature_ptr)
 {
-       FILE_TYPE(FILE_TYPE_TEXT);
        screen_save();
        do_cmd_knowledge_quests(creature_ptr);
        screen_load();
index 594c554..ca0550f 100644 (file)
@@ -490,8 +490,6 @@ static errr init_info(concptr filename, header *head, void **info, char **name,
        }
 
        /*** Dump the binary image file ***/
-       /* File type is "DATA" */
-       FILE_TYPE(FILE_TYPE_DATA);
        path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
 
        /* Grab permissions */
@@ -1484,9 +1482,6 @@ void init_angband(player_type *player_ptr, void(*process_autopick_file_command)(
        BIT_FLAGS file_permission = 0664;
        if (fd < 0)
        {
-               /* File type is "DATA" */
-               FILE_TYPE(FILE_TYPE_DATA);
-
                /* Grab permissions */
                safe_setuid_grab();
 
index 39816fc..195c81b 100644 (file)
 #include "util/util.h"
 #include "view/display-main-window.h"
 
-#if defined(MACH_O_CARBON)
-#ifdef verify
-#undef verify
-#endif
-#endif
-
 /*!
  * @brief オブジェクト、地形の表示シンボルなど初期化する / Reset the "visual" lists
  * @return なし
index 3719699..2d5921a 100644 (file)
 # define PATH_SEP "\\"
 #endif
 
- /*
- * The Macintosh allows the use of a "file type" when creating a file
- */
-#if defined(MACH_O_CARBON)
-# define FILE_TYPE_TEXT 'TEXT'
-# define FILE_TYPE_DATA 'DATA'
-# define FILE_TYPE_SAVE 'SAVE'
-# define FILE_TYPE(X) (_ftype = (X))
-#else
-# define FILE_TYPE(X) ((void)0)
-#endif
-
 /*
  * Linux has "stricmp()" with a different name
  */
 #define DEFAULT_X11_FONT_7             "5x8"
 #endif
 
-/*
- * Hack -- Mach-O (native binary format of OS X) is basically a Un*x
- * but has Mac OS/Windows-like user interface
- */
-#ifdef MACH_O_CARBON
-# ifdef PRIVATE_USER_PATH
-#  undef PRIVATE_USER_PATH
-# endif
-# ifdef SAVEFILE_USE_UID
-#  undef SAVEFILE_USE_UID
-# endif
-#endif
-
 #ifndef HAVE_CONFIG_H
 #define WORLD_SCORE
 #endif /* HAVE_CONFIG_H */
index f90f9ee..9392521 100644 (file)
@@ -370,19 +370,8 @@ errr path_build(char *buf, int max, concptr path, concptr file)
  */
 FILE *my_fopen(concptr file, concptr mode)
 {
-#if defined(MACH_O_CARBON)
-       FILE *tempfff;
-#endif
        char buf[1024];
        if (path_parse(buf, 1024, file)) return (NULL);
-#if defined(MACH_O_CARBON)
-       if (my_strchr(mode, 'w'))
-       {
-               tempfff = fopen(buf, mode);
-               fsetfileinfo(buf, _fcreator, _ftype);
-               fclose(tempfff);
-       }
-#endif
 
        return (fopen(buf, mode));
 }
@@ -437,16 +426,6 @@ errr my_fgets(FILE *fff, char *buf, huge n)
 #endif
                for (s = tmp; *s; s++)
                {
-#if defined(MACH_O_CARBON)
-
-                       /*
-                        * Be nice to the Macintosh, where a file can have Mac or Unix
-                        * end of line, especially since the introduction of OS X.
-                        * MPW tools were also very tolerant to the Unix EOL.
-                        */
-                       if (*s == '\r') *s = '\n';
-
-#endif /* MACH_O_CARBON */
                        if (*s == '\n')
                        {
                                buf[i] = '\0';
@@ -592,17 +571,7 @@ int fd_make(concptr file, BIT_FLAGS mode)
        char buf[1024];
        if (path_parse(buf, 1024, file)) return -1;
 
-#if defined(MACH_O_CARBON)
-       {
-               int fdes;
-               fdes = open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode);
-               if (fdes >= 0) fsetfileinfo(buf, _fcreator, _ftype);
-               return (fdes);
-       }
-
-#else
        return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode));
-#endif
 }
 
 
index 4d168c7..a6bda75 100644 (file)
@@ -204,16 +204,6 @@ extern void user_name(char *buf, int id);
 extern int usleep(huge usecs);
 #endif
 
-#if defined(MACH_O_CARBON)
-extern void fsetfileinfo(concptr path, u32b fcreator, u32b ftype);
-#endif
-
-#if defined(MACH_O_CARBON)
-/* Globals needed */
-extern  u32b _ftype;
-extern  u32b _fcreator;
-#endif
-
 /*
  * Hack -- force definitions -- see fd_seek()
  */
@@ -242,7 +232,7 @@ extern  u32b _fcreator;
 
 extern const char hexsym[16];
 
-// todo ファイル処理関数・メッセージ処理関数・画面病が関数で最低限分割する.
+// todo ファイル処理関数・メッセージ処理関数・画面描画関数で最低限分割する.
 extern errr path_parse(char *buf, int max, concptr file);
 extern errr path_build(char *buf, int max, concptr path, concptr file);
 extern FILE *my_fopen(concptr file, concptr mode);
index 2effaee..af42101 100644 (file)
@@ -1630,9 +1630,7 @@ static void do_cmd_dump_options()
        char buf[1024];
        path_build(buf, sizeof buf, ANGBAND_DIR_USER, "opt_info.txt");
 
-       /* File type is "TEXT" */
        FILE *fff;
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "a");
 
        if (!fff)
index ec76d21..c282534 100644 (file)
@@ -285,8 +285,6 @@ static void spoil_obj_desc(player_type *player_ptr, concptr fname)
 
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
 
-       /* File type is "TEXT" */
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "w");
 
        if (!fff)
@@ -1575,8 +1573,6 @@ static void spoil_artifact(player_type *player_ptr, concptr fname)
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
 
-       /* File type is "TEXT" */
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "w");
 
        if (!fff)
@@ -1655,10 +1651,7 @@ static void spoil_mon_desc(concptr fname)
        char exp[80];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
 
-       /* File type is "TEXT" */
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "w");
-
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -1985,10 +1978,7 @@ static void spoil_mon_info(player_type *player_ptr, concptr fname)
        MONRACE_IDX *who;
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
 
-       /* File type is "TEXT" */
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "w");
-
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -2189,10 +2179,7 @@ static void spoil_mon_evol(concptr fname)
        int *evol_tree_zero; /* For C_KILL() */
        path_build(buf, sizeof buf, ANGBAND_DIR_USER, fname);
 
-       /* File type is "TEXT" */
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "w");
-
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -2484,10 +2471,7 @@ void spoil_random_artifact(player_type *creature_ptr, concptr fname)
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
 
-       /* File type is "TEXT" */
-       FILE_TYPE(FILE_TYPE_TEXT);
        fff = my_fopen(buf, "w");
-
        if (!fff)
        {
                msg_print("Cannot create list file.");