Skip to content

Commit

Permalink
first commit to org repo
Browse files Browse the repository at this point in the history
  • Loading branch information
WanHaoRan committed Feb 9, 2024
0 parents commit 7777dc0
Show file tree
Hide file tree
Showing 1,823 changed files with 1,049,829 additions and 0 deletions.
112 changes: 112 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true #Changed
AlignConsecutiveDeclarations: true #Changed
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false # Changed
#AllowAllArgumentsOnNextLine: false # Changed
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline #Changed
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true #Changed
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true #Changed
AfterControlStatement: false
AfterEnum: false
AfterFunction: true #Changed
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: false #Changed
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom #Changed
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon #Changed
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120 #Changed
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true #Changed
ConstructorInitializerIndentWidth: 2 #Changed
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true #Changed
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left #Changed
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03 #Changed
TabWidth: 8
UseTab: Never
...

38 changes: 38 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# All Clang-Tidy Checks allowed, except:
# - forbidden vararg
# - forbidden magic numbers
# - forbidden namespace "using"
# - forbidden array->pointer decay
# - init of static memory may cause an exception (cert-err58)
# - forbidden implicit conversion from pointer/int to bool
# - recommended auto
# - remove llvm-specific checks (header guard style, usage of llvm namespace, restriction of libc includes, etc.)
# Naming conventions set to snake_case
Checks: '*,-fuchsia-*,
-cppcoreguidelines-pro-type-vararg,-hicpp-vararg,
-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-static-cast-downcast,
-modernize-use-using,-modernize-use-trailing-return-type,
-modernize-use-auto,-hicpp-use-auto,
-llvmlibc-callee-namespace,-llvmlibc-implementation-in-namespace,-llvmlibc-restrict-system-libc-headers,
-llvm-header-guard,
-google-runtime-references,-google-readability-casting,-google-build-using-namespace,
google-default-arguments,-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cert-err58-cpp,
-altera-unroll-loops,
-readability-function-cognitive-complexity,-readability-isolate-declaration,
-misc-non-private-member-variables-in-classes,-altera-struct-pack-align,-readability-uppercase-literal-suffix,
-cppcoreguidelines-non-private-member-variables-in-classes,
readability-identifier-naming'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readibility-identifier-naming.ClassCase, value: lower_case }
- { key: readibility-identifier-naming.StructCase, value: lower_case }
- { key: readibility-identifier-naming.VariableCase, value: lower_case }

42 changes: 42 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright 2013-2020 Software Radio Systems Limited
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the distribution.
#

############################################
# Pretty-Printers
############################################

python

###### srsran::bounded_vector<T, N> ########

class BoundedVectorPrinter(object):
def __init__(self, val):
self.val = val
self.value_type = self.val.type.template_argument(0)

def children(self):
start = self.val['buffer']['_M_elems'].cast(self.value_type.pointer())
length = int(self.val['size_'])
for idx in range(length):
yield f'[{idx}]', start[idx]

def to_string(self):
length = int(self.val['size_'])
capacity = int(self.val.type.template_argument(1))
return f'bounded_vector of length {length}, capacity {capacity}'

def display_hint(self):
return 'array'

def make_bounded_vector(val):
if 'bounded_vector<' in str(val.type):
return BoundedVectorPrinter(val)

gdb.pretty_printers.append(make_bounded_vector)

end
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# [submodule "moonlight-common-c"]
# path = moonlight-common-c
# url = https://github.com/moonlight-stream/moonlight-common-c.git
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
83 changes: 83 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"files.associations": {
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"strstream": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"coroutine": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"source_location": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"semaphore": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp",
"*.ipp": "cpp",
"ue_dl_nr.h": "c",
"cassert": "cpp"
}
}
Loading

0 comments on commit 7777dc0

Please sign in to comment.