Skip to content
Snippets Groups Projects
Commit 43258090 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

gstlal_snglinspiral.c: clean up some loops

parent a7a73be0
No related branches found
No related tags found
No related merge requests found
Pipeline #70869 passed with warnings
......@@ -276,40 +276,36 @@ parsefailed:
return -1;
}
void gstlal_snglinspiral_array_free(SnglInspiralTable *bankarray) {
void gstlal_snglinspiral_array_free(SnglInspiralTable *bankarray)
{
free(bankarray);
}
int gstlal_set_channel_in_snglinspiral_array(SnglInspiralTable *bankarray, int length, char *channel)
{
int i;
for (i = 0; i < length; i++) {
if (channel) {
strncpy(bankarray[i].channel, (const char*) channel, LIGOMETA_CHANNEL_MAX);
bankarray[i].channel[LIGOMETA_CHANNEL_MAX - 1] = 0;
if(channel)
for(; length > 0; bankarray++, length--) {
strncpy(bankarray->channel, channel, LIGOMETA_CHANNEL_MAX);
bankarray->channel[LIGOMETA_CHANNEL_MAX - 1] = 0;
}
}
return 0;
}
int gstlal_set_instrument_in_snglinspiral_array(SnglInspiralTable *bankarray, int length, char *instrument)
{
int i;
for (i = 0; i < length; i++) {
if (instrument) {
strncpy(bankarray[i].ifo, (const char*) instrument, LIGOMETA_IFO_MAX);
bankarray[i].ifo[LIGOMETA_IFO_MAX - 1] = 0;
if(instrument)
for(; length > 0; bankarray++, length--) {
strncpy(bankarray->ifo, instrument, LIGOMETA_IFO_MAX);
bankarray->ifo[LIGOMETA_IFO_MAX - 1] = 0;
}
}
return 0;
}
int gstlal_set_sigmasq_in_snglinspiral_array(SnglInspiralTable *bankarray, int length, double *sigmasq)
{
int i;
for (i = 0; i < length; i++) {
bankarray[i].sigmasq = sigmasq[i];
}
for(; length > 0; bankarray++, sigmasq++, length--)
bankarray->sigmasq = *sigmasq;
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment