Fixed some formatting issues that cause compile issues on bsd.

This commit is contained in:
wrenczes@gmail.com
2011-02-01 11:54:38 +00:00
parent b42dbf0655
commit b6dcb0dcd3
3 changed files with 88 additions and 85 deletions
+2 -2
View File
@@ -117,6 +117,6 @@ u32 ramAvailable(void);
#define MAKEDIR(name) mkdir(name, 0777) #define MAKEDIR(name) mkdir(name, 0777)
#endif #endif
#endif
bool FileExists(const string& strFilename); bool FileExists(const string& strFilename);
#endif
+20 -17
View File
@@ -95,21 +95,21 @@ int fileExists(const char * filename)
} }
/* /*
#ifdef LINUX #ifdef LINUX
#include <execinfo.h> #include <execinfo.h>
void dumpStack() void dumpStack()
{ {
void* buffer[50]; void* buffer[50];
int s = backtrace(buffer, 50); int s = backtrace(buffer, 50);
char** tab = backtrace_symbols(buffer, s); char** tab = backtrace_symbols(buffer, s);
for (int i = 1; i < s; ++i) printf("%s\n", tab[i]); for (int i = 1; i < s; ++i) printf("%s\n", tab[i]);
printf("\n"); printf("\n");
free(tab); free(tab);
} }
#endif #endif
*/ */
/* RAM simple check functions source */ /* RAM simple check functions source */
@@ -298,19 +298,22 @@ std::string wordWrap(const std::string& sentence, float width, int fontId)
return retVal; return retVal;
} }
bool FileExists(const string& strFilename)
bool FileExists(const string& strFilename) { {
struct stat stFileInfo; struct stat stFileInfo;
bool blnReturn; bool blnReturn;
int intStat; int intStat;
// Attempt to get the file attributes // Attempt to get the file attributes
intStat = stat(strFilename.c_str(),&stFileInfo); intStat = stat(strFilename.c_str(),&stFileInfo);
if(intStat == 0) { if(intStat == 0)
{
// We were able to get the file attributes // We were able to get the file attributes
// so the file obviously exists. // so the file obviously exists.
blnReturn = true; blnReturn = true;
} else { }
else
{
// We were not able to get the file attributes. // We were not able to get the file attributes.
// This may mean that we don't have permission to // This may mean that we don't have permission to
// access the folder which contains this file. If you // access the folder which contains this file. If you