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

Issue 226840043: Replace C++ (in)equality checks with proper SCM syntax (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years ago by Valentin Villenave
Modified:
7 years, 12 months ago
Reviewers:
pkx166h, Dan Eble, dak
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Replace C++ (in)equality checks with proper SCM syntax This commit replaces the most straightforward situations where two SCM objects are compared. Here are the basic replacements I used: x == SCM_BOOL_F ---> scm_is_false (x) x == SCM_BOOL_T ---> to_boolean (x) (I’d rather use something more straightforward such as scm_is_true (x), but accordingly to the CG this is The LilyPond Way®.) x == (SCM y) ---> scm_is_eq (x, y) (often used with ly_symbol2scm) I’m also adding some functions that Guile v1 does not provide: x == SCM_EOL ---> ly_is_eol (x) x == SCM_UNDEFINED ---> ly_is_undefined (x) (scm_exact_p (x)) == SCM_BOOL_T ----> ly_is_exact (x) Finally, I replaced (!cached) with (!SCM_UNPACK (cached)) in lily-guile-macros.hh, as has been suggested once by David. Please note that this commit does not handle some situations I’m less comfortable with (namely those involving scm_c_memq, scm_assq or scm_hashq_get_handle), and some scm_*_p checks for which there isn’t a ly_is_* replacement yet (to wit, scm_hash_table_p, scm_promise_p, and scm_variable_bound_p). Those should be dealt with later (preferably with help from more experienced people than yours truly).

Patch Set 1 #

Patch Set 2 : Syntax improvements #

Patch Set 3 : Compile fix #

Patch Set 4 : Additional typo cleanup #

Patch Set 5 : Bugfix (but some regtests results require to be investigated further) #

Total comments: 13

Patch Set 6 : One final (minor) syntax correction #

Total comments: 1

Patch Set 7 : Use !scm_is_true instead of ly_is_false (and other suggestions from David) #

Patch Set 8 : Use scm_is_true whenever possible #

Unified diffs Side-by-side diffs Delta from patch set Stats (+526 lines, -508 lines) Patch
M lily/accidental-engraver.cc View 1 2 3 4 3 chunks +4 lines, -3 lines 0 comments Download
M lily/accidental-placement.cc View 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/align-interface.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/ambitus-engraver.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M lily/auto-beam-engraver.cc View 1 2 3 4 5 6 2 chunks +6 lines, -7 lines 0 comments Download
M lily/axis-group-interface.cc View 2 chunks +8 lines, -8 lines 0 comments Download
M lily/bar-engraver.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/bar-number-engraver.cc View 1 2 3 4 2 chunks +5 lines, -3 lines 0 comments Download
M lily/beam.cc View 1 2 3 4 5 6 7 5 chunks +7 lines, -6 lines 0 comments Download
M lily/beam-engraver.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/break-align-engraver.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M lily/break-alignment-interface.cc View 2 3 4 5 6 7 4 chunks +6 lines, -6 lines 0 comments Download
M lily/break-substitution.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M lily/chord-name-engraver.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/clef-engraver.cc View 1 2 3 4 5 6 1 chunk +5 lines, -5 lines 0 comments Download
M lily/constrained-breaking.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M lily/context.cc View 1 2 3 4 5 6 7 5 chunks +5 lines, -5 lines 0 comments Download
M lily/context-def.cc View 1 2 3 4 5 chunks +19 lines, -19 lines 0 comments Download
M lily/context-mod-scheme.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/context-property.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M lily/context-scheme.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/cue-clef-engraver.cc View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M lily/directional-element-interface.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/dispatcher.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/dot-column.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M lily/double-percent-repeat-engraver.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M lily/drum-note-engraver.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/drum-note-performer.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/duration-scheme.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lily/dynamic-engraver.cc View 1 4 chunks +7 lines, -6 lines 0 comments Download
M lily/engraver.cc View 1 3 chunks +5 lines, -5 lines 0 comments Download
M lily/engraver-group.cc View 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/figured-bass-engraver.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/font-interface.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M lily/font-select.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/general-scheme.cc View 1 2 3 4 5 6 7 chunks +9 lines, -9 lines 0 comments Download
M lily/glissando-engraver.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/grob.cc View 1 1 chunk +4 lines, -4 lines 0 comments Download
M lily/grob-interface.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M lily/grob-property.cc View 1 2 3 4 5 6 7 7 chunks +9 lines, -9 lines 0 comments Download
M lily/grob-scheme.cc View 1 4 chunks +7 lines, -7 lines 0 comments Download
M lily/include/lily-guile.hh View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M lily/include/lily-guile-macros.hh View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/instrument-name-engraver.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M lily/key-engraver.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/lexer.ll View 1 2 3 4 5 6 7 15 chunks +19 lines, -19 lines 0 comments Download
M lily/ligature-engraver.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/lily-guile.cc View 1 2 3 4 5 6 7 4 chunks +8 lines, -8 lines 0 comments Download
M lily/lily-lexer.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M lily/lily-parser.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/lily-parser-scheme.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M lily/line-interface.cc View 1 chunk +6 lines, -5 lines 0 comments Download
M lily/line-spanner.cc View 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M lily/ly-module.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/mark-engraver.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M lily/measure-grouping-spanner.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M lily/mensural-ligature.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/metronome-engraver.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -4 lines 0 comments Download
M lily/midi-item.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M lily/module-scheme.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M lily/multi-measure-rest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/multi-measure-rest-engraver.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M lily/music.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -6 lines 0 comments Download
M lily/new-fingering-engraver.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -5 lines 0 comments Download
M lily/note-collision.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M lily/open-type-font.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/output-def.cc View 1 5 chunks +10 lines, -10 lines 0 comments Download
M lily/output-def-scheme.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M lily/page-breaking.cc View 1 5 chunks +7 lines, -5 lines 0 comments Download
M lily/page-layout-problem.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/page-spacing.cc View 1 chunk +2 lines, -1 line 0 comments Download
M lily/page-turn-engraver.cc View 1 2 3 3 chunks +6 lines, -5 lines 0 comments Download
M lily/page-turn-page-breaking.cc View 1 chunk +2 lines, -1 line 0 comments Download
M lily/pango-font.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M lily/pango-select.cc View 3 chunks +9 lines, -9 lines 0 comments Download
M lily/paper-book.cc View 1 2 3 4 5 6 7 9 chunks +10 lines, -10 lines 0 comments Download
M lily/paper-column.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M lily/paper-column-engraver.cc View 1 chunk +2 lines, -1 line 0 comments Download
M lily/paper-def.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/paper-outputter.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/paper-score.cc View 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/paper-system.cc View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M lily/parse-scm.cc View 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/parser.yy View 8 chunks +16 lines, -16 lines 0 comments Download
M lily/part-combine-engraver.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M lily/part-combine-iterator.cc View 1 chunk +11 lines, -11 lines 0 comments Download
M lily/percent-repeat-engraver.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/piano-pedal-engraver.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M lily/pitched-trill-engraver.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M lily/prob.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -6 lines 0 comments Download
M lily/prob-scheme.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M lily/profile.cc View 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M lily/program-option-scheme.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/quote-iterator.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/repeat-acknowledge-engraver.cc View 1 chunk +5 lines, -4 lines 0 comments Download
M lily/score.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/score-performer.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/score-scheme.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/script-engraver.cc View 1 2 3 4 5 6 7 4 chunks +5 lines, -5 lines 0 comments Download
M lily/script-interface.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M lily/self-alignment-interface.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/simple-closure.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M lily/simple-spacer.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/simple-spacer-scheme.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/skyline.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M lily/slur.cc View 8 chunks +12 lines, -10 lines 0 comments Download
M lily/slur-configuration.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M lily/slur-scoring.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M lily/smobs.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M lily/spaceable-grob.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lily/spacing-determine-loose-columns.cc View 1 chunk +2 lines, -1 line 0 comments Download
M lily/spanner.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/staff-performer.cc View 5 chunks +7 lines, -7 lines 0 comments Download
M lily/staff-spacing.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M lily/stem.cc View 1 chunk +2 lines, -1 line 0 comments Download
M lily/stem-tremolo.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/stencil.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/stencil-expression.cc View 1 chunk +1 line, -2 lines 0 comments Download
M lily/stencil-integral.cc View 1 2 3 4 5 6 7 16 chunks +40 lines, -41 lines 0 comments Download
M lily/stencil-interpret.cc View 7 chunks +13 lines, -13 lines 0 comments Download
M lily/stencil-scheme.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -8 lines 0 comments Download
M lily/stream-event.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M lily/stream-event-scheme.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/system.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/system-start-delimiter.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M lily/system-start-delimiter-engraver.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M lily/tab-note-heads-engraver.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M lily/text-interface.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/tie-formatting-problem.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M lily/tie-specification.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M lily/time-signature-engraver.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M lily/translator-ctors.cc View 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/translator-group-ctors.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M lily/ttf.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M lily/tuplet-bracket.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/tuplet-number.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M lily/vaticana-ligature.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M lily/vaticana-ligature-engraver.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M lily/volta-engraver.cc View 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M lily/volta-repeat-iterator.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 16
Valentin Villenave
Greetings everybody, I realize that this is a rather large patch; at home I had ...
9 years ago (2015-04-07 13:22:28 UTC) #1
Dan Eble
> x == SCM_EOL ---> ly_is_eol (x) But... > Guile has scm_is_null which is a ...
9 years ago (2015-04-08 01:38:21 UTC) #2
Valentin Villenave
Syntax improvements
9 years ago (2015-04-08 06:58:48 UTC) #3
Valentin Villenave
Compile fix
9 years ago (2015-04-08 22:10:32 UTC) #4
Valentin Villenave
Additional typo cleanup
9 years ago (2015-04-08 22:46:01 UTC) #5
Valentin Villenave
Bugfix (but some regtests results require to be investigated further)
9 years ago (2015-04-09 19:40:38 UTC) #6
Valentin Villenave
One final (minor) syntax correction
9 years ago (2015-04-10 13:01:11 UTC) #7
dak
Man, this looks like some serious piece of work. Got a headache merely reviewing it. ...
9 years ago (2015-04-10 13:16:16 UTC) #8
Valentin Villenave
Use !scm_is_true instead of ly_is_false (and other suggestions from David)
9 years ago (2015-04-10 14:06:11 UTC) #9
Valentin Villenave
On 2015/04/10 13:16:16, dak wrote: > Man, this looks like some serious piece of work. ...
9 years ago (2015-04-10 14:23:39 UTC) #10
Valentin Villenave
Use scm_is_true whenever possible
9 years ago (2015-04-10 19:51:46 UTC) #11
Valentin Villenave
Use scm_is_true whenever possible
9 years ago (2015-04-10 19:52:18 UTC) #12
Valentin Villenave
What a mess. I inadvertently uploaded my "round 2" proposal onto this issue where it ...
9 years ago (2015-04-11 07:14:53 UTC) #13
dak
v.villenave@gmail.com writes: > What a mess. I inadvertently uploaded my "round 2" proposal onto this ...
9 years ago (2015-04-11 07:43:55 UTC) #14
Valentin Villenave
On 2015/04/11 07:43:55, dak wrote: > See the Button marked "Delete" in the following screen ...
9 years ago (2015-04-11 19:46:19 UTC) #15
pkx166h
9 years ago (2015-04-21 12:07:25 UTC) #16
Patch counted down - please push
Sign in to reply to this message.

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