From f37d7a2179402ed93426bd73e7c45fcd16588bd8 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Tue, 23 Sep 2003 01:41:20 +0000 Subject: [PATCH] formatting changes. --- dtool/src/dconfig/configTable.I | 26 ++++++------- dtool/src/dconfig/configTable.cxx | 36 +++++++++--------- dtool/src/dconfig/configTable.h | 42 ++++++++++----------- dtool/src/dconfig/config_notify.h | 2 +- dtool/src/dconfig/dconfig.h | 40 ++++++++------------ dtool/src/dconfig/expand.h | 6 +-- dtool/src/dconfig/notifyCategory.cxx | 2 - dtool/src/dconfig/notifySeverity.h | 2 +- panda/src/express/config_express.cxx | 2 +- panda/src/express/get_config_path.cxx | 2 +- panda/src/physics/linearEulerIntegrator.cxx | 4 +- panda/src/putil/config_util.cxx | 2 +- 12 files changed, 77 insertions(+), 89 deletions(-) diff --git a/dtool/src/dconfig/configTable.I b/dtool/src/dconfig/configTable.I index 02366ef9bc..28b13043e9 100644 --- a/dtool/src/dconfig/configTable.I +++ b/dtool/src/dconfig/configTable.I @@ -17,57 +17,57 @@ //////////////////////////////////////////////////////////////////// -INLINE void ConfigTable::ConfigDbgDefault(void) { +INLINE void ConfigTable::ConfigDbgDefault() { // this should not be called if CONFIG_CONFIG=:configdbg=1 configdbg = false; microconfig_cat->set_severity(NS_info); dconfig_cat->set_severity(NS_info); } -INLINE void ConfigTable::ReadArgsDefault(void) { +INLINE void ConfigTable::ReadArgsDefault() { readargs = true; } -INLINE void ConfigTable::ReadEnvsDefault(void) { +INLINE void ConfigTable::ReadEnvsDefault() { readenvs = true; } -INLINE void ConfigTable::PathSepDefault(void) { +INLINE void ConfigTable::PathSepDefault() { pathsep = ": "; } -INLINE void ConfigTable::FileSepDefault(void) { +INLINE void ConfigTable::FileSepDefault() { filesep = "/"; } -INLINE void ConfigTable::ConfigNameDefault(void) { +INLINE void ConfigTable::ConfigNameDefault() { configname = "Configrc"; } -INLINE void ConfigTable::ConfigSuffixDefault(void) { +INLINE void ConfigTable::ConfigSuffixDefault() { configsuffix = ""; } -INLINE void ConfigTable::ConfigArgsDefault(void) { +INLINE void ConfigTable::ConfigArgsDefault() { configargs = ""; } -INLINE void ConfigTable::ConfigPathDefault(void) { +INLINE void ConfigTable::ConfigPathDefault() { configpath = "CFG_PATH"; } -INLINE void ConfigTable::ConfigCmtDefault(void) { +INLINE void ConfigTable::ConfigCmtDefault() { configcmt = "#"; } -INLINE void ConfigTable::ArgSuffixDefault(void) { +INLINE void ConfigTable::ArgSuffixDefault() { argsuffix = "_ARGS"; } -INLINE void ConfigTable::CommandStubDefault(void) { +INLINE void ConfigTable::CommandStubDefault() { commandstub = "CONFIG"; } -INLINE ConfigString ConfigTable::GetConfigPath(void) const { +INLINE ConfigString ConfigTable::GetConfigPath() const { return configpath; } diff --git a/dtool/src/dconfig/configTable.cxx b/dtool/src/dconfig/configTable.cxx index baf28f4743..921b77ac8f 100644 --- a/dtool/src/dconfig/configTable.cxx +++ b/dtool/src/dconfig/configTable.cxx @@ -67,15 +67,13 @@ void ConfigTable::DeComment(ConfigString& S) { } } -bool ConfigTable::IsComment(const ConfigString& S) -{ +bool ConfigTable::IsComment(const ConfigString& S) { // Returns true if the line begins with the comment delimiter, // whether or not the delimiter is followed by whitespace. return (S.substr(0, configcmt.length()) == configcmt); } -void ConfigTable::UpCase(ConfigString& S) -{ +void ConfigTable::UpCase(ConfigString& S) { for (ConfigString::iterator i=S.begin(); i!=S.end(); ++i) (*i) = toupper(*i); } @@ -93,8 +91,7 @@ ConfigString ConfigTable::PopNextWord(ConfigString& S) { return ret; } -void ConfigTable::ParseConfigFile(istream& is, const ConfigString& Filename) -{ +void ConfigTable::ParseConfigFile(istream& is, const ConfigString& Filename) { ConfigString line; while (!is.eof() && !is.fail()) { @@ -133,7 +130,7 @@ void ConfigTable::ParseConfigFile(istream& is, const ConfigString& Filename) } } -void ConfigTable::ReadConfigFile(void) { +void ConfigTable::ReadConfigFile() { // The configpath variable lists the environment variables that // themselves should be considered to contain search paths for // Configrc files. This is one level of indirection from the @@ -284,8 +281,7 @@ void ConfigTable::ParseCommandEnv(ConfigString& S, const ConfigString& sym) } } -void ConfigTable::ParseArgs(void) -{ +void ConfigTable::ParseArgs() { int n = 0; int num_args = ExecutionEnvironment::get_num_args(); @@ -336,8 +332,7 @@ void ConfigTable::ParseArgs(void) } } -void ConfigTable::MicroConfig(void) -{ +void ConfigTable::MicroConfig() { /* #ifndef NDEBUG NotifySeverity mcs = microconfig_cat->get_severity(); @@ -356,8 +351,9 @@ void ConfigTable::MicroConfig(void) #endif * NDEBUG * */ string cc = ExecutionEnvironment::get_environment_variable("CONFIG_CONFIG"); - if (microconfig_cat->is_spam()) - microconfig_cat->spam() << "CONFIG_CONFIG = '" << cc << "'" << endl; + if (microconfig_cat->is_spam()) { + microconfig_cat->spam() << "CONFIG_CONFIG = '" << cc << "'" << endl; + } bool cdbg = false; bool psep = false; bool fsep = false; @@ -375,9 +371,10 @@ void ConfigTable::MicroConfig(void) if (configconfig.length() > 1) { ConfigString assign = "="; ConfigString sep = configconfig.substr(0, 1); - if (microconfig_cat->is_spam()) + if (microconfig_cat->is_spam()) { microconfig_cat->spam() << "separator character is: '" << sep << "'" << endl; + } typedef std::vector strvec; strvec sv; size_t q = 1; @@ -616,7 +613,7 @@ void ConfigTable::MicroConfig(void) } } -void ConfigTable::GetData(void) { +void ConfigTable::GetData() { MicroConfig(); #ifndef DISABLE_CONFIG ReadConfigFile(); @@ -644,7 +641,7 @@ void ConfigTable::GetData(void) { #endif // DISABLE_CONFIG } -ConfigTable* ConfigTable::Instance(void) { +ConfigTable* ConfigTable::Instance() { if (_instance == (ConfigTable*)0L) { _instance = new ConfigTable; _instance->GetData(); @@ -654,7 +651,7 @@ ConfigTable* ConfigTable::Instance(void) { return _instance; } -bool ConfigTable::AmInitializing(void) { +bool ConfigTable::AmInitializing() { return _initializing; } @@ -663,10 +660,11 @@ bool ConfigTable::TrueOrFalse(const ConfigString& in, bool def) { ConfigString S = in; UpCase(S); if (S[0] == '#') { - if (S[1] == 'F') + if (S[1] == 'F') { ret = false; - else if (S[1] == 'T') + } else if (S[1] == 'T') { ret = true; + } } else if (S == "0") { ret = false; } else if (S == "1") { diff --git a/dtool/src/dconfig/configTable.h b/dtool/src/dconfig/configTable.h index fd155f203b..b7108548f5 100644 --- a/dtool/src/dconfig/configTable.h +++ b/dtool/src/dconfig/configTable.h @@ -62,35 +62,35 @@ class EXPCL_DTOOLCONFIG ConfigTable { ConfigString NextWord(const ConfigString& S); ConfigString PopNextWord(ConfigString& S); void ParseConfigFile(istream&, const ConfigString&); - void ReadConfigFile(void); + void ReadConfigFile(); void ParseCommandEnv(ConfigString&, const ConfigString&); - void ParseArgs(void); - INLINE void ConfigDbgDefault(void); - INLINE void ReadArgsDefault(void); - INLINE void ReadEnvsDefault(void); - INLINE void PathSepDefault(void); - INLINE void FileSepDefault(void); - INLINE void ConfigNameDefault(void); - INLINE void ConfigSuffixDefault(void); - INLINE void ConfigArgsDefault(void); - INLINE void ConfigPathDefault(void); - INLINE void ConfigCmtDefault(void); - INLINE void ArgSuffixDefault(void); - INLINE void CommandStubDefault(void); - void MicroConfig(void); - void GetData(void); + void ParseArgs(); + INLINE void ConfigDbgDefault(); + INLINE void ReadArgsDefault(); + INLINE void ReadEnvsDefault(); + INLINE void PathSepDefault(); + INLINE void FileSepDefault(); + INLINE void ConfigNameDefault(); + INLINE void ConfigSuffixDefault(); + INLINE void ConfigArgsDefault(); + INLINE void ConfigPathDefault(); + INLINE void ConfigCmtDefault(); + INLINE void ArgSuffixDefault(); + INLINE void CommandStubDefault(); + void MicroConfig(); + void GetData(); protected: - ConfigTable(void) : _initializing(true) {} + ConfigTable() : _initializing(true) {} public: - static ConfigTable* Instance(void); - bool AmInitializing(void); + static ConfigTable* Instance(); + bool AmInitializing(); static bool TrueOrFalse(const ConfigString& in, bool def = false); bool Defined(const ConfigString& sym, const ConfigString qual=""); SymEnt Get(const ConfigString& sym, const ConfigString qual = ""); const Symbol& GetSym(const ConfigString& sym, const ConfigString qual = ""); - INLINE ConfigString GetConfigPath(void) const; - INLINE bool IsConfigDbg(void) { return configdbg; }; + INLINE ConfigString GetConfigPath() const; + INLINE bool IsConfigDbg() { return configdbg; }; }; #include "configTable.I" diff --git a/dtool/src/dconfig/config_notify.h b/dtool/src/dconfig/config_notify.h index 788ed04ade..25d3df2ab4 100644 --- a/dtool/src/dconfig/config_notify.h +++ b/dtool/src/dconfig/config_notify.h @@ -19,7 +19,7 @@ #ifndef CONFIG_NOTIFY_H #define CONFIG_NOTIFY_H -#include +#include "dtoolbase.h" #include "dconfig.h" ConfigureDecl(config_notify, EXPCL_DTOOLCONFIG, EXPTP_DTOOLCONFIG); diff --git a/dtool/src/dconfig/dconfig.h b/dtool/src/dconfig/dconfig.h index 1114ea5dc2..04fcb538ae 100644 --- a/dtool/src/dconfig/dconfig.h +++ b/dtool/src/dconfig/dconfig.h @@ -19,7 +19,7 @@ #ifndef DCONFIG_H #define DCONFIG_H -#include +#include "dtoolbase.h" #include "config_setup.h" #include "config_dconfig.h" @@ -64,15 +64,15 @@ EXPCL_DTOOLCONFIG extern int total_num_get; template class Config { protected: - static void ConfigFunc(void); + static void ConfigFunc(); static void Flag(bool); public: - Config(void); - ~Config(void); - static bool AmInitializing(void); - static ConfigString Name(void); - static bool Flag(void); - static void Init(void); + Config(); + ~Config(); + static bool AmInitializing(); + static ConfigString Name(); + static bool Flag(); + static void Init(); static bool Defined(const ConfigString& sym); static ConfigString Get(const ConfigString sym); static ConfigTable::Symbol& GetAll(const ConfigString, @@ -89,14 +89,12 @@ class Config { // Implementation follows template -void Config::ConfigFunc(void) -{ +void Config::ConfigFunc() { GetConfig::config_func(); } template -bool Config::AmInitializing(void) -{ +bool Config::AmInitializing() { ConfigTable* tab = ConfigTable::Instance(); if (tab == (ConfigTable *)0L) return Flag(); @@ -104,26 +102,22 @@ bool Config::AmInitializing(void) } template -ConfigString Config::Name(void) -{ +ConfigString Config::Name() { return GetConfig::get_name(); } template -bool Config::Flag(void) -{ +bool Config::Flag() { return GetConfig::_flag; } template -void Config::Flag(bool f) -{ +void Config::Flag(bool f) { GetConfig::_flag = f; } template -void Config::Init(void) -{ +void Config::Init() { if (Flag()) return; total_time_config_init -= clock(); @@ -161,14 +155,12 @@ void Config::Init(void) } template -Config::Config(void) -{ +Config::Config() { Init(); } template -Config::~Config(void) -{ +Config::~Config() { } template diff --git a/dtool/src/dconfig/expand.h b/dtool/src/dconfig/expand.h index b880711ac4..eb01acdc97 100644 --- a/dtool/src/dconfig/expand.h +++ b/dtool/src/dconfig/expand.h @@ -19,7 +19,7 @@ #ifndef __EXPAND_H__ #define __EXPAND_H__ -#include +#include "dtoolbase.h" #include "pfstream.h" #include "config_setup.h" @@ -41,7 +41,7 @@ class Base_Expander { INLINE ConfigString Env(ConfigString S); istream& CopyStreamToString(istream& is, ConfigString& S); INLINE bool isUser(ConfigString S); - INLINE ConfigString GetMyDir(void); + INLINE ConfigString GetMyDir(); INLINE ConfigString GetUserDir(ConfigString S); ConfigString Expand(ConfigString S); Base_Expander() {} @@ -49,7 +49,7 @@ class Base_Expander { Base_Expander(ConfigString S) : _result(Base_Expander::Expand(S)) {} Base_Expander(const Base_Expander& c) : _result(c._result) {} ~Base_Expander() {} - INLINE ConfigString operator()(void); + INLINE ConfigString operator()(); INLINE ConfigString operator()(ConfigString); INLINE operator ConfigString(); }; diff --git a/dtool/src/dconfig/notifyCategory.cxx b/dtool/src/dconfig/notifyCategory.cxx index 24b1cf199c..9eb4734c60 100644 --- a/dtool/src/dconfig/notifyCategory.cxx +++ b/dtool/src/dconfig/notifyCategory.cxx @@ -50,7 +50,6 @@ NotifyCategory(const string &fullname, const string &basename, if (_fullname.empty()) { config_name = "notify-level"; - } else if (!_basename.empty()) { config_name = "notify-level-" + _basename; } @@ -76,7 +75,6 @@ NotifyCategory(const string &fullname, const string &basename, // parent's. if (_parent != (NotifyCategory *)NULL) { _severity = _parent->_severity; - } else { // Unless, of course, we're the root. _severity = NS_info; diff --git a/dtool/src/dconfig/notifySeverity.h b/dtool/src/dconfig/notifySeverity.h index 602a11d8bf..401d9cf896 100644 --- a/dtool/src/dconfig/notifySeverity.h +++ b/dtool/src/dconfig/notifySeverity.h @@ -19,7 +19,7 @@ #ifndef NOTIFYSEVERITY_H #define NOTIFYSEVERITY_H -#include +#include "dtoolbase.h" BEGIN_PUBLISH enum NotifySeverity { diff --git a/panda/src/express/config_express.cxx b/panda/src/express/config_express.cxx index 228b9c6aef..fccf6ae713 100644 --- a/panda/src/express/config_express.cxx +++ b/panda/src/express/config_express.cxx @@ -31,7 +31,7 @@ #include "virtualFileMountSystem.h" #include "virtualFileSimple.h" -#include +#include "dconfig.h" ConfigureDef(config_express); NotifyCategoryDef(express, ""); diff --git a/panda/src/express/get_config_path.cxx b/panda/src/express/get_config_path.cxx index 79a631e2ca..7647830362 100644 --- a/panda/src/express/get_config_path.cxx +++ b/panda/src/express/get_config_path.cxx @@ -20,7 +20,7 @@ #include "config_express.h" -#include +#include "executionEnvironment.h" #include "get_config_path.h" diff --git a/panda/src/physics/linearEulerIntegrator.cxx b/panda/src/physics/linearEulerIntegrator.cxx index 8d3e7de539..28f22b5778 100644 --- a/panda/src/physics/linearEulerIntegrator.cxx +++ b/panda/src/physics/linearEulerIntegrator.cxx @@ -185,10 +185,10 @@ child_integrate(Physical *physical, accel_vec*=viscosityDamper; - // x = x + v * t + 0.5 * a * t * t - pos += vel_vec * dt + 0.5 * accel_vec * dt * dt; // v = v + a * t vel_vec += accel_vec * dt; + // x = x + v * t + 0.5 * a * t * t + pos += vel_vec * dt + 0.5 * accel_vec * dt * dt; #endif //] // and store them back. diff --git a/panda/src/putil/config_util.cxx b/panda/src/putil/config_util.cxx index 41b2ad4ed0..0ba12785d7 100644 --- a/panda/src/putil/config_util.cxx +++ b/panda/src/putil/config_util.cxx @@ -35,7 +35,7 @@ #include "mouseButton.h" #include "get_config_path.h" -#include +#include "dconfig.h" ConfigureDef(config_util); NotifyCategoryDef(util, "");