planner: don't use fixed size deco stop table

This was quite ominous: a 60-element fixed size table was
passed as argument to plan(). But there was no check for 60
anywhere? Use a dynamic vector instead.

The whole thing is weird, as the depth of the decostop table
doesn't seem to be used.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-09-07 14:56:34 +02:00 committed by Michael Keller
parent 0745c50e58
commit 3e006e678a
5 changed files with 17 additions and 38 deletions

View file

@ -66,5 +66,5 @@ struct decostop {
};
extern std::string get_planner_disclaimer_formatted();
extern bool plan(struct deco_state *ds, struct diveplan &diveplan, struct dive *dive, int dcNr, int timestep, struct decostop *decostoptable, deco_state_cache &cache, bool is_planner, bool show_disclaimer);
extern bool plan(struct deco_state *ds, struct diveplan &diveplan, struct dive *dive, int dcNr, int timestep, std::vector<decostop> &decostoptable, deco_state_cache &cache, bool is_planner, bool show_disclaimer);
#endif // PLANNER_H