Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
38339413
Commit
38339413
authored
8 years ago
by
burneykb
Browse files
Options
Downloads
Patches
Plain Diff
utilize jakes frontend_free_nodedata where necissary
parent
5e430fa0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
groundStation/src/cli/cli.c
+6
-7
6 additions, 7 deletions
groundStation/src/cli/cli.c
groundStation/src/cli/cli_nodes.c
+6
-7
6 additions, 7 deletions
groundStation/src/cli/cli_nodes.c
with
12 additions
and
14 deletions
groundStation/src/cli/cli.c
+
6
−
7
View file @
38339413
...
...
@@ -155,7 +155,7 @@ int isNumber(char *number) {
int
convert_to_id
(
struct
backend_conn
*
conn
,
char
**
argv
,
struct
convert_data
*
convert_data
,
int
conversion_requirement
)
{
/* variables used to search for id values */
size_t
num_nodes
=
0
,
i
;
struct
frontend_node_data
*
search_data
;
struct
frontend_node_data
*
search_data
=
NULL
;
int
search_1
=
0
,
search_2
=
0
;
const
struct
graph_node_type
*
node_definition
;
...
...
@@ -177,8 +177,10 @@ int convert_to_id(struct backend_conn * conn, char **argv, struct convert_data *
return
0
;
}
search_data
=
malloc
(
sizeof
((
*
search_data
))
*
num_nodes
);
/**
* node_data must be NULL,
* num_nodes must equal zero.
*/
if
(
frontend_getnodes
(
conn
,
&
search_data
,
&
num_nodes
))
{
return
1
;
}
...
...
@@ -229,9 +231,6 @@ int convert_to_id(struct backend_conn * conn, char **argv, struct convert_data *
}
}
}
for
(
i
=
0
;
i
<
num_nodes
;
++
i
)
{
free
(
search_data
[
i
].
name
);
}
free
(
search_data
);
frontend_free_nodedata
(
search_data
,
num_nodes
);
return
search_2
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
groundStation/src/cli/cli_nodes.c
+
6
−
7
View file @
38339413
...
...
@@ -11,7 +11,7 @@
int
cli_getnodes
(
struct
backend_conn
*
conn
,
int
argc
,
char
**
argv
)
{
size_t
num_nodes
=
0
;
struct
frontend_node_data
*
node_data
;
struct
frontend_node_data
*
node_data
=
NULL
;
int
needHelp
=
0
;
...
...
@@ -30,8 +30,10 @@ int cli_getnodes(struct backend_conn * conn, int argc, char ** argv) {
return
1
;
}
node_data
=
malloc
(
sizeof
(
*
node_data
));
/**
* node_data must be NULL,
* num_nodes must equal zero.
*/
if
(
frontend_getnodes
(
conn
,
&
node_data
,
&
num_nodes
))
{
free
(
node_data
);
return
1
;
...
...
@@ -66,12 +68,9 @@ int cli_getnodes(struct backend_conn * conn, int argc, char ** argv) {
printf
(
" %s "
,
node_definition
->
output_names
[
n
]);
}
printf
(
"}
\n
"
);
free
(
node_data
[
i
].
name
);
}
fr
ee
(
node_data
);
fr
ontend_free_nodedata
(
node_data
,
num_nodes
);
return
0
;
}
...
...
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