Mercurial > otakunoraifu
diff 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 |
line wrap: on
line diff
--- a/system/file.cc +++ b/system/file.cc @@ -94,7 +94,7 @@ FILESEARCH::ARCTYPE FILESEARCH::default_ ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, ATYPE_DIR, ATYPE_DIR }; -char* FILESEARCH::default_dirnames[TYPEMAX] = { +const char* FILESEARCH::default_dirnames[TYPEMAX] = { 0, 0, "", "pdt", "seen.txt", "allanm.anl", "allard.ard", "allcur.cur", 0, 0, "koe", "bgm", "mov", "gan"}; @@ -108,7 +108,7 @@ char* FILESEARCH::default_dirnames[TYPEM ** Find ¤·¤¿¤â¤Î¤òRead¤¹¤ë¤ÈÆâÍƤ¬ÆÀ¤é¤ì¤ë¡£ */ -ARCFILE::ARCFILE(char* aname) { +ARCFILE::ARCFILE(const char* aname) { struct stat sb; /* ÊÑ¿ô½é´ü²½ */ arcname = 0; @@ -665,8 +665,7 @@ void FILESEARCH::SetFileInformation(FILE /* ŬÅö¤Ë½é´ü²½ */ if (filenames[type] != 0 && filenames[type] != default_dirnames[type]) delete[] filenames[type]; - filenames[type] = new char[strlen(filename)+1]; - strcpy(filenames[type], filename); + filenames[type] = filename; is_archived[type] = is_arc; searcher[type] = MakeARCFILE(is_arc, filename); if (searcher[type] && next_arc) @@ -696,7 +695,7 @@ void FILESEARCH::AppendFileInformation(F return; } -ARCFILE* FILESEARCH::MakeARCFILE(ARCTYPE tp, char* filename) { +ARCFILE* FILESEARCH::MakeARCFILE(ARCTYPE tp, const char* filename) { ARCFILE* arc = 0; char* file; if (filename == 0) goto err;