[mlpack-svn] r10871 - mlpack/trunk/src/mlpack/core/util
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri Dec 16 17:35:12 EST 2011
Author: vlad321
Date: 2011-12-16 17:35:11 -0500 (Fri, 16 Dec 2011)
New Revision: 10871
Modified:
mlpack/trunk/src/mlpack/core/util/cli.cpp
mlpack/trunk/src/mlpack/core/util/cli_deleter.hpp
mlpack/trunk/src/mlpack/core/util/cli_impl.hpp
mlpack/trunk/src/mlpack/core/util/log.cpp
Log:
Formatted /util
Modified: mlpack/trunk/src/mlpack/core/util/cli.cpp
===================================================================
--- mlpack/trunk/src/mlpack/core/util/cli.cpp 2011-12-16 22:24:24 UTC (rev 10870)
+++ mlpack/trunk/src/mlpack/core/util/cli.cpp 2011-12-16 22:35:11 UTC (rev 10871)
@@ -39,11 +39,11 @@
namespace po = boost::program_options;
// Fake ProgramDoc in case none is supplied.
-static ProgramDoc empty_program_doc = ProgramDoc("", "");
+static ProgramDoc emptyProgramDoc = ProgramDoc("", "");
/* Constructors, Destructors, Copy */
/* Make the constructor private, to preclude unauthorized instances */
-CLI::CLI() : desc("Allowed Options") , did_parse(false), doc(&empty_program_doc)
+CLI::CLI() : desc("Allowed Options") , did_parse(false), doc(&emptyProgramDoc)
{
return;
}
@@ -54,14 +54,14 @@
* @param optionsName Name of the module, as far as boost is concerned.
*/
CLI::CLI(std::string& optionsName) :
- desc(optionsName.c_str()), did_parse(false), doc(&empty_program_doc)
+ desc(optionsName.c_str()), did_parse(false), doc(&emptyProgramDoc)
{
return;
}
// Private copy constructor; don't want copies floating around.
CLI::CLI(const CLI& other) : desc(other.desc),
- did_parse(false), doc(&empty_program_doc)
+ did_parse(false), doc(&emptyProgramDoc)
{
return;
}
@@ -120,17 +120,17 @@
std::string path = identifier;
std::string stringAlias = alias;
// Must make use of boost option name syntax.
- std::string prog_opt_id = stringAlias.length() ? path + "," + alias : path;
+ std::string progOptId = stringAlias.length() ? path + "," + alias : path;
// Deal with a required alias.
AddAlias(stringAlias, path);
// Add the option to boost::program_options.
- desc.add_options()(prog_opt_id.c_str(), description);
+ desc.add_options()(progOptId.c_str(), description);
// Make sure the description, etc. ends up in gmap.
gmap_t& gmap = GetSingleton().globalValues;
-
+
ParamData data;
data.desc = description;
data.tname = "";
@@ -155,7 +155,8 @@
*/
void CLI::AddAlias(std::string alias, std::string original) {
//Conduct the mapping
- if (alias.length()) {
+ if (alias.length())
+ {
amap_t& amap = GetSingleton().aliasValues;
amap[alias] = original;
}
@@ -169,7 +170,7 @@
const char* alias)
{
// Reuse functionality from add
- Add(identifier, description, alias, false);
+ Add(identifier, description, alias, false);
// Insert the proper metadata in gmap.
gmap_t& gmap = GetSingleton().globalValues;
@@ -625,7 +626,7 @@
{
// Only register the doc if it is not the dummy object we created at the
// beginning of the file (as a default value in case this is never called).
- if (doc != &empty_program_doc)
+ if (doc != &emptyProgramDoc)
GetSingleton().doc = doc;
}
Modified: mlpack/trunk/src/mlpack/core/util/cli_deleter.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/util/cli_deleter.hpp 2011-12-16 22:24:24 UTC (rev 10870)
+++ mlpack/trunk/src/mlpack/core/util/cli_deleter.hpp 2011-12-16 22:35:11 UTC (rev 10871)
@@ -25,7 +25,7 @@
};
//! Declare the deleter.
-static CLIDeleter cli_deleter;
+static CLIDeleter cliDeleter;
}; // namespace io
}; // namespace mlpack
Modified: mlpack/trunk/src/mlpack/core/util/cli_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/util/cli_impl.hpp 2011-12-16 22:24:24 UTC (rev 10870)
+++ mlpack/trunk/src/mlpack/core/util/cli_impl.hpp 2011-12-16 22:35:11 UTC (rev 10871)
@@ -38,14 +38,14 @@
std::string path = identifier;
std::string stringAlias = alias;
// Must make use of boost syntax here.
- std::string prog_opt_id = stringAlias.length() ? path + "," + alias : path;
+ std::string progOptId = stringAlias.length() ? path + "," + alias : path;
// Add the alias, if necessary
AddAlias(stringAlias, path);
// Add the option to boost program_options.
desc.add_options()
- (prog_opt_id.c_str(), po::value<T>(), description);
+ (progOptId.c_str(), po::value<T>(), description);
// Make sure the appropriate metadata is inserted into gmap.
gmap_t& gmap = GetSingleton().globalValues;
@@ -58,7 +58,7 @@
data.tname = TYPENAME(T);
data.value = boost::any(tmp);
data.wasPassed = false;
-
+
gmap[path] = data;
// If the option is required, add it to the required options list.
Modified: mlpack/trunk/src/mlpack/core/util/log.cpp
===================================================================
--- mlpack/trunk/src/mlpack/core/util/log.cpp 2011-12-16 22:24:24 UTC (rev 10870)
+++ mlpack/trunk/src/mlpack/core/util/log.cpp 2011-12-16 22:35:11 UTC (rev 10871)
@@ -49,42 +49,42 @@
// skip first stack frame (points here)
for (size_t i = 1; i < size && messages != NULL; ++i)
{
- char *mangled_name = 0, *offset_begin = 0, *offset_end = 0;
+ char *mangledName = 0, *offsetBegin = 0, *offsetEnd = 0;
// find parantheses and +address offset surrounding mangled name
for (char *p = messages[i]; *p; ++p)
{
if (*p == '(')
{
- mangled_name = p;
+ mangledName = p;
}
else if (*p == '+')
{
- offset_begin = p;
+ offsetBegin = p;
}
else if (*p == ')')
{
- offset_end = p;
+ offsetEnd = p;
break;
}
}
// if the line could be processed, attempt to demangle the symbol
- if (mangled_name && offset_begin && offset_end &&
- mangled_name < offset_begin)
+ if (mangledName && offsetBegin && offsetEnd &&
+ mangledName < offsetBegin)
{
- *mangled_name++ = '\0';
- *offset_begin++ = '\0';
- *offset_end++ = '\0';
+ *mangledName++ = '\0';
+ *offsetBegin++ = '\0';
+ *offsetEnd++ = '\0';
int status;
- char* real_name = abi::__cxa_demangle(mangled_name, 0, 0, &status);
+ char* realName = abi::__cxa_demangle(mangledName, 0, 0, &status);
// if demangling is successful, output the demangled function name
if (status == 0)
{
Log::Debug << "[bt]: (" << i << ") " << messages[i] << " : "
- << real_name << "+" << offset_begin << offset_end
+ << realName << "+" << offsetBegin << offsetEnd
<< std::endl;
}
@@ -92,10 +92,10 @@
else
{
Log::Debug << "[bt]: (" << i << ") " << messages[i] << " : "
- << mangled_name << "+" << offset_begin << offset_end
+ << mangledName << "+" << offsetBegin << offsetEnd
<< std::endl;
}
- free(real_name);
+ free(realName);
}
// otherwise, print the whole line
else
More information about the mlpack-svn
mailing list