Changeset - r13497:69a506313a15
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-11-09 09:27:48
rubidium@openttd.org
(svn r18026) -Codechange: make a lookup table static that doesn't need to be 'exported'
2 files changed with 3 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -212,7 +212,7 @@ void FioOpenFile(int slot, const char *f
 
	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);
 
	}
src/fileio_func.h
Show inline comments
 
@@ -56,13 +56,6 @@ char *FioFindFullPath(char *buf, size_t 
 
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);
0 comments (0 inline, 0 general)