formatting changes.

This commit is contained in:
Dave Schuyler 2003-09-23 01:41:20 +00:00
parent 0b4d42f01c
commit f37d7a2179
12 changed files with 77 additions and 89 deletions

View File

@ -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;
}

View File

@ -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<ConfigString> 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") {

View File

@ -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"

View File

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

View File

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

View File

@ -19,7 +19,7 @@
#ifndef __EXPAND_H__
#define __EXPAND_H__
#include <dtoolbase.h>
#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();
};

View File

@ -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;

View File

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

View File

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

View File

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

View File

@ -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.

View File

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