Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Duncan Macleod
gstlal
Commits
817934b5
Commit
817934b5
authored
6 years ago
by
Kipp Cannon
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_snglinspiral_array_from_file(): fix return value
- oops, I was zeroing the row count before returning
parent
f581fa85
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-inspiral/lib/gstlal_snglinspiral.c
+10
-8
10 additions, 8 deletions
gstlal-inspiral/lib/gstlal_snglinspiral.c
with
10 additions
and
8 deletions
gstlal-inspiral/lib/gstlal_snglinspiral.c
+
10
−
8
View file @
817934b5
...
...
@@ -184,6 +184,7 @@ static int sngl_inspiral_row_callback(struct ligolw_table *table, struct ligolw_
int
gstlal_snglinspiral_array_from_file
(
const
char
*
filename
,
SnglInspiralTable
**
bankarray
)
{
SnglInspiralTable
*
head
=
NULL
;
SnglInspiralTable
*
row
;
ezxml_t
xmldoc
;
ezxml_t
elem
;
struct
ligolw_table
*
table
;
...
...
@@ -229,6 +230,13 @@ int gstlal_snglinspiral_array_from_file(const char *filename, SnglInspiralTable
ezxml_free
(
xmldoc
);
/*
* count rows. can't use table->n_rows because the callback
* interecepted the rows, and the table object is empty
*/
for
(
num
=
0
,
row
=
head
;
row
;
row
=
row
->
next
,
num
++
);
/*
* copy the linked list of templates into the template array in
* reverse order. the linked list is reversed with respect to the
...
...
@@ -236,14 +244,8 @@ int gstlal_snglinspiral_array_from_file(const char *filename, SnglInspiralTable
* in the order in which they appear in the file.
*/
{
/* can't use table->n_rows because the callback interecepted the
* rows, and the table object is empty */
SnglInspiralTable
*
row
=
head
;
for
(
num
=
0
;
row
;
row
=
row
->
next
,
num
++
);
}
*
bankarray
=
calloc
(
num
,
sizeof
(
**
bankarray
));
while
(
num
--
)
{
for
(
row
=
&
(
*
bankarray
)[
num
-
1
];
head
;
row
--
)
{
SnglInspiralTable
*
next
=
head
->
next
;
/* fix broken columns */
...
...
@@ -253,7 +255,7 @@ int gstlal_snglinspiral_array_from_file(const char *filename, SnglInspiralTable
head
->
mchirp
=
gstlal_mchirp
(
head
->
mass1
,
head
->
mass2
);
head
->
eta
=
gstlal_eta
(
head
->
mass1
,
head
->
mass2
);
(
*
bankarray
)[
num
]
=
*
head
;
*
row
=
*
head
;
LALFree
(
head
);
head
=
next
;
}
...
...
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