Skip to content

Commit 6edb487

Browse files
committed
clang-format
1 parent 37c58b1 commit 6edb487

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+343
-353
lines changed

demos/FFConsoleDemo/FFConsoleDemo.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,16 @@ class Variable
110110
return oss.str();
111111
}
112112

113-
virtual void update(){};
113+
virtual void update() {};
114114
};
115115

116116
class Constant : public Variable
117117
{
118118
public:
119119
Constant(double dInitValue) :
120-
Variable(dInitValue) {}
120+
Variable(dInitValue) { }
121121

122-
virtual void setValue(double dValue) {}
122+
virtual void setValue(double dValue) { }
123123
};
124124

125125
class LimitedVariable : public Variable
@@ -131,7 +131,7 @@ class LimitedVariable : public Variable
131131
public:
132132
LimitedVariable(double dInitValue, double dMinValue, double dMaxValue) :
133133
Variable(dInitValue), _dMinValue(dMinValue), _dMaxValue(dMaxValue)
134-
{}
134+
{ }
135135

136136
virtual void setValue(double dValue)
137137
{
@@ -158,7 +158,7 @@ class TriangleVariable : public LimitedVariable
158158

159159
public:
160160
TriangleVariable(double dInitValue, double dDeltaValue, double dMinValue, double dMaxValue) :
161-
LimitedVariable(dInitValue, dMinValue, dMaxValue), _dDeltaValue(dDeltaValue){};
161+
LimitedVariable(dInitValue, dMinValue, dMaxValue), _dDeltaValue(dDeltaValue) {};
162162

163163
virtual void update()
164164
{
@@ -207,7 +207,7 @@ class VariableEffect
207207
VariableEffect(const char* pszDesc, Effect* pEffect, const MapVariables& mapVars, const EffectVariablesApplier pfApplyVars) :
208208
_pszDesc(pszDesc), _pEffect(pEffect),
209209
_mapVariables(mapVars), _pfApplyVariables(pfApplyVars), _bActive(false)
210-
{}
210+
{ }
211211

212212
~VariableEffect()
213213
{
@@ -459,7 +459,7 @@ void forceVariableApplier(MapVariables& mapVars, Effect* pEffect)
459459
ConstantEffect* pConstForce = dynamic_cast<ConstantEffect*>(pEffect->getForceEffect());
460460
pConstForce->level = (int)dForce;
461461
pConstForce->envelope.attackLevel = (unsigned short)fabs(dForce * dAttackFactor);
462-
pConstForce->envelope.fadeLevel = (unsigned short)fabs(dForce); // Fade never reached, in fact.
462+
pConstForce->envelope.fadeLevel = (unsigned short)fabs(dForce); // Fade never reached, in fact.
463463
}
464464

465465
// Variable "Period" on an OIS::PeriodicEffect
@@ -535,17 +535,17 @@ class EffectManager
535535
// Linux2.6.22.9=Not supported
536536
pEffect = new Effect(Effect::ConstantForce, Effect::Constant);
537537
pEffect->direction = Effect::North;
538-
pEffect->trigger_button = 0;
538+
pEffect->trigger_button = 0;
539539
pEffect->trigger_interval = 0;
540-
pEffect->replay_length = Effect::OIS_INFINITE; // Linux/Win32: Same behaviour as 0.
541-
pEffect->replay_delay = 0;
540+
pEffect->replay_length = Effect::OIS_INFINITE; // Linux/Win32: Same behaviour as 0.
541+
pEffect->replay_delay = 0;
542542
pEffect->setNumAxes(1);
543543
pConstForce = dynamic_cast<ConstantEffect*>(pEffect->getForceEffect());
544544
pConstForce->level = 5000; //-10K to +10k
545545
pConstForce->envelope.attackLength = 0;
546546
pConstForce->envelope.attackLevel = (unsigned short)pConstForce->level;
547547
pConstForce->envelope.fadeLength = 0;
548-
pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level;
548+
pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level;
549549

550550
mapVars.clear();
551551
mapVars["Force"] = new TriangleVariable(0.0, // F0
@@ -568,17 +568,17 @@ class EffectManager
568568
// Linux2.6.22.9=Not supported.
569569
pEffect = new Effect(Effect::ConstantForce, Effect::Constant);
570570
pEffect->direction = Effect::North;
571-
pEffect->trigger_button = 0;
571+
pEffect->trigger_button = 0;
572572
pEffect->trigger_interval = 0;
573-
pEffect->replay_length = Effect::OIS_INFINITE; //(unsigned int)(1000000.0/_nUpdateFreq); // Linux: Does not work.
574-
pEffect->replay_delay = 0;
573+
pEffect->replay_length = Effect::OIS_INFINITE; //(unsigned int)(1000000.0/_nUpdateFreq); // Linux: Does not work.
574+
pEffect->replay_delay = 0;
575575
pEffect->setNumAxes(1);
576576
pConstForce = dynamic_cast<ConstantEffect*>(pEffect->getForceEffect());
577577
pConstForce->level = 5000; //-10K to +10k
578578
pConstForce->envelope.attackLength = (unsigned int)(1000000.0 / _nUpdateFreq / 2);
579579
pConstForce->envelope.attackLevel = (unsigned short)(pConstForce->level * 0.1);
580580
pConstForce->envelope.fadeLength = 0; // Never reached, actually.
581-
pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level; // Idem
581+
pConstForce->envelope.fadeLevel = (unsigned short)pConstForce->level; // Idem
582582

583583
mapVars.clear();
584584
mapVars["Force"] = new TriangleVariable(0.0, // F0
@@ -601,19 +601,19 @@ class EffectManager
601601
// Linux2.6.22.9=Failed.
602602
pEffect = new Effect(Effect::PeriodicForce, Effect::Triangle);
603603
pEffect->direction = Effect::North;
604-
pEffect->trigger_button = 0;
604+
pEffect->trigger_button = 0;
605605
pEffect->trigger_interval = 0;
606-
pEffect->replay_length = Effect::OIS_INFINITE;
607-
pEffect->replay_delay = 0;
606+
pEffect->replay_length = Effect::OIS_INFINITE;
607+
pEffect->replay_delay = 0;
608608
pEffect->setNumAxes(1);
609609
pPeriodForce = dynamic_cast<PeriodicEffect*>(pEffect->getForceEffect());
610610
pPeriodForce->magnitude = 10000; // 0 to +10k
611611
pPeriodForce->offset = 0;
612612
pPeriodForce->phase = 0; // 0 to 35599
613613
pPeriodForce->period = 10000; // Micro-seconds
614614
pPeriodForce->envelope.attackLength = 0;
615-
pPeriodForce->envelope.attackLevel = (unsigned short)pPeriodForce->magnitude;
616-
pPeriodForce->envelope.fadeLength = 0;
615+
pPeriodForce->envelope.attackLevel = (unsigned short)pPeriodForce->magnitude;
616+
pPeriodForce->envelope.fadeLength = 0;
617617
pPeriodForce->envelope.fadeLevel = (unsigned short)pPeriodForce->magnitude;
618618

619619
mapVars.clear();
@@ -657,7 +657,7 @@ class EffectManager
657657
for(size_t nEffInd = 0; nEffInd < _vecEffects.size(); nEffInd++)
658658
{
659659
const Effect::EForce eForce = _vecEffects[nEffInd]->getFFEffect()->force;
660-
const Effect::EType eType = _vecEffects[nEffInd]->getFFEffect()->type;
660+
const Effect::EType eType = _vecEffects[nEffInd]->getFFEffect()->type;
661661
if(_pJoystickMgr->getCurrentFFDevice()->supportsEffect(eForce, eType))
662662
{
663663
_vecPlayableEffectInd.push_back(nEffInd);
@@ -683,8 +683,8 @@ class EffectManager
683683
}
684684

685685
enum EWhichEffect { ePrevious = -1,
686-
eNone = 0,
687-
eNext = +1 };
686+
eNone = 0,
687+
eNext = +1 };
688688

689689
void selectEffect(EWhichEffect eWhich)
690690
{
@@ -799,17 +799,17 @@ class Application
799799
public:
800800
Application(int argc, const char* argv[])
801801
{
802-
_pInputMgr = nullptr;
803-
_pEventHdlr = nullptr;
804-
_pKeyboard = nullptr;
802+
_pInputMgr = nullptr;
803+
_pEventHdlr = nullptr;
804+
_pKeyboard = nullptr;
805805
_pJoystickMgr = nullptr;
806-
_pEffectMgr = nullptr;
806+
_pEffectMgr = nullptr;
807807

808808
#if defined OIS_WIN32_PLATFORM
809809
_hWnd = nullptr;
810810
#elif defined OIS_LINUX_PLATFORM
811811
_pXDisp = 0;
812-
_xWin = 0;
812+
_xWin = 0;
813813
#endif
814814

815815
_bMustStop = false;
@@ -1048,12 +1048,12 @@ class Application
10481048

10491049
EventHandler::EventHandler(Application* pApp) :
10501050
_pApplication(pApp)
1051-
{}
1051+
{ }
10521052

10531053
void EventHandler::initialize(JoystickManager* pJoystickMgr, EffectManager* pEffectMgr)
10541054
{
10551055
_pJoystickMgr = pJoystickMgr;
1056-
_pEffectMgr = pEffectMgr;
1056+
_pEffectMgr = pEffectMgr;
10571057
}
10581058

10591059
bool EventHandler::keyPressed(const KeyEvent& arg)

demos/OISConsoleDemo/OISConsole.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ bool appRunning = true; //Global Exit Flag
7575

7676
const char* g_DeviceType[6] = { "OISUnknown", "OISKeyboard", "OISMouse", "OISJoyStick", "OISTablet", "OISOther" };
7777

78-
InputManager* g_InputManager = nullptr; //Our Input System
79-
Keyboard* g_kb = nullptr; //Keyboard Device
80-
Mouse* g_m = nullptr; //Mouse Device
78+
InputManager* g_InputManager = nullptr; //Our Input System
79+
Keyboard* g_kb = nullptr; //Keyboard Device
80+
Mouse* g_m = nullptr; //Mouse Device
8181
JoyStick* g_joys[4] = { nullptr, nullptr, nullptr, nullptr }; //This demo supports up to 4 controllers
8282

8383
//-- OS Specific Globals --//
8484
#if defined OIS_WIN32_PLATFORM
8585
HWND hWnd = nullptr;
8686
#elif defined OIS_LINUX_PLATFORM
8787
Display* xDisp = 0;
88-
Window xWin = 0;
88+
Window xWin = 0;
8989
#elif defined OIS_APPLE_PLATFORM
9090
WindowRef mWin = 0;
9191
#endif
@@ -94,8 +94,8 @@ WindowRef mWin = 0;
9494
class EventHandler : public KeyListener, public MouseListener, public JoyStickListener
9595
{
9696
public:
97-
EventHandler() {}
98-
~EventHandler() {}
97+
EventHandler() { }
98+
~EventHandler() { }
9999
bool keyPressed(const KeyEvent& arg)
100100
{
101101
std::cout << " KeyPressed {" << std::hex << arg.key << std::dec
@@ -163,7 +163,7 @@ class EventHandler : public KeyListener, public MouseListener, public JoyStickLi
163163
bool sliderMoved(const JoyStickEvent& arg, int index)
164164
{
165165
std::cout << std::endl
166-
<< arg.device->vendor() << ". Slider # " << index
166+
<< arg.device->vendor() << ". Slider # " << index
167167
<< " X Value: " << arg.state.mSliders[index].abX
168168
<< " Y Value: " << arg.state.mSliders[index].abY;
169169
return true;
@@ -344,7 +344,7 @@ void doStartup()
344344
[NSAutoreleasePool new];
345345
[NSApplication sharedApplication];
346346
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
347-
id menubar = [[NSMenu new] autorelease];
347+
id menubar = [[NSMenu new] autorelease];
348348
id appMenuItem = [[NSMenuItem new] autorelease];
349349
[menubar addItem:appMenuItem];
350350
[NSApp setMainMenu:menubar];

includes/OISEffect.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ namespace OIS
6767
enum EType {
6868
//Type ----- Pairs with force:
6969
Unknown = 0, //UnknownForce
70-
Constant, //ConstantForce
70+
Constant, //ConstantForce
7171
Ramp, //RampForce
7272
Square, //PeriodicForce
73-
Triangle, //PeriodicForce
73+
Triangle, //PeriodicForce
7474
Sine, //PeriodicForce
75-
SawToothUp, //PeriodicForce
75+
SawToothUp, //PeriodicForce
7676
SawToothDown, //PeriodicForce
77-
Friction, //ConditionalForce
77+
Friction, //ConditionalForce
7878
Damper, //ConditionalForce
7979
Inertia, //ConditionalForce
8080
Spring, //ConditionalForce
@@ -170,7 +170,7 @@ namespace OIS
170170
class _OISExport ForceEffect
171171
{
172172
public:
173-
virtual ~ForceEffect() {}
173+
virtual ~ForceEffect() { }
174174
};
175175

176176
//-----------------------------------------------------------------------------//
@@ -183,7 +183,7 @@ namespace OIS
183183
{
184184
public:
185185
Envelope() :
186-
attackLength(0), attackLevel(0), fadeLength(0), fadeLevel(0) {}
186+
attackLength(0), attackLevel(0), fadeLength(0), fadeLevel(0) { }
187187
#if defined(OIS_MSVC_COMPILER)
188188
#pragma warning(push)
189189
#pragma warning(disable : 4800)
@@ -219,9 +219,9 @@ namespace OIS
219219
{
220220
public:
221221
ConstantEffect() :
222-
level(5000) {}
222+
level(5000) { }
223223

224-
Envelope envelope; //Optional envolope
224+
Envelope envelope; //Optional envolope
225225
signed short level; //-10K to +10k
226226
};
227227

@@ -233,11 +233,11 @@ namespace OIS
233233
{
234234
public:
235235
RampEffect() :
236-
startLevel(0), endLevel(0) {}
236+
startLevel(0), endLevel(0) { }
237237

238238
Envelope envelope; //Optional envelope
239239
signed short startLevel; //-10K to +10k
240-
signed short endLevel; //-10K to +10k
240+
signed short endLevel; //-10K to +10k
241241
};
242242

243243
//-----------------------------------------------------------------------------//
@@ -248,7 +248,7 @@ namespace OIS
248248
{
249249
public:
250250
PeriodicEffect() :
251-
magnitude(0), offset(0), phase(0), period(0) {}
251+
magnitude(0), offset(0), phase(0), period(0) { }
252252

253253
Envelope envelope; //Optional Envelope
254254

@@ -267,13 +267,13 @@ namespace OIS
267267
public:
268268
ConditionalEffect() :
269269
rightCoeff(0), leftCoeff(0), rightSaturation(0), leftSaturation(0),
270-
deadband(0), center(0) {}
270+
deadband(0), center(0) { }
271271

272272
signed short rightCoeff; //-10k to +10k (Positive Coeff)
273-
signed short leftCoeff; //-10k to +10k (Negative Coeff)
273+
signed short leftCoeff; //-10k to +10k (Negative Coeff)
274274

275275
unsigned short rightSaturation; //0 to 10k (Pos Saturation)
276-
unsigned short leftSaturation; //0 to 10k (Neg Saturation)
276+
unsigned short leftSaturation; //0 to 10k (Neg Saturation)
277277

278278
//Region around center in which the condition is not active, in the range
279279
//from 0 through 10,000

includes/OISEvents.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ namespace OIS
3636
{
3737
public:
3838
explicit EventArg(Object* obj) :
39-
device(obj) {}
40-
virtual ~EventArg() {}
39+
device(obj) { }
40+
virtual ~EventArg() { }
4141

4242
//! Pointer to the Input Device
4343
const Object* device;

includes/OISException.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ namespace OIS
6060
public:
6161
//! Creates exception object
6262
Exception(OIS_ERROR err, const char* str, int line, const char* file) :
63-
eType(err), eLine(line), eFile(file), eText(str) {}
63+
eType(err), eLine(line), eFile(file), eText(str) { }
6464

6565
Exception(const Exception& other) :
66-
eType(other.eType), eLine(other.eLine), eFile(other.eFile), eText(other.eText) {}
66+
eType(other.eType), eLine(other.eLine), eFile(other.eFile), eText(other.eText) { }
6767

68-
~Exception() throw() {}
68+
~Exception() throw() { }
6969

7070
virtual const char* what() const throw();
7171

includes/OISFactoryCreator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace OIS
4040
/**
4141
@remarks Virtual Destructor
4242
*/
43-
virtual ~FactoryCreator(){};
43+
virtual ~FactoryCreator() {};
4444

4545
/**
4646
@remarks Return a list of all unused devices the factory maintains

includes/OISForceFeedback.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace OIS
3939
{
4040
public:
4141
ForceFeedback();
42-
virtual ~ForceFeedback() {}
42+
virtual ~ForceFeedback() { }
4343

4444
/**
4545
@remarks

includes/OISInputManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ namespace OIS
155155

156156
//! All generic devices OIS supports internally (if they are compiled in)
157157
enum AddOnFactories {
158-
AddOn_All = 0, //All Devices
159-
AddOn_LIRC = 1, //PC Linux Infrared Remote Control
158+
AddOn_All = 0, //All Devices
159+
AddOn_LIRC = 1, //PC Linux Infrared Remote Control
160160
AddOn_WiiMote = 2 //PC WiiMote Support
161161
};
162162

includes/OISInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace OIS
3737
class _OISExport Interface
3838
{
3939
public:
40-
virtual ~Interface(){};
40+
virtual ~Interface() {};
4141

4242
//! Type of Interface
4343
enum IType {

0 commit comments

Comments
 (0)