On Sat, Apr 02, 2016 at 04:38:32PM -0500, Linus Torvalds wrote:
> @@ -177,7 +155,7 @@ void add_extra_data(struct divecomputer *dc, const char
> *key, const char *value)
> }
>
> /* this returns a pointer to static variable - so use it right away after
> calling */
> -struct gasmix *get_gasmix_from_event(struct event *ev)
> +struct gasmix *get_gasmix_from_event(struct dive *dive, struct event *ev)
So you add the dive pointer to the function signature, but you don't do
anything with it, creating an unused parameter. Why?
> @@ -848,7 +826,7 @@ int explicit_first_cylinder(struct dive *dive, struct
> divecomputer *dc)
> /* this gets called when the dive mode has changed (so OC vs. CC)
> * there are two places we might have setpoints... events or in the samples
> */
> -void update_setpoint_events(struct divecomputer *dc)
> +void update_setpoint_events(struct dive *dive, struct divecomputer *dc)
Then you add a dive pointer to this function...
> {
> struct event *ev;
> int new_setpoint = 0;
> @@ -866,14 +844,14 @@ void update_setpoint_events(struct divecomputer *dc)
> // So we make sure, this comes from a Predator or Petrel and we
> only remove
> // pO2 values we would have computed anyway.
> struct event *ev = get_next_event(dc->events, "gaschange");
> - struct gasmix *gasmix = get_gasmix_from_event(ev);
> + struct gasmix *gasmix = get_gasmix_from_event(dive, ev);
> struct event *next = get_next_event(ev, "gaschange");
>
> for (int i = 0; i < dc->samples; i++) {
> struct gas_pressures pressures;
> if (next && dc->sample[i].time.seconds >=
> next->time.seconds) {
> ev = next;
> - gasmix = get_gasmix_from_event(ev);
> + gasmix = get_gasmix_from_event(dive, ev);
But you only use it to call the function above which doesn't appear to use
that argument.
Hmmm
What am I missing?
> diff --git a/subsurface-core/planner.c b/subsurface-core/planner.c
> index 705aad1cb9ae..4d96b03c06b1 100644
> --- a/subsurface-core/planner.c
> +++ b/subsurface-core/planner.c
> @@ -85,7 +85,7 @@ void get_gas_at_time(struct dive *dive, struct divecomputer
> *dc, duration_t time
> *gas = dive->cylinder[0].gasmix;
> while (event && event->time.seconds <= time.seconds) {
> if (!strcmp(event->name, "gaschange")) {
> - int cylinder_idx = get_cylinder_index(dive, event);
> + int cylinder_idx = get_cylinder_index (dive, event);
White space damage... no space before '(' on function calls
Could you clean this one up and resend? 1 and 2 looked fine (I'll look at
number 4 next)
/D
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface