Mercurial > otakunoraifu
comparison system/file.cc @ 47:5f548e5957a8
* get rid of the "deprecated conversion from string constant to ‘char*’" warnings
author | thib |
---|---|
date | Wed, 15 Apr 2009 20:26:32 +0000 |
parents | 01aa5ddf7dc8 |
children | 35ce1a30f3f9 |
comparison
equal
deleted
inserted
replaced
46:3aa3d244ad90 | 47:5f548e5957a8 |
---|---|
92 ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, | 92 ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, |
93 ATYPE_ARC, ATYPE_ARC, ATYPE_ARC, ATYPE_ARC, | 93 ATYPE_ARC, ATYPE_ARC, ATYPE_ARC, ATYPE_ARC, |
94 ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, | 94 ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, |
95 ATYPE_DIR, ATYPE_DIR | 95 ATYPE_DIR, ATYPE_DIR |
96 }; | 96 }; |
97 char* FILESEARCH::default_dirnames[TYPEMAX] = { | 97 const char* FILESEARCH::default_dirnames[TYPEMAX] = { |
98 0, 0, "", "pdt", | 98 0, 0, "", "pdt", |
99 "seen.txt", "allanm.anl", "allard.ard", "allcur.cur", | 99 "seen.txt", "allanm.anl", "allard.ard", "allcur.cur", |
100 0, 0, "koe", "bgm", "mov", "gan"}; | 100 0, 0, "koe", "bgm", "mov", "gan"}; |
101 | 101 |
102 /********************************************* | 102 /********************************************* |
106 ** | 106 ** |
107 ** ½ñ¸Ë¥Õ¥¡¥¤¥ë¤«¤é¥Õ¥¡¥¤¥ë¤ÎÈ´¤½Ð¤·¤ÏFind() | 107 ** ½ñ¸Ë¥Õ¥¡¥¤¥ë¤«¤é¥Õ¥¡¥¤¥ë¤ÎÈ´¤½Ð¤·¤ÏFind() |
108 ** Find ¤·¤¿¤â¤Î¤òRead¤¹¤ë¤ÈÆâÍƤ¬ÆÀ¤é¤ì¤ë¡£ | 108 ** Find ¤·¤¿¤â¤Î¤òRead¤¹¤ë¤ÈÆâÍƤ¬ÆÀ¤é¤ì¤ë¡£ |
109 */ | 109 */ |
110 | 110 |
111 ARCFILE::ARCFILE(char* aname) { | 111 ARCFILE::ARCFILE(const char* aname) { |
112 struct stat sb; | 112 struct stat sb; |
113 /* ÊÑ¿ô½é´ü²½ */ | 113 /* ÊÑ¿ô½é´ü²½ */ |
114 arcname = 0; | 114 arcname = 0; |
115 list_point = 0; | 115 list_point = 0; |
116 filenames_orig = 0; | 116 filenames_orig = 0; |
663 } | 663 } |
664 searcher[type] = 0; | 664 searcher[type] = 0; |
665 /* ŬÅö¤Ë½é´ü²½ */ | 665 /* ŬÅö¤Ë½é´ü²½ */ |
666 if (filenames[type] != 0 && | 666 if (filenames[type] != 0 && |
667 filenames[type] != default_dirnames[type]) delete[] filenames[type]; | 667 filenames[type] != default_dirnames[type]) delete[] filenames[type]; |
668 filenames[type] = new char[strlen(filename)+1]; | 668 filenames[type] = filename; |
669 strcpy(filenames[type], filename); | |
670 is_archived[type] = is_arc; | 669 is_archived[type] = is_arc; |
671 searcher[type] = MakeARCFILE(is_arc, filename); | 670 searcher[type] = MakeARCFILE(is_arc, filename); |
672 if (searcher[type] && next_arc) | 671 if (searcher[type] && next_arc) |
673 searcher[type]->SetNext(next_arc); | 672 searcher[type]->SetNext(next_arc); |
674 return; | 673 return; |
694 for (cur=searcher[type]; cur->Next() != 0; cur = cur->Next()) ; | 693 for (cur=searcher[type]; cur->Next() != 0; cur = cur->Next()) ; |
695 cur->SetNext(arc); | 694 cur->SetNext(arc); |
696 return; | 695 return; |
697 } | 696 } |
698 | 697 |
699 ARCFILE* FILESEARCH::MakeARCFILE(ARCTYPE tp, char* filename) { | 698 ARCFILE* FILESEARCH::MakeARCFILE(ARCTYPE tp, const char* filename) { |
700 ARCFILE* arc = 0; | 699 ARCFILE* arc = 0; |
701 char* file; | 700 char* file; |
702 if (filename == 0) goto err; | 701 if (filename == 0) goto err; |
703 if (tp == ATYPE_DIR) { | 702 if (tp == ATYPE_DIR) { |
704 file = root_dir->SearchFile(filename); | 703 file = root_dir->SearchFile(filename); |