Skip to content

Commit

Permalink
Merge pull request #651 from Mellanox/master_devel
Browse files Browse the repository at this point in the history
Master devel
  • Loading branch information
tomer540 authored Jul 31, 2022
2 parents 346d949 + f2fb227 commit d354465
Show file tree
Hide file tree
Showing 483 changed files with 100,522 additions and 99,515 deletions.
77 changes: 77 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
# BasedOnStyle: Google
AccessModifierOffset: -4
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
ConstructorInitializerIndentWidth: 4
ConstructorInitializerAllOnOneLineOrOnePerLine: true
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakConstructorInitializersBeforeComma: false
BinPackParameters: false
Standard: Auto
IndentWidth: 4
TabWidth: 8
UseTab: Never
BraceWrapping:
AfterClass: false
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: true
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
CommentPragmas: '^ ignore_styling:'
ColumnLimit: 200
DerivePointerBinding: true
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: true
IndentCaseLabels: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 60
PenaltyBreakString: 60
PenaltyBreakFirstLessLess: 60
PenaltyExcessCharacter: 60
PenaltyReturnTypeOnItsOwnLine: 60
PointerBindsToType: true
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: true
BreakBeforeBraces: Allman
IndentFunctionDeclarationAfterType: true
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 2
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterTemplateKeyword: false
SpacesInContainerLiterals: false
AllowShortFunctionsOnASingleLine: Inline
BreakStringLiterals: false
...

1 change: 0 additions & 1 deletion adb_parser/adb_common_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
* Version: $Id$
*/


indentString(int)
28 changes: 16 additions & 12 deletions adb_parser/adb_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,42 @@
#include "adb_config.h"
#include <iostream>

void AdbConfig::print(int indent) {
void AdbConfig::print(int indent)
{
cout << indentString(indent) << "Attributes:" << endl;
AttrsMap::iterator iter;
for (iter = attrs.begin(); iter != attrs.end(); iter++)
cout << indentString(indent + 1) << iter->first << " - "
<< iter->second << endl;
cout << indentString(indent + 1) << iter->first << " - " << iter->second << endl;

cout << indentString(indent) << "Enums:" << endl;
for (iter = enums.begin(); iter != enums.end(); iter++)
cout << indentString(indent + 1) << iter->first << " - "
<< iter->second << endl;
cout << indentString(indent + 1) << iter->first << " - " << iter->second << endl;
}

/**
* Function: AdbConfig::toXml
**/
string AdbConfig::toXml() {
string AdbConfig::toXml()
{
string xml = "<config ";

for (AttrsMap::iterator it = attrs.begin(); it != attrs.end(); it++) {
for (AttrsMap::iterator it = attrs.begin(); it != attrs.end(); it++)
{
xml += " " + it->first + "=\"" + encodeXml(it->second) + "\"";
}

if (!enums.empty()) {
if (!enums.empty())
{
xml += " >\n";

for (AttrsMap::iterator it = enums.begin(); it != enums.end(); it++) {
xml += "\t<enum name=\"" + encodeXml(it->first) + "\" value=\""
+ encodeXml(it->second) + "\" />\n";
for (AttrsMap::iterator it = enums.begin(); it != enums.end(); it++)
{
xml += "\t<enum name=\"" + encodeXml(it->first) + "\" value=\"" + encodeXml(it->second) + "\" />\n";
}
xml += "</config>";
} else {
}
else
{
xml += " />";
}

Expand Down
3 changes: 2 additions & 1 deletion adb_parser/adb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ using namespace std;

typedef map<string, string> AttrsMap;

class AdbConfig {
class AdbConfig
{
public:
// FOR DEBUG
void print(int indent = 0);
Expand Down
Loading

0 comments on commit d354465

Please sign in to comment.