Skip to content

Commit

Permalink
Multiple files: correct spelling
Browse files Browse the repository at this point in the history
activate codespell on the repo
  • Loading branch information
mkmer committed Jan 21, 2025
1 parent e4dee90 commit 01961ca
Show file tree
Hide file tree
Showing 30 changed files with 300 additions and 83 deletions.
191 changes: 191 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
---
#BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Linux
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 200
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: BinPack
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Right
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: false
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: true
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

3 changes: 3 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exten
lond
writen
23 changes: 23 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: C/C++ CI - Pre-commit checks

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
skip: "./include, ./configs"
ignore_words_file: .codespellignore
# When using this Action in other repos, the --skip option below can be removed

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ If you want to manually install app_rpt et al., here is how:

### Compiling

First, detection of the ALSA library needs to be readded to the build system, by applying the following patch: https://github.com/InterLinked1/phreakscript/blob/master/patches/alsa.diff
First, detection of the ALSA library needs to be read to the build system, by applying the following patch: https://github.com/InterLinked1/phreakscript/blob/master/patches/alsa.diff

Then, add this near the bottom of `apps/Makefile`:

Expand Down
2 changes: 1 addition & 1 deletion apps/app_gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static int sockfd = -1;
* str - delimited string ( will be modified )
* strp- list of pointers to substrings (this is built by this function), NULL will be placed at end of list
* limit- maximum number of substrings to process
* delim- user specified delimeter
* delim- user specified delimiter
* quote- user specified quote for escaping a substring. Set to zero to escape nothing.
*
* Note: This modifies the string str, be suer to save an intact copy if you need it later.
Expand Down
28 changes: 14 additions & 14 deletions apps/app_rpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@
* if type is 'E' (for "evaluate statement" (or perhaps "equals") ) then the var-spec is a full statement containing
* expressions, variables and operators per the expression evaluation built into Asterisk.
* if type is 'T' (for "going True"), var-spec is a single (already-defined) variable name, and the result will be 1
* if the varible has just gone from 0 to 1.
* if the variable has just gone from 0 to 1.
* if type is 'F' (for "going False"), var-spec is a single (already-defined) variable name, and the result will be 1
* if the varible has just gone from 1 to 0.
* if the variable has just gone from 1 to 0.
* if type is 'N' (for "no change"), var-spec is a single (already-defined) variable name, and the result will be 1
* if the varible has not changed.
* if the variable has not changed.
*
* "RANGER" mode configuration:
* in the node stanza in rpt.conf ONLY the following need be specified for a RANGER node:
Expand All @@ -265,7 +265,7 @@
* litzcmd=*32008
*
* This example given would be for node "90101" (note ALL RANGER nodes MUST begin with '9'.
* litzcmd specifes the function that LiTZ inititiates to cause a connection
* litzcmd specifies the function that LiTZ inititiates to cause a connection
* "rangerfunctions" in this example, is a function stanza that AT LEAST has the *3 command
* to connect to another node
*
Expand Down Expand Up @@ -379,7 +379,7 @@
</option>
<option name="D">
<para>Dumb Phone Control mode. This allows a regular phone user to have full control and audio access to the radio system. In this
mode, the PTT is activated for the entire length of the call. For the user to have DTMF control (not generally recomended in
mode, the PTT is activated for the entire length of the call. For the user to have DTMF control (not generally recommended in
this mode), the 'dphone_functions' parameter must be specified for the node in 'rpt.conf'. Otherwise no DTMF control will be
available to the phone user.</para>
</option>
Expand Down Expand Up @@ -809,7 +809,7 @@ void rpt_event_process(struct rpt *myrpt)
if (var1 && (varp == var1p))
cmd = (char *) v->name;
break;
case 'I': /* if didnt exist (initial state) */
case 'I': /* if didn't exist (initial state) */
if (!var1)
cmd = (char *) v->name;
break;
Expand All @@ -835,7 +835,7 @@ void rpt_event_process(struct rpt *myrpt)
if (!cmd) {
continue;
}
if (action == 'F') { /* excecute a function */
if (action == 'F') { /* execute a function */
rpt_mutex_lock(&myrpt->lock);
if ((MAXMACRO - strlen(myrpt->macrobuf)) >= strlen(cmd)) {
ast_verb(3, "Event on node %s doing macro %s for condition %s\n", myrpt->name, cmd, v->value);
Expand All @@ -845,7 +845,7 @@ void rpt_event_process(struct rpt *myrpt)
ast_log(LOG_WARNING, "Could not execute event %s for %s: Macro buffer overflow\n", cmd, argv[1]);
}
rpt_mutex_unlock(&myrpt->lock);
} else if (action == 'C') { /* excecute a command */
} else if (action == 'C') { /* execute a command */
/* make a local copy of the value of this entry */
myval = ast_strdupa(cmd);
/* separate out specification into comma-delimited fields */
Expand Down Expand Up @@ -887,7 +887,7 @@ void rpt_event_process(struct rpt *myrpt)
ast_log(LOG_WARNING, "Could not execute event %s for %s: Command buffer in use\n", cmd, argv[1]);
}
rpt_mutex_unlock(&myrpt->lock);
} else if (action == 'S') { /* excecute a shell command */
} else if (action == 'S') { /* execute a shell command */
char *cp;

ast_verb(3, "Event on node %s doing shell command %s for condition %s\n", myrpt->name, cmd, v->value);
Expand Down Expand Up @@ -1616,7 +1616,7 @@ static inline void handle_callmode_1(struct rpt *myrpt, char c)
rpt_telemetry(myrpt, PROC, NULL);
rpt_mutex_lock(&myrpt->lock);
}
} else { /* othewise, reset timer */
} else { /* otherwise, reset timer */
myrpt->calldigittimer = 1;
}
}
Expand Down Expand Up @@ -1706,7 +1706,7 @@ static void handle_link_data(struct rpt *myrpt, struct rpt_link *mylink, char *s
strcpy(mylink->linklist, tmp + 2);
time(&mylink->linklistreceived);
rpt_mutex_unlock(&myrpt->lock);
ast_debug(7, "@@@@ node %s recieved node list %s from node %s\n", myrpt->name, tmp, mylink->name);
ast_debug(7, "@@@@ node %s received node list %s from node %s\n", myrpt->name, tmp, mylink->name);
return;
}
if (tmp[0] == 'M') {
Expand Down Expand Up @@ -2458,7 +2458,7 @@ static void local_dtmf_helper(struct rpt *myrpt, char c_in)
if (!myrpt->patchquiet)
rpt_telemetry(myrpt, PROC, NULL);
return;
} else { /* othewise, reset timer */
} else { /* otherwise, reset timer */
myrpt->calldigittimer = 1;
}
}
Expand Down Expand Up @@ -3066,7 +3066,7 @@ static inline void periodic_process_links(struct rpt *myrpt, const int elap)
* side should consider either side "keyed" and transmitting... but as I explain below, the lack of sending/receiving
* this can actually lead to a node being improperly keyed).
*
* Ordinarily, the called node will call the send_newkey function (XXX twice, it seems, one of these may be superflous)
* Ordinarily, the called node will call the send_newkey function (XXX twice, it seems, one of these may be superfluous)
* The calling node calls this function once. What this function does is send the text frame NEWKEY1STR to the other side.
* Issue #46 was concerned with a case where this was slightly broken, and the below happened:
* (A = calling node, B = called node)
Expand Down Expand Up @@ -5800,7 +5800,7 @@ static void *rpt_master(void *ignore)
continue;
}
if (rpt_vars[i].outstreamlasterror && time(NULL) < rpt_vars[i].outstreamlasterror + 1) {
/* Command exited immediately. It probably doesn't work, no point in continously
/* Command exited immediately. It probably doesn't work, no point in continuously
* restarting it in a loop. */
ast_log(LOG_ERROR, "outstreamcmd '%s' appears to be broken, disabling\n", rpt_vars[i].p.outstreamcmd);
rpt_vars[i].p.outstreamcmd = NULL;
Expand Down
2 changes: 1 addition & 1 deletion apps/app_rpt/rpt_bridging.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ int __rpt_request(void *data, struct ast_format_cap *cap, enum rpt_chan_type cha
* rpt_mutex_lock(&myrpt->lock);
* afterwards,
* if flags & RPT_LINK_CHAN.
* This might not be necessary, but if it is, this should be readded. */
* This might not be necessary, but if it is, this should be read. */

rpt_make_call(chan, device, RPT_DIAL_TIME, tech, rpt_chan_app(chantype, flags), rpt_chan_app_data(chantype), myrpt->name);
if (ast_channel_state(chan) != AST_STATE_UP) {
Expand Down
2 changes: 1 addition & 1 deletion apps/app_rpt/rpt_bridging.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int dahdi_write_wait(struct ast_channel *chan);
int dahdi_flush(struct ast_channel *chan);

/*!
* \brief Increase buffer space on DAHDI channel, if needed to accomodate samples
* \brief Increase buffer space on DAHDI channel, if needed to accommodate samples
* \note Only use with DAHDI channels!
* \param chan
* \param samples
Expand Down
4 changes: 2 additions & 2 deletions apps/app_rpt/rpt_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int wait_interval(struct rpt *myrpt, int type, struct ast_channel *chan)
return -1;
}
ast_debug(1, "Delay complete\n");
/* This is not superflous... it's checking the same condition, but it might have gone true again after we exited the first loop, so check. */
/* This is not superfluous... it's checking the same condition, but it might have gone true again after we exited the first loop, so check. */
} while (myrpt->p.holdofftelem && (myrpt->keyed || (myrpt->remrx && (type != DLY_ID))));
return 0;
}
Expand Down Expand Up @@ -339,7 +339,7 @@ int send_morse(struct ast_channel *chan, char *string, int speed, int freq, int

dottime = 900 / speed;

/* Establish timing releationships */
/* Establish timing relationships */

dashtime = dottime * 3;
intralettertime = dottime;
Expand Down
Loading

0 comments on commit 01961ca

Please sign in to comment.