Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(45)

Issue 264950043: Issue 4577: Remove the nasty workaround for platforms that don't provide std::vector::data(). (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 8 months ago by Dan Eble
Modified:
9 years, 8 months ago
Reviewers:
pkx166h, benko.pal, dak, Keith
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Remove the nasty workaround for platforms that don't provide std::vector::data(). Replace most code that reached into into Grob_array and modified its internal vector with calls to new member functions such as filter(). Move the definitions of some trivial methods into grob-array.hh.

Patch Set 1 #

Total comments: 12

Patch Set 2 : whitespace and comments #

Patch Set 3 : filter_map_into -> filter_map_assign #

Total comments: 1

Patch Set 4 : remove cautionary comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -147 lines) Patch
M flower/include/std-vector.hh View 1 chunk +0 lines, -49 lines 0 comments Download
M lily/break-substitution.cc View 1 2 3 chunks +4 lines, -31 lines 0 comments Download
M lily/grob-array.cc View 1 2 3 chunks +32 lines, -23 lines 0 comments Download
M lily/include/grob-array.hh View 1 2 3 1 chunk +18 lines, -5 lines 0 comments Download
M lily/paper-column.cc View 2 chunks +7 lines, -15 lines 0 comments Download
M lily/pure-from-neighbor-interface.cc View 1 1 chunk +2 lines, -7 lines 0 comments Download
M lily/slur.cc View 1 1 chunk +2 lines, -7 lines 0 comments Download
M lily/system.cc View 1 chunk +3 lines, -10 lines 0 comments Download

Messages

Total messages: 20
Dan Eble
9 years, 8 months ago (2015-08-29 02:36:01 UTC) #1
dak
"Beautify" is appropriate for changes in comments or formatting. For code, it is subjective and ...
9 years, 8 months ago (2015-08-29 07:33:19 UTC) #2
pkx166h
Passes make, make check and a full make doc. PATCH_REVIEW
9 years, 8 months ago (2015-08-29 07:43:37 UTC) #3
Dan Eble
whitespace and comments
9 years, 8 months ago (2015-08-29 13:11:02 UTC) #4
Dan Eble
On 2015/08/29 13:11:02, Dan Eble wrote: > whitespace and comments I'll address filter_map_into/filter_map_assign later; I'm ...
9 years, 8 months ago (2015-08-29 13:12:19 UTC) #5
Dan Eble
filter_map_into -> filter_map_assign
9 years, 8 months ago (2015-09-01 02:30:20 UTC) #6
Dan Eble
On 2015/09/01 02:30:20, Dan Eble wrote: > filter_map_into -> filter_map_assign PATCH_NEW
9 years, 8 months ago (2015-09-01 02:31:52 UTC) #7
benko.pal
https://codereview.appspot.com/264950043/diff/40001/lily/include/grob-array.hh File lily/include/grob-array.hh (right): https://codereview.appspot.com/264950043/diff/40001/lily/include/grob-array.hh#newcode63 lily/include/grob-array.hh:63: // Note: This method may reorder the array without ...
9 years, 8 months ago (2015-09-02 10:13:26 UTC) #8
Dan Eble
On 2015/09/02 10:13:26, benko.pal wrote: > https://codereview.appspot.com/264950043/diff/40001/lily/include/grob-array.hh#newcode63 > lily/include/grob-array.hh:63: // Note: This method may reorder ...
9 years, 8 months ago (2015-09-02 23:27:41 UTC) #9
dak
On 2015/09/02 23:27:41, Dan Eble wrote: > If the sorting criterion uses attributes of the ...
9 years, 8 months ago (2015-09-03 08:49:13 UTC) #10
Dan Eble
On 2015/09/03 08:49:13, dak wrote: > On 2015/09/02 23:27:41, Dan Eble wrote: > > > ...
9 years, 8 months ago (2015-09-05 13:08:02 UTC) #11
Dan Eble
On 2015/09/05 13:08:02, Dan Eble wrote: > On 2015/09/03 08:49:13, dak wrote: > > On ...
9 years, 8 months ago (2015-09-05 13:11:23 UTC) #12
dak
On 2015/09/05 13:11:23, Dan Eble wrote: > On 2015/09/05 13:08:02, Dan Eble wrote: > > ...
9 years, 8 months ago (2015-09-05 13:45:35 UTC) #13
Keith
On 2015/09/03 08:49:13, dak wrote: > On 2015/09/02 23:27:41, Dan Eble wrote: > > > ...
9 years, 8 months ago (2015-09-05 17:13:55 UTC) #14
Dan Eble
On 2015/09/05 17:13:55, Keith wrote: > > In this case, the converse: If 'ordered_' is ...
9 years, 8 months ago (2015-09-05 20:37:12 UTC) #15
Dan Eble
rebase to current master
9 years, 8 months ago (2015-09-06 00:30:24 UTC) #16
Dan Eble
remove cautionary comments
9 years, 8 months ago (2015-09-06 00:45:25 UTC) #17
Dan Eble
On 2015/09/06 00:45:25, Dan Eble wrote: > remove cautionary comments Forbidding filtering of "ordered" grob ...
9 years, 8 months ago (2015-09-06 00:49:44 UTC) #18
Keith
On Sat, 05 Sep 2015 17:49:44 -0700, <nine.fierce.ballads@gmail.com> wrote: > I have simply removed the ...
9 years, 8 months ago (2015-09-06 01:50:43 UTC) #19
dak
9 years, 8 months ago (2015-09-06 07:25:12 UTC) #20
On 2015/09/06 01:50:43, Keith wrote:
> On Sat, 05 Sep 2015 17:49:44 -0700, <mailto:nine.fierce.ballads@gmail.com>
wrote:
> 
> > I have simply removed the comments warning about filtering
> > ordered arrays.
> 
> That seems to be correct.  Those comments were incorrect.
> The filter_map* functions do not, in fact, change the order of the array under
> the meaning of 'ordered_'.  Pál's comment makes sense.
> 
> There is no sorting method in Grob_array so there is no reason to suspect that
> the member 'ordered_' has anything to do with order under a sorting criterion.

> Looking at the commits that touch 'ordered_' it is clear that its meaning was
> "this array should stay in its current order" and that removal of elements
> doesn't count as a change in order and substituting Grobs inherit the order
the
> Grobs they replace.

Thanks for figuring this out, and sorry to Dan for the false alarm.  I wish our
codebase were less writeonly so that one could readily guess this from the
comments in the respective header files.

grob-array.hh and grob-array.cc combined contain a single comment apart from the
copyright header, namely

#if 0  /* see System::derived_mark () const */

which is cryptic in itself.  It also contains

void
Grob_array::remove_duplicates ()
{
  assert (!ordered_);

  uniquify (grobs_);
}

which I am less that sure even makes sense any more: since issue 3365, the
variant of uniquify employed here preserves order anyway.  I probably was not
really capable of figuring out with reasonable effort what this assert was
supposed to protect against and rather left it in.

It takes far too much reverse engineering to work on LilyPond.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b