lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: T1265 - Remove deprecation warnings when running with Guile V2 (issu


From: ianhulin44
Subject: Re: T1265 - Remove deprecation warnings when running with Guile V2 (issue2204044)
Date: Sun, 03 Oct 2010 19:56:13 +0000

New patch-set uploaded.

I've added changes to dispatcher.cc as suggested by Patrick.
scm_to_uint32 --> scm_to_int in guile-compatibility.hh and
grob-array-scheme.cc,
#else // comments changed as requested.

Cheers,
Ian


http://codereview.appspot.com/2204044/diff/7001/flower/include/guile-compatibility.hh
File flower/include/guile-compatibility.hh (right):

http://codereview.appspot.com/2204044/diff/7001/flower/include/guile-compatibility.hh#newcode29
flower/include/guile-compatibility.hh:29: #define scm_from_unsigned(x)
scm_from_unsigned_integer (x)
On 2010/09/30 20:53:31, Patrick McCarty wrote:
Why keep these if you don't want to use scm_{to,from}_unsigned()
anywhere?

Also, the scm_{to,from}_unsigned_integer() functions were introduced
at the very
beginning of the 1.7.* series, so I don't think we need any
compatibility macros
here.

1. I was trying to disturb as little as possible for 1.8.7
2. scm_from_unsigned(x) does map through to scm_from_unsigned_integer
but scm_to_unsigned(x) needs extra parameters if you use
scm_to_unsigned_integer, something like scm_to_unsigned_integer(x, 0,
UINTMAX_MAX).

Unfortunately UINT*_MAX constants are not declared in the Guile V1.8.7
header files so we can't use them on both platforms.

Also there's a small chance that some users may have one of these in
scm code within one of their .ly files.

Ian

http://codereview.appspot.com/2204044/diff/7001/flower/include/guile-compatibility.hh#newcode30
flower/include/guile-compatibility.hh:30: #else  // SCM_MINOR_VERSION >
6 && SCM_MINOR_VERSION < 9
On 2010/09/30 20:53:31, Patrick McCarty wrote:
For clarity, I would write

#else // SCM_MINOR_VERSION >= 9

Done.

http://codereview.appspot.com/2204044/diff/7001/flower/include/guile-compatibility.hh#newcode35
flower/include/guile-compatibility.hh:35: #else  // SCM_MAJOR_VERSION ==
1
On 2010/09/30 20:53:31, Patrick McCarty wrote:
And here:

#else // SCM_MAJOR_VERSION != 1

This helps me see that this is an else block

Done.

http://codereview.appspot.com/2204044/diff/7001/lily/grob-array-scheme.cc
File lily/grob-array-scheme.cc (right):

http://codereview.appspot.com/2204044/diff/7001/lily/grob-array-scheme.cc#newcode45
lily/grob-array-scheme.cc:45: vsize i = scm_to_uint32 (index);
On 2010/09/30 20:53:31, Patrick McCarty wrote:
Regarding my comments in the previous file, please change to

vsize i = scm_to_unsigned_integer (index);

instead.
This wouldn't compile.
From Guile API reference.
C Function: scm_t_uintmax scm_to_unsigned_integer (SCM x, scm_t_uintmax
min, scm_t_uintmax max)
It would have to be something like

vsize i = scm_to_unsigned_integer (index, 0, UINT32_MAX);

to avoid compilation diagnostics. Is that really clearer than using
scm_to_unit32, which is also supported in the Guile API?

Update:
vsize i = scm_to_unsigned_integer (index, 0, UINT32_MAX);

Doesn't compile with guile V1.8.7, saying UINT32_MAX isn't declared.

However

vsize i = scm_to_uint (index);

 does work and integration tests run OK, so I'll use that.

Cheers,

Ian

http://codereview.appspot.com/2204044/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]