Jelajahi Sumber

formatting changes.

Dave Schuyler 22 tahun lalu
induk
melakukan
f37d7a2179

+ 13 - 13
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 
   // this should not be called if  CONFIG_CONFIG=:configdbg=1 
   configdbg = false;
   configdbg = false;
   microconfig_cat->set_severity(NS_info);
   microconfig_cat->set_severity(NS_info);
   dconfig_cat->set_severity(NS_info);
   dconfig_cat->set_severity(NS_info);
 }
 }
 
 
-INLINE void ConfigTable::ReadArgsDefault(void) {
+INLINE void ConfigTable::ReadArgsDefault() {
   readargs = true;
   readargs = true;
 }
 }
 
 
-INLINE void ConfigTable::ReadEnvsDefault(void) {
+INLINE void ConfigTable::ReadEnvsDefault() {
   readenvs = true;
   readenvs = true;
 }
 }
 
 
-INLINE void ConfigTable::PathSepDefault(void) {
+INLINE void ConfigTable::PathSepDefault() {
   pathsep = ": ";
   pathsep = ": ";
 }
 }
 
 
-INLINE void ConfigTable::FileSepDefault(void) {
+INLINE void ConfigTable::FileSepDefault() {
   filesep = "/";
   filesep = "/";
 }
 }
 
 
-INLINE void ConfigTable::ConfigNameDefault(void) {
+INLINE void ConfigTable::ConfigNameDefault() {
   configname = "Configrc";
   configname = "Configrc";
 }
 }
 
 
-INLINE void ConfigTable::ConfigSuffixDefault(void) {
+INLINE void ConfigTable::ConfigSuffixDefault() {
   configsuffix = "";
   configsuffix = "";
 }
 }
 
 
-INLINE void ConfigTable::ConfigArgsDefault(void) {
+INLINE void ConfigTable::ConfigArgsDefault() {
   configargs = "";
   configargs = "";
 }
 }
 
 
-INLINE void ConfigTable::ConfigPathDefault(void) {
+INLINE void ConfigTable::ConfigPathDefault() {
   configpath = "CFG_PATH";
   configpath = "CFG_PATH";
 }
 }
 
 
-INLINE void ConfigTable::ConfigCmtDefault(void) {
+INLINE void ConfigTable::ConfigCmtDefault() {
   configcmt = "#";
   configcmt = "#";
 }
 }
 
 
-INLINE void ConfigTable::ArgSuffixDefault(void) {
+INLINE void ConfigTable::ArgSuffixDefault() {
   argsuffix = "_ARGS";
   argsuffix = "_ARGS";
 }
 }
 
 
-INLINE void ConfigTable::CommandStubDefault(void) {
+INLINE void ConfigTable::CommandStubDefault() {
   commandstub = "CONFIG";
   commandstub = "CONFIG";
 }
 }
 
 
-INLINE ConfigString ConfigTable::GetConfigPath(void) const {
+INLINE ConfigString ConfigTable::GetConfigPath() const {
   return configpath;
   return configpath;
 }
 }

+ 17 - 19
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,
   // Returns true if the line begins with the comment delimiter,
   // whether or not the delimiter is followed by whitespace.
   // whether or not the delimiter is followed by whitespace.
   return (S.substr(0, configcmt.length()) == configcmt);
   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)
    for (ConfigString::iterator i=S.begin(); i!=S.end(); ++i)
       (*i) = toupper(*i);
       (*i) = toupper(*i);
 }
 }
@@ -93,8 +91,7 @@ ConfigString ConfigTable::PopNextWord(ConfigString& S) {
   return ret;
   return ret;
 }
 }
 
 
-void ConfigTable::ParseConfigFile(istream& is, const ConfigString& Filename)
-{
+void ConfigTable::ParseConfigFile(istream& is, const ConfigString& Filename) {
    ConfigString line;
    ConfigString line;
 
 
    while (!is.eof() && !is.fail()) {
    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
   // The configpath variable lists the environment variables that
   // themselves should be considered to contain search paths for
   // themselves should be considered to contain search paths for
   // Configrc files.  This is one level of indirection from the
   // 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 n = 0;
    int num_args = ExecutionEnvironment::get_num_args();
    int num_args = ExecutionEnvironment::get_num_args();
 
 
@@ -336,8 +332,7 @@ void ConfigTable::ParseArgs(void)
    }
    }
 }
 }
 
 
