Skip to content

Commit

Permalink
Merge pull request #65 from thbeu/apply-formatting
Browse files Browse the repository at this point in the history
Apply formatting
  • Loading branch information
rouault authored Nov 8, 2023
2 parents 7a0e253 + 399a76e commit fad7e6c
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 12 deletions.
71 changes: 71 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 1000000000
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never

---
Language: Json
BasedOnStyle: llvm
7 changes: 3 additions & 4 deletions contrib/csv2shp.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int str_to_ndecimals(const char *s)
return -1;
}

const char* decimalPoint = strchr(s, '.');
const char *decimalPoint = strchr(s, '.');
if ((decimalPoint == NULL) || (strchr(decimalPoint + 1, '.') != NULL))
{
return -1;
Expand Down Expand Up @@ -341,9 +341,8 @@ int main(int argc, char **argv)
{
n_longitude = x;
}
else
if (0 ==
STRCASECMP("Latitude", delimited_column(sbuffer, delimiter, x)))
else if (0 == STRCASECMP("Latitude",
delimited_column(sbuffer, delimiter, x)))
{
n_latitude = x;
}
Expand Down
3 changes: 2 additions & 1 deletion contrib/shpdxf.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ int main(int argc, char **argv)
char id[255];

// Proceed to process data.
for (int recNum = 0; (recNum < shp_numrec) && (recNum < (int)MaxElem); recNum++)
for (int recNum = 0; (recNum < shp_numrec) && (recNum < (int)MaxElem);
recNum++)
{
if (idfld >= 0)
switch (idfld_type)
Expand Down
13 changes: 8 additions & 5 deletions shapefil.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,15 @@ extern "C"
SHPHandle SHPAPI_CALL SHPOpen(const char *pszShapeFile,
const char *pszAccess);
SHPHandle SHPAPI_CALL SHPOpenLL(const char *pszShapeFile,
const char *pszAccess, const SAHooks *psHooks);
const char *pszAccess,
const SAHooks *psHooks);
SHPHandle SHPAPI_CALL SHPOpenLLEx(const char *pszShapeFile,
const char *pszAccess, const SAHooks *psHooks,
int bRestoreSHX);
const char *pszAccess,
const SAHooks *psHooks, int bRestoreSHX);

int SHPAPI_CALL SHPRestoreSHX(const char *pszShapeFile,
const char *pszAccess, const SAHooks *psHooks);
const char *pszAccess,
const SAHooks *psHooks);

/* If setting bFastMode = TRUE, the content of SHPReadObject() is owned by the SHPHandle. */
/* So you cannot have 2 valid instances of SHPReadObject() simultaneously. */
Expand Down Expand Up @@ -483,7 +485,8 @@ extern "C"
DBFHandle SHPAPI_CALL DBFOpen(const char *pszDBFFile,
const char *pszAccess);
DBFHandle SHPAPI_CALL DBFOpenLL(const char *pszDBFFile,
const char *pszAccess, const SAHooks *psHooks);
const char *pszAccess,
const SAHooks *psHooks);
DBFHandle SHPAPI_CALL DBFCreate(const char *pszDBFFile);
DBFHandle SHPAPI_CALL DBFCreateEx(const char *pszDBFFile,
const char *pszCodePage);
Expand Down
3 changes: 1 addition & 2 deletions shptree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,7 @@ int SHPAPI_CALL SHPWriteTree(SHPTree *tree, const char *filename)
/* SHPWriteTreeLL() */
/************************************************************************/

int SHPWriteTreeLL(SHPTree *tree, const char *filename,
const SAHooks *psHooks)
int SHPWriteTreeLL(SHPTree *tree, const char *filename, const SAHooks *psHooks)
{
char signature[4] = "SQT";
int i;
Expand Down

0 comments on commit fad7e6c

Please sign in to comment.