fn hfa_length(t: &P<MuType>) -> usize {
    match t.v {
        MuType_::Struct(ref name) => {
            let read_lock = STRUCT_TAG_MAP.read().unwrap();
            let struc = read_lock.get(name).unwrap();
            let tys = struc.get_tys();
            if tys.len() < 1 || tys.len() > 4 {
                return 0;
            }

            let ref base = tys[0];
            match base.v {
                MuType_::Float | MuType_::Double => {
                    for i in 1..tys.len() - 1 {
                        if tys[i].v != base.v {
                            return 0;
                        }
                    }
                    return tys.len(); // All elements are the same type
                }
                _ => return 0
            }


        } // TODO: how do I extra the list of member-types from this??
        MuType_::Array(ref base, n) if n <= 4 => {
            match base.v {
                MuType_::Float | MuType_::Double => n,
                _ => 0
            }
        }
        _ => 0

    }
}
// if t is a homogenouse floating point aggregate (i.e. an array or struct
// where each element is the same floating-point type, and there are at most 4 elements)
// returns the number of elements, otherwise returns 0
if t is a homogenouse floating point aggregate
returns the number of elements, otherwise returns 0
if t is a homogenouse floating point aggregate returns the number of elements otherwise returns 0
fn hfa_length(t: &P<MuType>) -> usize {
    match t.v {
        MuType_::Struct(ref name) => {
            let read_lock = STRUCT_TAG_MAP.read().unwrap();
            let struc = read_lock.get(name).unwrap();
            let tys = struc.get_tys();
            if tys.len() < 1 || tys.len() > 4 {
                return 0;
            }
            let ref base = tys[0];
            match base.v {
                MuType_::Float | MuType_::Double => {
                    for i in 1..tys.len() - 1 {
                        if tys[i].v != base.v {
                            return 0;
                        }
                    }
                    return tys.len(); // All elements are the same type
                }
                _ => return 0
            }
        } // TODO: how do I extra the list of member-types from this??
        MuType_::Array(ref base, n) if n <= 4 => {
            match base.v {
                MuType_::Float | MuType_::Double => n,
                _ => 0
            }
        }
        _ => 0
    }
}
fn hfa_length ( t : & P < MuType > ) -> usize { match t . v { MuType_ :: Struct ( ref name ) => { let read_lock = STRUCT_TAG_MAP . read ( ) . unwrap ( ) ; let struc = read_lock . get ( name ) . unwrap ( ) ; let tys = struc . get_tys ( ) ; if tys . len ( ) < 1 || tys . len ( ) > 4 { return 0 ; } let ref base = tys [ 0 ] ; match base . v { MuType_ :: Float | MuType_ :: Double => { for i in 1 .. tys . len ( ) - 1 { if tys [ i ] . v != base . v { return 0 ; } } return tys . len ( ) ; // All elements are the same type } _ => return 0 } } // TODO: how do I extra the list of member-types from this?? MuType_ :: Array ( ref base , n ) if n <= 4 => { match base . v { MuType_ :: Float | MuType_ :: Double => n , _ => 0 } } _ => 0 } }
if t is a homogenouse floating point aggregate (i.e.
if t is a homogenouse floating point aggregate ( i . e .
t
&P<MuType>
t
&P<MuType>