-void ConfigTable::MicroConfig(void)
-{
+void ConfigTable::MicroConfig() {
 /*
 /*
 #ifndef NDEBUG
 #ifndef NDEBUG
    NotifySeverity mcs = microconfig_cat->get_severity();
    NotifySeverity mcs = microconfig_cat->get_severity();
@@ -356,8 +351,9 @@ void ConfigTable::MicroConfig(void)
 #endif * NDEBUG *
 #endif * NDEBUG *
 */
 */
    string cc = ExecutionEnvironment::get_environment_variable("CONFIG_CONFIG");
    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 cdbg = false;
    bool psep = false;
    bool psep = false;
    bool fsep = false;
    bool fsep = false;
@@ -375,9 +371,10 @@ void ConfigTable::MicroConfig(void)
       if (configconfig.length() > 1) {
       if (configconfig.length() > 1) {
          ConfigString assign = "=";
          ConfigString assign = "=";
          ConfigString sep = configconfig.substr(0, 1);
          ConfigString sep = configconfig.substr(0, 1);
-         if (microconfig_cat->is_spam())
+         if (microconfig_cat->is_spam()) {
             microconfig_cat->spam() << "separator character is: '" << sep
             microconfig_cat->spam() << "separator character is: '" << sep
                                     << "'" << endl;
                                     << "'" << endl;
+         }
          typedef std::vector<ConfigString> strvec;
          typedef std::vector<ConfigString> strvec;
          strvec sv;
          strvec sv;
          size_t q = 1;
          size_t q = 1;
@@ -616,7 +613,7 @@ void ConfigTable::MicroConfig(void)
    }
    }
 }
 }
 
 
