Skip to content

Commit c3ef294

Browse files
committed
projects tidy
1 parent 4a0b950 commit c3ef294

File tree

662 files changed

+147839
-48610
lines changed

Some content is hidden

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

662 files changed

+147839
-48610
lines changed

.clang-format

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Microsoft
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: None
7+
AlignConsecutiveAssignments: None
8+
AlignConsecutiveBitFields: None
9+
AlignConsecutiveDeclarations: None
10+
AlignEscapedNewlines: Right
11+
AlignOperands: Align
12+
AlignTrailingComments: true
13+
AllowAllArgumentsOnNextLine: true
14+
AllowAllConstructorInitializersOnNextLine: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortEnumsOnASingleLine: false
17+
AllowShortBlocksOnASingleLine: Never
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: None
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortIfStatementsOnASingleLine: Never
22+
AllowShortLoopsOnASingleLine: false
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: false
26+
AlwaysBreakTemplateDeclarations: Yes
27+
AttributeMacros:
28+
- __capability
29+
BinPackArguments: true
30+
BinPackParameters: true
31+
BraceWrapping:
32+
AfterCaseLabel: true
33+
AfterClass: true
34+
AfterControlStatement: Always
35+
AfterEnum: true
36+
AfterFunction: true
37+
AfterNamespace: true
38+
AfterObjCDeclaration: true
39+
AfterStruct: true
40+
AfterUnion: true
41+
AfterExternBlock: true
42+
BeforeCatch: true
43+
BeforeElse: true
44+
BeforeLambdaBody: false
45+
BeforeWhile: false
46+
IndentBraces: false
47+
SplitEmptyFunction: true
48+
SplitEmptyRecord: true
49+
SplitEmptyNamespace: true
50+
BreakBeforeBinaryOperators: None
51+
BreakBeforeConceptDeclarations: true
52+
BreakBeforeBraces: Custom
53+
BreakBeforeInheritanceComma: false
54+
BreakInheritanceList: BeforeColon
55+
BreakBeforeTernaryOperators: true
56+
BreakConstructorInitializersBeforeComma: false
57+
BreakConstructorInitializers: BeforeColon
58+
BreakAfterJavaFieldAnnotations: false
59+
BreakStringLiterals: true
60+
ColumnLimit: 160
61+
CommentPragmas: '^ IWYU pragma:'
62+
CompactNamespaces: false
63+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
64+
ConstructorInitializerIndentWidth: 4
65+
ContinuationIndentWidth: 4
66+
Cpp11BracedListStyle: true
67+
DeriveLineEnding: true
68+
DerivePointerAlignment: false
69+
DisableFormat: false
70+
EmptyLineBeforeAccessModifier: LogicalBlock
71+
ExperimentalAutoDetectBinPacking: false
72+
FixNamespaceComments: true
73+
ForEachMacros:
74+
- foreach
75+
- Q_FOREACH
76+
- BOOST_FOREACH
77+
StatementAttributeLikeMacros:
78+
- Q_EMIT
79+
IncludeBlocks: Preserve
80+
IncludeCategories:
81+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
82+
Priority: 2
83+
SortPriority: 0
84+
CaseSensitive: false
85+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
86+
Priority: 3
87+
SortPriority: 0
88+
CaseSensitive: false
89+
- Regex: '.*'
90+
Priority: 1
91+
SortPriority: 0
92+
CaseSensitive: false
93+
IncludeIsMainRegex: '(Test)?$'
94+
IncludeIsMainSourceRegex: ''
95+
IndentCaseLabels: true
96+
IndentCaseBlocks: false
97+
IndentGotoLabels: true
98+
IndentPPDirectives: None
99+
IndentExternBlock: AfterExternBlock
100+
IndentRequires: false
101+
IndentWidth: 4
102+
IndentWrappedFunctionNames: false
103+
InsertTrailingCommas: None
104+
JavaScriptQuotes: Leave
105+
JavaScriptWrapImports: true
106+
KeepEmptyLinesAtTheStartOfBlocks: true
107+
MacroBlockBegin: '^BEGIN_MSG_MAP*|^BEGIN_DLGRESIZE_MAP*|^BEGIN_MSG_DISP*|^BEGIN_DECL_MSG*'
108+
MacroBlockEnd: '^END_MSG_MAP*|^END_DLGRESIZE_MAP*|^END_MSG_DISP*|^END_DECL_MSG*'
109+
MaxEmptyLinesToKeep: 1
110+
NamespaceIndentation: None
111+
ObjCBinPackProtocolList: Auto
112+
ObjCBlockIndentWidth: 2
113+
ObjCBreakBeforeNestedBlockParam: true
114+
ObjCSpaceAfterProperty: false
115+
ObjCSpaceBeforeProtocolList: true
116+
PenaltyBreakAssignment: 2
117+
PenaltyBreakBeforeFirstCallParameter: 19
118+
PenaltyBreakComment: 300
119+
PenaltyBreakFirstLessLess: 120
120+
PenaltyBreakString: 1000
121+
PenaltyBreakTemplateDeclaration: 10
122+
PenaltyExcessCharacter: 1000000
123+
PenaltyReturnTypeOnItsOwnLine: 1000
124+
PenaltyIndentedWhitespace: 0
125+
PointerAlignment: Left
126+
ReflowComments: true
127+
SortIncludes: false
128+
SortJavaStaticImport: Before
129+
SortUsingDeclarations: true
130+
SpaceAfterCStyleCast: false
131+
SpaceAfterLogicalNot: false
132+
SpaceAfterTemplateKeyword: true
133+
SpaceBeforeAssignmentOperators: true
134+
SpaceBeforeCaseColon: false
135+
SpaceBeforeCpp11BracedList: false
136+
SpaceBeforeCtorInitializerColon: true
137+
SpaceBeforeInheritanceColon: true
138+
SpaceBeforeParens: ControlStatements
139+
SpaceAroundPointerQualifiers: Default
140+
SpaceBeforeRangeBasedForLoopColon: true
141+
SpaceInEmptyBlock: false
142+
SpaceInEmptyParentheses: false
143+
SpacesBeforeTrailingComments: 1
144+
SpacesInAngles: false
145+
SpacesInConditionalStatement: false
146+
SpacesInContainerLiterals: true
147+
SpacesInCStyleCastParentheses: false
148+
SpacesInParentheses: false
149+
SpacesInSquareBrackets: false
150+
SpaceBeforeSquareBrackets: false
151+
BitFieldColonSpacing: Both
152+
Standard: Latest
153+
StatementMacros:
154+
- Q_UNUSED
155+
- QT_REQUIRE_VERSION
156+
TabWidth: 4
157+
UseCRLF: true
158+
UseTab: Never
159+
WhitespaceSensitiveMacros:
160+
- STRINGIZE
161+
- PP_STRINGIZE
162+
- BOOST_PP_STRINGIZE
163+
- NS_SWIFT_NAME
164+
- CF_SWIFT_NAME
165+
...
166+

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitignore

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,9 @@
1-
Thumbs.db
2-
*.obj
3-
*.exe
4-
*.pdb
5-
*.user
6-
*.aps
7-
*.pch
8-
*.vspscc
9-
*_i.c
10-
*_p.c
11-
*.ncb
121
*.suo
13-
*.sln.docstates
14-
*.tlb
15-
*.tlh
16-
*.bak
17-
*.cache
18-
*.ilk
19-
*.log
20-
*.idl
21-
[Bb]in
22-
[Dd]ebug*/
23-
[Tt]emp
24-
*.lib
25-
*.sbr
26-
obj/
27-
[Rr]elease*/
28-
_ReSharper*/
29-
[Tt]est[Rr]esult*
30-
*.vssscc
31-
$tf*/
2+
*.user
3+
[Bb]in/
4+
[Tt]emp/
325
.vs/
6+
ipch/
7+
*.aps
8+
*.plog
9+
JSON/
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#include "foobar2000-sdk-pch.h"
2+
3+
#include "abort_callback.h"
4+
5+
void abort_callback::check() const {
6+
if (is_aborting()) {
7+
throw exception_aborted();
8+
}
9+
}
10+
11+
void abort_callback::sleep(double p_timeout_seconds) const {
12+
if (!sleep_ex(p_timeout_seconds)) {
13+
throw exception_aborted();
14+
}
15+
}
16+
17+
bool abort_callback::sleep_ex(double p_timeout_seconds) const {
18+
// return true IF NOT SET (timeout), false if set
19+
return !pfc::event::g_wait_for(get_abort_event(),p_timeout_seconds);
20+
}
21+
22+
bool abort_callback::waitForEvent( pfc::eventHandle_t evtHandle, double timeOut ) {
23+
int status = pfc::event::g_twoEventWait( this->get_abort_event(), evtHandle, timeOut );
24+
switch(status) {
25+
case 1: throw exception_aborted();
26+
case 2: return true;
27+
case 0: return false;
28+
default: uBugCheck();
29+
}
30+
}
31+
32+
bool abort_callback_usehandle::is_aborting() const {
33+
return pfc::event::g_wait_for( get_abort_event(), 0 );
34+
}
35+
36+
bool abort_callback::waitForEvent(pfc::event& evt, double timeOut) {
37+
return waitForEvent(evt.get_handle(), timeOut);
38+
}
39+
40+
void abort_callback::waitForEvent(pfc::eventHandle_t evtHandle) {
41+
bool status = waitForEvent(evtHandle, -1); (void)status;
42+
PFC_ASSERT(status); // should never return false
43+
}
44+
45+
void abort_callback::waitForEvent(pfc::event& evt) {
46+
bool status = waitForEvent(evt, -1); (void)status;
47+
PFC_ASSERT(status); // should never return false
48+
}
49+
50+
namespace fb2k {
51+
abort_callback_dummy noAbort;
52+
}

0 commit comments

Comments
 (0)