On Friday 25 May 2007 18:53:08 [EMAIL PROTECTED] wrote:

> Modified: trunk/src/objects.c
> ===========================================================================
>=== --- trunk/src/objects.c (original)
> +++ trunk/src/objects.c Fri May 25 18:53:05 2007
> @@ -40,10 +40,9 @@
>  INTVAL
>  Parrot_get_vtable_index(Interp *interp, STRING *name)
>  {
> -    char  *name_c = string_to_cstring(interp, name);
> +    const char * const name_c = string_to_cstring(interp, name);
>      INTVAL low    = 0;
>      INTVAL high   = NUM_VTABLE_FUNCTIONS - 1;
> -    INTVAL i;
>  
>      /* some of the first "slots" don't have names. skip 'em. */
>      while (!Parrot_vtable_slot_names[low]) {
> @@ -52,16 +51,13 @@
>      }
>  
>      while (low <= high) {
> -        char *meth_c;
> -        int   cmp;
> -
> -        i      = (low + high) / 2;
> -        meth_c = Parrot_vtable_slot_names[i];
> +        const INTVAL i = (low + high) / 2;
> +        const char * const meth_c = Parrot_vtable_slot_names[i];

Whoops, that just broke a couple of platforms.  As I understand it, some picky 
compilers only allow simultaneous declarations and assignments at the start 
of a function, not within any block.

I realize that undoes the consting here, but portability wins.

-- c

Reply via email to