Skip to content

Commit

Permalink
remove trailing whitespaces only
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Feb 17, 2014
1 parent 27ed245 commit ac74cfe
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 101 deletions.
2 changes: 1 addition & 1 deletion include/rospack/rospack_backcompat.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008, Willow Garage, Inc.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice,
Expand Down
102 changes: 51 additions & 51 deletions src/rospack.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008, Willow Garage, Inc., Morgan Quigley
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice,
Expand Down Expand Up @@ -209,8 +209,8 @@ class DirectoryCrawlRecord
double start_time_;
double crawl_time_;
size_t start_num_pkgs_;
DirectoryCrawlRecord(std::string path,
double start_time,
DirectoryCrawlRecord(std::string path,
double start_time,
size_t start_num_pkgs) :
path_(path),
zombie_(false),
Expand Down Expand Up @@ -239,7 +239,7 @@ Rosstackage::Rosstackage(const std::string& manifest_name,
{
}

void
void
Rosstackage::logWarn(const std::string& msg,
bool append_errno)
{
Expand Down Expand Up @@ -267,7 +267,7 @@ Rosstackage::getSearchPathFromEnv(std::vector<std::string>& sp)
#endif

std::vector<std::string> rpp_strings;
boost::split(rpp_strings, rpp,
boost::split(rpp_strings, rpp,
boost::is_any_of(path_delim),
boost::token_compress_on);
for(std::vector<std::string>::const_iterator it = rpp_strings.begin();
Expand Down Expand Up @@ -385,13 +385,13 @@ Rosstackage::crawl(std::vector<std::string> search_path,
p != search_paths_.end();
++p)
crawlDetail(*p, force, 1, false, dummy, dummy2);

crawled_ = true;

writeCache();
}

bool
bool
Rosstackage::inStackage(std::string& name)
{
fs::path path;
Expand Down Expand Up @@ -441,7 +441,7 @@ Rosstackage::find(const std::string& name, std::string& path)
}

bool
Rosstackage::contents(const std::string& name,
Rosstackage::contents(const std::string& name,
std::set<std::string>& packages)
{
Rospack rp2;
Expand All @@ -467,7 +467,7 @@ Rosstackage::contents(const std::string& name,
}

bool
Rosstackage::contains(const std::string& name,
Rosstackage::contains(const std::string& name,
std::string& stack,
std::string& path)
{
Expand Down Expand Up @@ -498,21 +498,21 @@ Rosstackage::contains(const std::string& name,
return false;
}

void
void
Rosstackage::list(std::set<std::pair<std::string, std::string> >& list)
{
for(std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin();
it != stackages_.end();
++it)
{
std::pair<std::string, std::string> item;
item.first = it->first;
item.second = it->second->path_;
list.insert(item);
std::pair<std::string, std::string> item;
item.first = it->first;
item.second = it->second->path_;
list.insert(item);
}
}

void
void
Rosstackage::listDuplicates(std::vector<std::string>& dups)
{
dups.resize(dups_.size());
Expand Down Expand Up @@ -634,7 +634,7 @@ Rosstackage::depsWhy(const std::string& from,
logError(e.what());
return true;
}
output.append(std::string("Dependency chains from ") +
output.append(std::string("Dependency chains from ") +
from + " to " + to + ":\n");
for(std::list<std::list<Stackage*> >::const_iterator it = acc_list.begin();
it != acc_list.end();
Expand All @@ -655,7 +655,7 @@ Rosstackage::depsWhy(const std::string& from,
}

bool
Rosstackage::depsManifests(const std::string& name, bool direct,
Rosstackage::depsManifests(const std::string& name, bool direct,
std::vector<std::string>& manifests)
{
Stackage* stackage = findWithRecrawl(name);
Expand All @@ -680,7 +680,7 @@ Rosstackage::depsManifests(const std::string& name, bool direct,
}

bool
Rosstackage::rosdeps(const std::string& name, bool direct,
Rosstackage::rosdeps(const std::string& name, bool direct,
std::set<std::string>& rosdeps)
{
Stackage* stackage = findWithRecrawl(name);
Expand Down Expand Up @@ -746,7 +746,7 @@ Rosstackage::_rosdeps(Stackage* stackage, std::set<std::string>& rosdeps, const
}

bool
Rosstackage::vcs(const std::string& name, bool direct,
Rosstackage::vcs(const std::string& name, bool direct,
std::vector<std::string>& vcs)
{
Stackage* stackage = findWithRecrawl(name);
Expand Down Expand Up @@ -793,7 +793,7 @@ Rosstackage::vcs(const std::string& name, bool direct,
return true;
}

bool
bool
Rosstackage::cpp_exports(const std::string& name, const std::string& type,
const std::string& attrib, bool deps_only,
std::vector<std::pair<std::string, bool> >& flags)
Expand Down Expand Up @@ -968,7 +968,7 @@ Rosstackage::reorder_paths(const std::string& paths, std::string& reordered)
return true;
}

bool
bool
Rosstackage::exports(const std::string& name, const std::string& lang,
const std::string& attrib, bool deps_only,
std::vector<std::string>& flags)
Expand Down Expand Up @@ -1001,7 +1001,7 @@ Rosstackage::exports(const std::string& name, const std::string& lang,
return true;
}

bool
bool
Rosstackage::exports_dry_package(Stackage* stackage, const std::string& lang,
const std::string& attrib,
std::vector<std::string>& flags)
Expand Down Expand Up @@ -1069,8 +1069,8 @@ Rosstackage::exports_dry_package(Stackage* stackage, const std::string& lang,
return true;
}

bool
Rosstackage::plugins(const std::string& name, const std::string& attrib,
bool
Rosstackage::plugins(const std::string& name, const std::string& attrib,
const std::string& top,
std::vector<std::string>& flags)
{
Expand Down Expand Up @@ -1136,7 +1136,7 @@ Rosstackage::plugins(const std::string& name, const std::string& attrib,
}

bool
Rosstackage::depsMsgSrv(const std::string& name, bool direct,
Rosstackage::depsMsgSrv(const std::string& name, bool direct,
std::vector<std::string>& gens)
{
Stackage* stackage = findWithRecrawl(name);
Expand All @@ -1151,11 +1151,11 @@ Rosstackage::depsMsgSrv(const std::string& name, bool direct,
it != deps_vec.end();
++it)
{
fs::path msg_gen = fs::path((*it)->path_) /
MSG_GEN_GENERATED_DIR /
fs::path msg_gen = fs::path((*it)->path_) /
MSG_GEN_GENERATED_DIR /
MSG_GEN_GENERATED_FILE;
fs::path srv_gen = fs::path((*it)->path_) /
SRV_GEN_GENERATED_DIR /
fs::path srv_gen = fs::path((*it)->path_) /
SRV_GEN_GENERATED_DIR /
SRV_GEN_GENERATED_FILE;
if(fs::is_regular_file(msg_gen))
gens.push_back(msg_gen.string());
Expand All @@ -1175,7 +1175,7 @@ Rosstackage::depsMsgSrv(const std::string& name, bool direct,
// Rosstackage methods (private)
/////////////////////////////////////////////////////////////

void
void
Rosstackage::log(const std::string& level,
const std::string& msg,
bool append_errno)
Expand Down Expand Up @@ -1354,7 +1354,7 @@ Rosstackage::profile(const std::vector<std::string>& search_path,
char buf[16];
snprintf(buf, sizeof(buf), "%.6f", (*it)->crawl_time_);
if(length < 0 || i < length)
dirs.push_back(std::string(buf) + " " +
dirs.push_back(std::string(buf) + " " +
((*it)->zombie_ ? "* " : " ") +
(*it)->path_);
i++;
Expand Down Expand Up @@ -1525,7 +1525,7 @@ Rosstackage::crawlDetail(const std::string& path,
{
// Measure the elapsed time
dcr->crawl_time_ = time_since_epoch() - dcr->start_time_;
// If the number of packages didn't change while crawling,
// If the number of packages didn't change while crawling,
// then this directory is a zombie
if(stackages_.size() == dcr->start_num_pkgs_)
dcr->zombie_ = true;
Expand All @@ -1540,7 +1540,7 @@ Rosstackage::loadManifest(Stackage* stackage)

if(!stackage->manifest_.LoadFile(stackage->manifest_path_))
{
std::string errmsg = std::string("error parsing manifest of package ") +
std::string errmsg = std::string("error parsing manifest of package ") +
stackage->name_ + " at " + stackage->manifest_path_;
throw Exception(errmsg);
}
Expand Down Expand Up @@ -1658,7 +1658,7 @@ Rosstackage::isSysPackage(const std::string& pkgname)
return cache.find(pkgname)->second;
}

initPython();
initPython();
PyGILState_STATE gstate = PyGILState_Ensure();

static PyObject* pModule = 0;
Expand Down Expand Up @@ -1759,14 +1759,14 @@ Rosstackage::isSysPackage(const std::string& pkgname)
}

void
Rosstackage::gatherDeps(Stackage* stackage, bool direct,
Rosstackage::gatherDeps(Stackage* stackage, bool direct,
traversal_order_t order,
std::vector<Stackage*>& deps,
bool no_recursion_on_wet)
{
std::tr1::unordered_set<Stackage*> deps_hash;
std::vector<std::string> indented_deps;
gatherDepsFull(stackage, direct, order, 0,
gatherDepsFull(stackage, direct, order, 0,
deps_hash, deps, false, indented_deps, no_recursion_on_wet);
}

Expand Down Expand Up @@ -1889,11 +1889,11 @@ Rosstackage::getCachePath()
{
// Get the user's home directory by looking up the password entry based
// on UID. If that doesn't work, we fall back on examining $HOME,
// knowing that that can cause trouble when mixed with sudo (#2884).
// knowing that that can cause trouble when mixed with sudo (#2884).
#if defined(WIN32)
char* home_drive = getenv("HOMEDRIVE");
char* home_path = getenv("HOMEPATH");
if(home_drive && home_path)
if(home_drive && home_path)
cache_path = fs::path(home_drive) / fs::path(home_path) / fs::path(DOTROS_NAME);
#else // UNIX
char* home_path;
Expand Down Expand Up @@ -2022,7 +2022,7 @@ Rosstackage::writeCache()
int fd = mkstemp(tmp_cache_path);
if (fd < 0)
{
fprintf(stderr, "[rospack] Unable to create temporary cache file %s: %s\n",
fprintf(stderr, "[rospack] Unable to create temporary cache file %s: %s\n",
tmp_cache_path, strerror(errno));
}
else
Expand All @@ -2031,7 +2031,7 @@ Rosstackage::writeCache()
#endif
if (!cache)
{
fprintf(stderr, "[rospack] Unable open cache file %s: %s\n",
fprintf(stderr, "[rospack] Unable open cache file %s: %s\n",
tmp_cache_path, strerror(errno));
}
else
Expand All @@ -2047,7 +2047,7 @@ Rosstackage::writeCache()
remove(cache_path.c_str());
if(rename(tmp_cache_path, cache_path.c_str()) < 0)
{
fprintf(stderr, "[rospack] Error: failed to rename cache file %s to %s: %s\n",
fprintf(stderr, "[rospack] Error: failed to rename cache file %s to %s: %s\n",
tmp_cache_path, cache_path.c_str(), strerror(errno));
}
}
Expand Down Expand Up @@ -2075,7 +2075,7 @@ Rosstackage::validateCache()
if ((cache_max_age > 0.0) && (dt > cache_max_age))
return NULL;
}
// try to open it
// try to open it
FILE* cache = fopen(cache_path.c_str(), "r");
if(!cache)
return NULL; // it's not readable by us. sad.
Expand Down Expand Up @@ -2129,10 +2129,10 @@ Rosstackage::expandExportString(Stackage* stackage,
i != std::string::npos;
i = outstring.find(MANIFEST_PREFIX))
{
outstring.replace(i, std::string(MANIFEST_PREFIX).length(),
outstring.replace(i, std::string(MANIFEST_PREFIX).length(),
stackage->path_);
}

// skip substitution attempt when the string neither contains
// a dollar sign for $(command) and $envvar nor
// a backtick wrapping a command
Expand All @@ -2155,15 +2155,15 @@ Rosstackage::expandExportString(Stackage* stackage,

// Remove embedded newlines
std::string token("\n");
for (std::string::size_type s = cmd.find(token);
for (std::string::size_type s = cmd.find(token);
s != std::string::npos;
s = cmd.find(token, s))
cmd.replace(s,token.length(),std::string(" "));

FILE* p;
if(!(p = popen(cmd.c_str(), "r")))
{
std::string errmsg =
std::string errmsg =
std::string("failed to execute backquote expression ") +
cmd + " in " +
stackage->manifest_path_;
Expand All @@ -2183,7 +2183,7 @@ Rosstackage::expandExportString(Stackage* stackage,
// Close the subprocess, checking exit status
if(pclose(p) != 0)
{
std::string errmsg =
std::string errmsg =
std::string("got non-zero exit status from executing backquote expression ") +
cmd + " in " +
stackage->manifest_path_;
Expand Down Expand Up @@ -2222,7 +2222,7 @@ Rosstackage::~Rosstackage()
}
}

const char*
const char*
Rospack::usage()
{
return "USAGE: rospack <command> [options] [package]\n"
Expand Down Expand Up @@ -2270,7 +2270,7 @@ Rosstack::Rosstack() :
{
}

const char*
const char*
Rosstack::usage()
{
return "USAGE: rosstack [options] <command> [stack]\n"
Expand Down Expand Up @@ -2300,14 +2300,14 @@ get_manifest_root(Stackage* stackage)
TiXmlElement* ele = stackage->manifest_.RootElement();
if(!ele)
{
std::string errmsg = std::string("error parsing manifest of package ") +
std::string errmsg = std::string("error parsing manifest of package ") +
stackage->name_ + " at " + stackage->manifest_path_;
throw Exception(errmsg);
}
return ele;
}

double
double
time_since_epoch()
{
#if defined(WIN32)
Expand Down
Loading

0 comments on commit ac74cfe

Please sign in to comment.