lilypond-devel
[Top][All Lists]
Advanced

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

Changes to allow compiling with -Werror using gcc 4.6.2 on i386. (issue


From: md5i . mail
Subject: Changes to allow compiling with -Werror using gcc 4.6.2 on i386. (issue 5489092)
Date: Tue, 20 Dec 2011 01:01:14 +0000

Reviewers: ,

Message:
A set of changes to allow lilypond to be built with -Werror using gcc
4.6.2 on i386.  I don't know if these changes are desirable, but I am
submitting them in the hopes that they may be useful.

Description:
Changes to allow compiling with -Werror using gcc 4.6.2 on i386.

Please review this at http://codereview.appspot.com/5489092/

Affected files:
  M lily/beaming-pattern.cc
  M lily/include/moment.hh
  M lily/moment.cc
  M lily/parser.yy


Index: lily/beaming-pattern.cc
diff --git a/lily/beaming-pattern.cc b/lily/beaming-pattern.cc
index 916ec145af96d0e438fe33db217439bc2d68660c..51f7ade5ed5dfe03977c85e0a2ffcf537c541992 100644
--- a/lily/beaming-pattern.cc
+++ b/lily/beaming-pattern.cc
@@ -184,7 +184,7 @@ find_location (SCM grouping, Moment base_moment, Moment start_moment,

   while (*next_group_pos < *next_beat_pos)
     {
-      int count = 1;  //default -- 1 base moments in a beam
+      I64 count = 1;  //default -- 1 base moments in a beam
       if (scm_is_pair (grouping))
         {
           count = scm_to_int (scm_car (grouping));
@@ -193,13 +193,13 @@ find_location (SCM grouping, Moment base_moment, Moment start_moment,

       // If we have a tuplet, the count should be determined from
       // the maximum tuplet size for beamed tuplets.
-      int tuplet_count = factor.num ();
+      I64 tuplet_count = factor.num ();
       if (tuplet_count > 1)
         {
           // We use 1/8 as the base moment for the tuplet because it's
           // the largest beamed value.  If the tuplet is shorter, it's
           // OK, the code still works
- int test_count = (tuplet_count * Moment (Rational (1, 8)) / base_moment).num (); + I64 test_count = (tuplet_count * Moment (Rational (1, 8)) / base_moment).num ();
           if (test_count > count) count = test_count;
         }
       *group_pos = *next_group_pos;
@@ -213,7 +213,7 @@ Beaming_pattern::find_rhythmic_importance (Beaming_options const &options)
   Moment group_pos (0);  // 0 is the start of the first group
   Moment next_group_pos (0);
   Moment next_beat_pos (options.base_moment_);
-  int tuplet_count = 1;
+  I64 tuplet_count = 1;

   SCM grouping = options.grouping_;
   vsize i = 0;
Index: lily/include/moment.hh
diff --git a/lily/include/moment.hh b/lily/include/moment.hh
index 5671d6b2342b7cbf915b017faa84e8d22fc23532..7c0618c6c803cb123ebd9f9de2a9e93a8e9ab685 100644
--- a/lily/include/moment.hh
+++ b/lily/include/moment.hh
@@ -32,7 +32,7 @@ class Moment
   DECLARE_SIMPLE_SMOBS (Moment);
 public:
   Moment ();
-  Moment (int m);
+  Moment (I64 m);

   Moment (Rational, Rational);
   Moment (Rational m);
Index: lily/moment.cc
diff --git a/lily/moment.cc b/lily/moment.cc
index 94d67a7b10596ebaf72800cae4d1eb54ad6cd356..7a2095b7c030b157d057e166dfcb5e1dc3ef7d18 100644
--- a/lily/moment.cc
+++ b/lily/moment.cc
@@ -25,7 +25,7 @@ Moment::Moment ()
 {
 }

-Moment::Moment (int m)
+Moment::Moment (I64 m)
 {
   main_part_ = Rational (m);
   grace_part_ = Rational (0);
Index: lily/parser.yy
diff --git a/lily/parser.yy b/lily/parser.yy
index 86973f3ae1971137259473873da25d79196ea2c7..02d84dd8543271aa7ffcf8349dfa75214c806861 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -33,6 +33,9 @@
 #define YYLLOC_DEFAULT(Current,Rhs,N) \
        ((Current).set_location ((Rhs)[1], (Rhs)[N]))

+/* Define to get rid of conversion warning, int -> int16_t.  This has
+   the side-effect of making the parse stack wider. */
+#define YYTYPE_INT16 int

 %}

@@ -2925,10 +2928,10 @@ number_factor:
 bare_number:
        bare_number_closed
        | UNSIGNED NUMBER_IDENTIFIER    {
-               $$ = scm_product ($1, $2)
+               $$ = scm_product ($1, $2);
        }
        | REAL NUMBER_IDENTIFIER        {
-               $$ = scm_product ($1, $2)
+               $$ = scm_product ($1, $2);
        }
        ;






reply via email to

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