Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pete
firmware
Commits
781bfe50
Commit
781bfe50
authored
5 years ago
by
dx
Committed by
schneider
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
style(config): minor variable/constant name changes
In preparation for next commit
parent
a7f4e247
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/modules/config.c
+16
-16
16 additions, 16 deletions
epicardium/modules/config.c
with
16 additions
and
16 deletions
epicardium/modules/config.c
+
16
−
16
View file @
781bfe50
...
...
@@ -9,7 +9,7 @@
#include
<stdlib.h>
#include
<unistd.h>
#define
CONFIG_
MAX_LINE_LENGTH 80
#define MAX_LINE_LENGTH 80
enum
OptionType
{
OptionType_Boolean
,
...
...
@@ -131,7 +131,7 @@ static bool set_string(struct config_option *opt, const char *value)
return
true
;
}
static
void
configure
(
const
char
*
key
,
const
char
*
value
,
int
line
N
umber
)
static
void
configure
(
const
char
*
key
,
const
char
*
value
,
int
line
_n
umber
)
{
struct
config_option
*
opt
=
findOption
(
key
);
if
(
!
opt
)
{
...
...
@@ -139,7 +139,7 @@ static void configure(const char *key, const char *value, int lineNumber)
LOG_WARN
(
"card10.cfg"
,
"line %d: ignoring unknown option '%s'"
,
line
N
umber
,
line
_n
umber
,
key
);
return
;
...
...
@@ -165,14 +165,14 @@ static void configure(const char *key, const char *value, int lineNumber)
LOG_WARN
(
"card10.cfg"
,
"line %d: ignoring invalid value '%s' for option '%s'"
,
line
N
umber
,
line
_n
umber
,
value
,
key
);
}
}
static
void
doline
(
char
*
line
,
char
*
eol
,
int
line
N
umber
)
static
void
doline
(
char
*
line
,
char
*
eol
,
int
line
_n
umber
)
{
//skip leading whitespace
while
(
*
line
&&
isspace
((
int
)
*
line
))
...
...
@@ -190,7 +190,7 @@ static void doline(char *line, char *eol, int lineNumber)
LOG_WARN
(
"card10.cfg"
,
"line %d (%s): syntax error"
,
line
N
umber
,
line
_n
umber
,
elide
(
line
)
);
}
...
...
@@ -203,7 +203,7 @@ static void doline(char *line, char *eol, int lineNumber)
--
e_key
;
e_key
[
1
]
=
'\0'
;
if
(
*
key
==
'\0'
)
{
LOG_WARN
(
"card10.cfg"
,
"line %d: empty key"
,
line
N
umber
);
LOG_WARN
(
"card10.cfg"
,
"line %d: empty key"
,
line
_n
umber
);
return
;
}
...
...
@@ -220,13 +220,13 @@ static void doline(char *line, char *eol, int lineNumber)
LOG_WARN
(
"card10.cfg"
,
"line %d: empty value for option '%s'"
,
line
N
umber
,
line
_n
umber
,
key
);
return
;
}
configure
(
key
,
value
,
line
N
umber
);
configure
(
key
,
value
,
line
_n
umber
);
}
bool
config_get_boolean
(
enum
EpicConfigOption
option
)
...
...
@@ -270,12 +270,12 @@ void load_config(void)
);
return
;
}
char
buf
[
CONFIG_
MAX_LINE_LENGTH
+
1
];
int
line
N
umber
=
0
;
char
buf
[
MAX_LINE_LENGTH
+
1
];
int
line
_n
umber
=
0
;
int
nread
;
do
{
nread
=
epic_file_read
(
fd
,
buf
,
CONFIG_
MAX_LINE_LENGTH
);
if
(
nread
<
CONFIG_
MAX_LINE_LENGTH
)
{
nread
=
epic_file_read
(
fd
,
buf
,
MAX_LINE_LENGTH
);
if
(
nread
<
MAX_LINE_LENGTH
)
{
//add fake EOL to ensure termination
buf
[
nread
++
]
=
'\n'
;
}
...
...
@@ -288,10 +288,10 @@ void load_config(void)
//line points one character past the las (if any) '\n' hence '- 1'
last_eol
=
line
-
buf
-
1
;
eol
=
strchr
(
line
,
'\n'
);
++
line
N
umber
;
++
line
_n
umber
;
if
(
eol
)
{
*
eol
=
'\0'
;
doline
(
line
,
eol
,
line
N
umber
);
doline
(
line
,
eol
,
line
_n
umber
);
line
=
eol
+
1
;
continue
;
}
...
...
@@ -300,7 +300,7 @@ void load_config(void)
LOG_WARN
(
"card10.cfg"
,
"line:%d: too long - aborting"
,
line
N
umber
line
_n
umber
);
return
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment