From 5291216d06fdcf1217ab1450e39da0f32222019d Mon Sep 17 00:00:00 2001 From: jeefo Date: Fri, 26 Jun 2015 00:07:06 +0300 Subject: [PATCH] fixed some typos in waypoint.cpp fixed clang build error. --- source/interface.cpp | 56 ++++++++++++++++++++++---------------------- source/waypoint.cpp | 4 ++-- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/source/interface.cpp b/source/interface.cpp index c6b4f5e..2570a35 100644 --- a/source/interface.cpp +++ b/source/interface.cpp @@ -2989,38 +2989,38 @@ export void Meta_Init (void) g_isMetamod = true; } -#include +extern "C" int access (const char *filename, int mode); + +struct DirectoryTransition +{ + String oldName; + String newName; + + DirectoryTransition (void) + { + } + + DirectoryTransition (const String &oldName, const String &newName) + { + String rootPath; + rootPath->AssignFormat ("%s/addons/yapb/", GetModName ()); + + this->oldName = rootPath + oldName; + this->newName = rootPath + newName; + } + + void TryToRename (void) + { + if (access (oldName->GetBuffer (), 00) != -1) + rename (oldName->GetBuffer (), newName->GetBuffer ()); + } +}; void FixDirectoryStructure (void) { - // temporary function for 2.7 directory structure changes, will be delete after final releases of the bot + // temporary function for 2.7 directory structure changes, will be deleted after final releases of the bot - struct DirectoryTransition - { - String oldName; - String newName; - - DirectoryTransition (void) - { - } - - DirectoryTransition (const String &oldName, const String &newName) - { - String rootPath; - rootPath->AssignFormat ("%s/addons/yapb/", GetModName ()); - - this->oldName = rootPath + oldName; - this->newName = rootPath + newName; - } - - void TryToRename (void) - { - if (access (oldName->GetBuffer (), 00) != -1) - rename (oldName->GetBuffer (), newName->GetBuffer ()); - } - }; - - Array directories; + static Array directories; directories.Push (DirectoryTransition ("wptdefault", "data")); directories.Push (DirectoryTransition ("data/data", "data/learned")); diff --git a/source/waypoint.cpp b/source/waypoint.cpp index 722351d..569fd7b 100644 --- a/source/waypoint.cpp +++ b/source/waypoint.cpp @@ -957,7 +957,7 @@ void Waypoint::SaveVisibilityTab (void) return; if (m_visLUT == NULL) - AddLogEntry (true, LL_FATAL, "Can't save visiblity tab. Bad data."); + AddLogEntry (true, LL_FATAL, "Can't save visibility tab. Bad data."); ExtensionHeader header; @@ -972,7 +972,7 @@ void Waypoint::SaveVisibilityTab (void) if (!fp.IsValid ()) { - AddLogEntry (true, LL_ERROR, "Failed to open visiblity table for writing"); + AddLogEntry (true, LL_ERROR, "Failed to open visibility table for writing"); return; } fp.Close ();