]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-array-scheme.cc
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / grob-array-scheme.cc
index 89aba0afb978268010716b370af4e7cd6a1829d7..b242addf9b82ff162260eea895f2dff8f921a998 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 */
 
@@ -30,11 +30,9 @@ LY_DEFINE (ly_grob_array_ref, "ly:grob-array-ref",
   SCM_ASSERT_TYPE (me, grob_arr, SCM_ARG1, __FUNCTION__, "Grob_array");
   SCM_ASSERT_TYPE (scm_is_integer (index), index, SCM_ARG2, __FUNCTION__, "integer");
 
-  int i = scm_to_int (index);
-  if (i < 0 || i >= me->size ())
-    {
-      scm_out_of_range (NULL, scm_from_size_t (i)); 
-    }
+  vsize i = scm_to_unsigned (index);
+  if (i == VPOS || i >= me->size ())
+    scm_out_of_range (NULL, scm_from_unsigned (i)); 
   
   return me->grob (i)->self_scm ();
 }