On Sat, Nov 15, 2014 at 06:37:21PM +0200, Willem Ferguson wrote:
> This is a second version of a similar patch submitted a few days ago.
That may be. It also is (with all due respect) CRAP.
This patch removes code that was added a few days ago to fix a crash. Plus
other unrelated things that undo recent changes.
I worry about the state of your git tree, Willem.
I'm about to cut the first beta and things like this shouldn't happen,
especially not now.
> This version preserves the present convention of storing the CCR setpoint
> information in xml using a PO2 attribute. It also reads the setpoint info
> from
> a xml PO2 attribute.
>
> Three lines are marked as belonging to patches that were formulated by
> Rober Helling and by Miika Turkia, respectively. So their equivalent patches
> need to be pushed before this one. But this patch is buggy without those
> two patches.
I'm trying to figure out which ones those might be...
but first look at these parts of your patch below
> diff --git a/dive.c b/dive.c
> index 0c0e649..ae99951 100644
> --- a/dive.c
> +++ b/dive.c
> @@ -434,10 +434,6 @@ void clear_dive(struct dive *d)
> taglist_free(d->tag_list);
> STRUCTURED_LIST_FREE(struct divecomputer, d->dc.next, free_dc);
> STRUCTURED_LIST_FREE(struct picture, d->picture_list, free_pic);
> - for (int i = 0; i < MAX_CYLINDERS; i++)
> - free((void *)d->cylinder[i].type.description);
> - for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++)
> - free((void *)d->weightsystem[i].description);
> memset(d, 0, sizeof(struct dive));
> }
>
> @@ -456,10 +452,6 @@ void copy_dive(struct dive *s, struct dive *d)
> d->location = copy_string(s->location);
> d->notes = copy_string(s->notes);
> d->suit = copy_string(s->suit);
> - for (int i = 0; i < MAX_CYLINDERS; i++)
> - d->cylinder[i].type.description =
> copy_string(s->cylinder[i].type.description);
> - for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++)
> - d->weightsystem[i].description =
> copy_string(s->weightsystem[i].description);
> STRUCTURED_LIST_COPY(struct picture, s->picture_list, d->picture_list,
> copy_pl);
> STRUCTURED_LIST_COPY(struct tag_entry, s->tag_list, d->tag_list,
> copy_tl);
> STRUCTURED_LIST_COPY(struct divecomputer, s->dc.next, d->dc.next,
> copy_dc);
WTF!!!! Why is that in here? How did you create this patch?
> @@ -2515,13 +2507,8 @@ int count_dives_with_tag(const char *tag)
> struct dive *d;
>
> for_each_dive (i, d) {
> - if (same_string(tag, "")) {
> - // count dives with no tags
> - if (d->tag_list == NULL)
> - counter++;
> - } else if (taglist_contains(d->tag_list, tag)) {
> + if (taglist_contains(d->tag_list, tag))
> counter++;
> - }
> }
> return counter;
ditto
> }
> @@ -2535,13 +2522,8 @@ int count_dives_with_person(const char *person)
> struct dive *d;
>
> for_each_dive (i, d) {
> - if (same_string(person, "")) {
> - // solo dive
> - if (same_string(d->buddy, "") &&
> same_string(d->divemaster, ""))
> - counter++;
> - } else if (string_sequence_contains(d->buddy, person) ||
> string_sequence_contains(d->divemaster, person)) {
> + if (string_sequence_contains(d->buddy, person) ||
> string_sequence_contains(d->divemaster, person))
> counter++;
> - }
> }
> return counter;
> }
ditto
> @@ -2559,20 +2541,6 @@ int count_dives_with_location(const char *location)
> return counter;
> }
>
> -// count the dives with exactly the suit
> -int count_dives_with_suit(const char *suit)
> -{
> - int i, counter = 0;
> - struct dive *d;
> -
> - for_each_dive (i, d) {
> - if (same_string(d->suit, suit))
> - counter++;
> - }
> - return counter;
> -}
> -
> -
> struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool
> prefer_downloaded)
> {
> struct dive *res = alloc_dive();
ditto
/D
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface