Skip to content

Commit

Permalink
Made output_partnership a non-static function.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathangeffen committed Sep 8, 2019
1 parent 17c97b9 commit 27a6dee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/fsti-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ fsti_event_write_partnerships_csv_header(struct fsti_simulation *simulation)
* Records a new partnership in the partnerships CSV file
*/

static void
output_partnership(struct fsti_simulation *simulation,
struct fsti_agent *a,
struct fsti_agent *b,
uint8_t type)
void
fsti_output_partnership(struct fsti_simulation *simulation,
struct fsti_agent *a,
struct fsti_agent *b,
uint8_t type)
{
char desc[20];
char date[FSTI_DATE_LEN];
Expand Down Expand Up @@ -138,7 +138,8 @@ count_initial_partnerships_infections(struct fsti_simulation *simulation)
if (b->id > a->id) {
++simulation->initial_matches;
if (simulation->record_matches)
output_partnership(simulation, a, b, FSTI_INITIAL_MATCH);
fsti_output_partnership(simulation, a, b,
FSTI_INITIAL_MATCH);
}
}
});
Expand Down Expand Up @@ -705,11 +706,11 @@ void make_partners(struct fsti_simulation *simulation,
if (simulation->state == DURING) {
++simulation->matches;
if (simulation->record_matches)
output_partnership(simulation, a, b, FSTI_MATCH);
fsti_output_partnership(simulation, a, b, FSTI_MATCH);
} else if (simulation->state == BEFORE) {
++simulation->initial_matches;
if (simulation->record_matches)
output_partnership(simulation, a, b, FSTI_INITIAL_MATCH);
fsti_output_partnership(simulation, a, b, FSTI_INITIAL_MATCH);
}
}

Expand Down Expand Up @@ -765,7 +766,7 @@ fsti_event_breakup(struct fsti_simulation *simulation)
FSTI_SET_SINGLE_PERIOD(simulation, b);
simulation->breakups++;
if (simulation->record_breakups)
output_partnership(simulation, a, b, FSTI_BREAKUP);
fsti_output_partnership(simulation, a, b, FSTI_BREAKUP);
}
});
}
Expand Down Expand Up @@ -875,8 +876,8 @@ fsti_event_infect(struct fsti_simulation *simulation)
agent->infected = simulation->initial_infect_stage;
simulation->infections++;
if (simulation->record_infections)
output_partnership(simulation, agent, partner,
FSTI_INFECTION);
fsti_output_partnership(simulation, agent,
partner,FSTI_INFECTION);
break;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/fsti-events.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ void fsti_event_pair(struct fsti_simulation *simulation);
void fsti_event_generate_and_pair(struct fsti_simulation *simulation);
void fsti_event_infect(struct fsti_simulation *simulation);
void fsti_event_no_op(struct fsti_simulation *simulation);
void fsti_output_partnership(struct fsti_simulation *simulation,
struct fsti_agent *a,
struct fsti_agent *b,
uint8_t type);
void fsti_event_register_events();

extern struct fsti_agent fsti_global_agent;
Expand Down

0 comments on commit 27a6dee

Please sign in to comment.