-void ConfigTable::GetData(void) {
+void ConfigTable::GetData() {
   MicroConfig();
   MicroConfig();
 #ifndef DISABLE_CONFIG
 #ifndef DISABLE_CONFIG
   ReadConfigFile();
   ReadConfigFile();
@@ -644,7 +641,7 @@ void ConfigTable::GetData(void) {
 #endif  // DISABLE_CONFIG
 #endif  // DISABLE_CONFIG
 }
 }
 
 
-ConfigTable* ConfigTable::Instance(void) {
+ConfigTable* ConfigTable::Instance() {
   if (_instance == (ConfigTable*)0L) {
   if (_instance == (ConfigTable*)0L) {
     _instance = new ConfigTable;
     _instance = new ConfigTable;
     _instance->GetData();
     _instance->GetData();
@@ -654,7 +651,7 @@ ConfigTable* ConfigTable::Instance(void) {
   return _instance;
   return _instance;
 }
 }
 
 
-bool ConfigTable::AmInitializing(void) {
+bool ConfigTable::AmInitializing() {
   return _initializing;
   return _initializing;
 }
 }
 
 
@@ -663,10 +660,11 @@ bool ConfigTable::TrueOrFalse(const ConfigString& in, bool def) {
   ConfigString S = in;
   ConfigString S = in;
   UpCase(S);
   UpCase(S);
   if (S[0] == '#') {
   if (S[0] == '#') {
-    if (S[1] == 'F')
+    if (S[1] == 'F') {
       ret = false;
       ret = false;
-    else if (S[1] == 'T')
+    } else if (S[1] == 'T') {
       ret = true;
       ret = true;
+    }
   } else if (S == "0") {
   } else if (S == "0") {
     ret = false;
     ret = false;
   } else if (S == "1") {
   } else if (S == "1") {

+ 21 - 21
dtool/src/dconfig/configTable.h

@@ -62,35 +62,35 @@ class EXPCL_DTOOLCONFIG ConfigTable {
       ConfigString NextWord(const ConfigString& S);
       ConfigString NextWord(const ConfigString& S);
       ConfigString PopNextWord(ConfigString& S);
       ConfigString PopNextWord(ConfigString& S);
       void ParseConfigFile(istream&, const ConfigString&);
       void ParseConfigFile(istream&, const ConfigString&);
-      void ReadConfigFile(void);
+      void ReadConfigFile();
       void ParseCommandEnv(ConfigString&, const ConfigString&);
       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:
    protected:
-      ConfigTable(void) : _initializing(true) {}
+      ConfigTable() : _initializing(true) {}
    public:
    public:
-      static ConfigTable* Instance(void);
-      bool AmInitializing(void);
+      static ConfigTable* Instance();
+      bool AmInitializing();
       static bool TrueOrFalse(const ConfigString& in, bool def = false);
       static bool TrueOrFalse(const ConfigString& in, bool def = false);
       bool Defined(const ConfigString& sym, const ConfigString qual="");
       bool Defined(const ConfigString& sym, const ConfigString qual="");
       SymEnt Get(const ConfigString& sym, const ConfigString qual = "");
       SymEnt Get(const ConfigString& sym, const ConfigString qual = "");
       const Symbol& GetSym(const ConfigString& sym,
       const Symbol& GetSym(const ConfigString& sym,
                            const ConfigString qual = "");
                            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"
 #include "configTable.I"

+ 1 - 1
dtool/src/dconfig/config_notify.h

@@ -19,7 +19,7 @@
 #ifndef CONFIG_NOTIFY_H
 #ifndef CONFIG_NOTIFY_H
 #define CONFIG_NOTIFY_H
 #define CONFIG_NOTIFY_H
 
 
-#include <dtoolbase.h>
+#include "dtoolbase.h"
 #include "dconfig.h"
 #include "dconfig.h"
 
 
 ConfigureDecl(config_notify, EXPCL_DTOOLCONFIG, EXPTP_DTOOLCONFIG);
 ConfigureDecl(config_notify, EXPCL_DTOOLCONFIG, EXPTP_DTOOLCONFIG);

+ 16 - 24
dtool/src/dconfig/dconfig.h

@@ -19,7 +19,7 @@
 #ifndef DCONFIG_H
 #ifndef DCONFIG_H
 #define DCONFIG_H
 #define DCONFIG_H
 
 
-#include <dtoolbase.h>
+#include "dtoolbase.h"
 
 
 #include "config_setup.h"
 #include "config_setup.h"
 #include "config_dconfig.h"
 #include "config_dconfig.h"
@@ -64,15 +64,15 @@ EXPCL_DTOOLCONFIG extern int total_num_get;
 template <class GetConfig>
 template <class GetConfig>
 class Config {
 class Config {
    protected:
    protected:
-      static void ConfigFunc(void);
+      static void ConfigFunc();
       static void Flag(bool);
       static void Flag(bool);
    public:
    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 bool         Defined(const ConfigString& sym);
       static ConfigString Get(const ConfigString sym);
       static ConfigString Get(const ConfigString sym);
       static ConfigTable::Symbol& GetAll(const ConfigString,
       static ConfigTable::Symbol& GetAll(const ConfigString,
@@ -89,14 +89,12 @@ class Config {
 // Implementation follows
 // Implementation follows
 
 
 template<class GetConfig>
 template<class GetConfig>
-void Config<GetConfig>::ConfigFunc(void)
-{
+void Config<GetConfig>::ConfigFunc() {
   GetConfig::config_func();
   GetConfig::config_func();
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>
-bool Config<GetConfig>::AmInitializing(void)
-{
+bool Config<GetConfig>::AmInitializing() {
    ConfigTable* tab = ConfigTable::Instance();
    ConfigTable* tab = ConfigTable::Instance();
    if (tab == (ConfigTable *)0L)
    if (tab == (ConfigTable *)0L)
       return Flag();
       return Flag();
@@ -104,26 +102,22 @@ bool Config<GetConfig>::AmInitializing(void)
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>
-ConfigString Config<GetConfig>::Name(void)
-{
+ConfigString Config<GetConfig>::Name() {
    return GetConfig::get_name();
    return GetConfig::get_name();
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>
-bool Config<GetConfig>::Flag(void)
-{
+bool Config<GetConfig>::Flag() {
    return GetConfig::_flag;
    return GetConfig::_flag;
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>
-void Config<GetConfig>::Flag(bool f)
-{
+void Config<GetConfig>::Flag(bool f) {
    GetConfig::_flag = f;
    GetConfig::_flag = f;
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>
-void Config<GetConfig>::Init(void)
-{
+void Config<GetConfig>::Init() {
    if (Flag())
    if (Flag())
       return;
       return;
    total_time_config_init -= clock();
    total_time_config_init -= clock();
@@ -161,14 +155,12 @@ void Config<GetConfig>::Init(void)
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>
-Config<GetConfig>::Config(void)
-{
+Config<GetConfig>::Config() {
    Init();
    Init();
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>
-Config<GetConfig>::~Config(void)
-{
+Config<GetConfig>::~Config() {
 }
 }
 
 
 template<class GetConfig>
 template<class GetConfig>

+ 3 - 3
dtool/src/dconfig/expand.h

@@ -19,7 +19,7 @@
 #ifndef __EXPAND_H__
 #ifndef __EXPAND_H__
 #define __EXPAND_H__
 #define __EXPAND_H__
 
 
-#include <dtoolbase.h>
+#include "dtoolbase.h"
 
 
 #include "pfstream.h"
 #include "pfstream.h"
 #include "config_setup.h"
 #include "config_setup.h"
@@ -41,7 +41,7 @@ class Base_Expander {
       INLINE ConfigString Env(ConfigString S);
       INLINE ConfigString Env(ConfigString S);
       istream& CopyStreamToString(istream& is, ConfigString& S);
       istream& CopyStreamToString(istream& is, ConfigString& S);
       INLINE bool isUser(ConfigString S);
       INLINE bool isUser(ConfigString S);
-      INLINE ConfigString GetMyDir(void);
+      INLINE ConfigString GetMyDir();
       INLINE ConfigString GetUserDir(ConfigString S);
       INLINE ConfigString GetUserDir(ConfigString S);
       ConfigString Expand(ConfigString S);
       ConfigString Expand(ConfigString S);
       Base_Expander() {}
       Base_Expander() {}
@@ -49,7 +49,7 @@ class Base_Expander {
       Base_Expander(ConfigString S) : _result(Base_Expander::Expand(S)) {}
       Base_Expander(ConfigString S) : _result(Base_Expander::Expand(S)) {}
       Base_Expander(const Base_Expander& c) : _result(c._result) {}
       Base_Expander(const Base_Expander& c) : _result(c._result) {}
       ~Base_Expander() {}
       ~Base_Expander() {}
-      INLINE ConfigString operator()(void);
+      INLINE ConfigString operator()();
       INLINE ConfigString operator()(ConfigString);
       INLINE ConfigString operator()(ConfigString);
       INLINE operator ConfigString();
       INLINE operator ConfigString();
 };
 };

+ 0 - 2
dtool/src/dconfig/notifyCategory.cxx

@@ -50,7 +50,6 @@ NotifyCategory(const string &fullname, const string &basename,
 
 
   if (_fullname.empty()) {
   if (_fullname.empty()) {
     config_name = "notify-level";
     config_name = "notify-level";
-
   } else if (!_basename.empty()) {
   } else if (!_basename.empty()) {
     config_name = "notify-level-" + _basename;
     config_name = "notify-level-" + _basename;
   }
   }
@@ -76,7 +75,6 @@ NotifyCategory(const string &fullname, const string &basename,
     // parent's.
     // parent's.
     if (_parent != (NotifyCategory *)NULL) {
     if (_parent != (NotifyCategory *)NULL) {
       _severity = _parent->_severity;
       _severity = _parent->_severity;
-
     } else {
     } else {
       // Unless, of course, we're the root.
       // Unless, of course, we're the root.
       _severity = NS_info;
       _severity = NS_info;

+ 1 - 1
dtool/src/dconfig/notifySeverity.h

@@ -19,7 +19,7 @@
 #ifndef NOTIFYSEVERITY_H
 #ifndef NOTIFYSEVERITY_H
 #define NOTIFYSEVERITY_H
 #define NOTIFYSEVERITY_H
 
 
-#include <dtoolbase.h>
+#include "dtoolbase.h"
 
 
 BEGIN_PUBLISH
 BEGIN_PUBLISH
 enum NotifySeverity {
 enum NotifySeverity {

+ 1 - 1
panda/src/express/config_express.cxx

@@ -31,7 +31,7 @@
 #include "virtualFileMountSystem.h"
 #include "virtualFileMountSystem.h"
 #include "virtualFileSimple.h"
 #include "virtualFileSimple.h"
 
 
-#include <dconfig.h>
+#include "dconfig.h"
 
 
 ConfigureDef(config_express);
 ConfigureDef(config_express);
 NotifyCategoryDef(express, "");
 NotifyCategoryDef(express, "");

+ 1 - 1
panda/src/express/get_config_path.cxx

@@ -20,7 +20,7 @@
 
 
 #include "config_express.h"
 #include "config_express.h"
 
 
-#include <executionEnvironment.h>
+#include "executionEnvironment.h"
 #include "get_config_path.h"
 #include "get_config_path.h"
 
 
 
 

+ 2 - 2
panda/src/physics/linearEulerIntegrator.cxx

@@ -185,10 +185,10 @@ child_integrate(Physical *physical,
     
     
     accel_vec*=viscosityDamper;
     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
     // v = v + a * t
     vel_vec += accel_vec * dt;
     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 //]
     #endif //]
     
     
     // and store them back.
     // and store them back.

+ 1 - 1
panda/src/putil/config_util.cxx

@@ -35,7 +35,7 @@
 #include "mouseButton.h"
 #include "mouseButton.h"
 #include "get_config_path.h"
 #include "get_config_path.h"
 
 
-#include <dconfig.h>
+#include "dconfig.h"
 
 
 ConfigureDef(config_util);
 ConfigureDef(config_util);
 NotifyCategoryDef(util, "");
 NotifyCategoryDef(util, "");