mirror of https://github.com/OpenTTD/OpenTTD
(svn r18026) -Codechange: make a lookup table static that doesn't need to be 'exported'
parent
6db598e408
commit
3702746756
|
@ -212,7 +212,7 @@ void FioOpenFile(int slot, const char *filename)
|
|||
FioSeekToFile(slot, pos);
|
||||
}
|
||||
|
||||
const char *_subdirs[NUM_SUBDIRS] = {
|
||||
static const char *_subdirs[NUM_SUBDIRS] = {
|
||||
"",
|
||||
"save" PATHSEP,
|
||||
"save" PATHSEP "autosave" PATHSEP,
|
||||
|
@ -957,7 +957,7 @@ void DeterminePaths(const char *exe)
|
|||
};
|
||||
|
||||
for (uint i = 0; i < lengthof(default_subdirs); i++) {
|
||||
char *dir = str_fmt("%s%s", _personal_dir, FioGetSubdirectory(default_subdirs[i]));
|
||||
char *dir = str_fmt("%s%s", _personal_dir, _subdirs[default_subdirs[i]]);
|
||||
FioCreateDirectory(dir);
|
||||
free(dir);
|
||||
}
|
||||
|
@ -970,7 +970,7 @@ void DeterminePaths(const char *exe)
|
|||
/* Create the directory for each of the types of content */
|
||||
const Subdirectory dirs[] = { SCENARIO_DIR, HEIGHTMAP_DIR, DATA_DIR, AI_DIR, AI_LIBRARY_DIR };
|
||||
for (uint i = 0; i < lengthof(dirs); i++) {
|
||||
char *tmp = str_fmt("%s%s", _searchpaths[SP_AUTODOWNLOAD_DIR], FioGetSubdirectory(dirs[i]));
|
||||
char *tmp = str_fmt("%s%s", _searchpaths[SP_AUTODOWNLOAD_DIR], _subdirs[dirs[i]]);
|
||||
FioCreateDirectory(tmp);
|
||||
free(tmp);
|
||||
}
|
||||
|
|
|
@ -56,13 +56,6 @@ char *FioFindFullPath(char *buf, size_t buflen, Subdirectory subdir, const char
|
|||
char *FioAppendDirectory(char *buf, size_t buflen, Searchpath sp, Subdirectory subdir);
|
||||
char *FioGetDirectory(char *buf, size_t buflen, Subdirectory subdir);
|
||||
|
||||
static inline const char *FioGetSubdirectory(Subdirectory subdir)
|
||||
{
|
||||
extern const char *_subdirs[NUM_SUBDIRS];
|
||||
assert(subdir < NUM_SUBDIRS);
|
||||
return _subdirs[subdir];
|
||||
}
|
||||
|
||||
void SanitizeFilename(char *filename);
|
||||
void AppendPathSeparator(char *buf, size_t buflen);
|
||||
void DeterminePaths(const char *exe);
|
||||
|
|
Loading…
Reference in New Issue