X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Ftype.c;h=a1563d04a494e776f5195e9b51074dd5b09aca18;hb=0dee0e75e8a541ad435e9af431c426c53f155d71;hp=0961eb141d32b8dd244e0f00738a46c708c69446;hpb=2312de30ce2be53f81c4eaaa772ffff21511b509;p=lttv.git diff --git a/ltt/branches/poly/ltt/type.c b/ltt/branches/poly/ltt/type.c index 0961eb14..a1563d04 100644 --- a/ltt/branches/poly/ltt/type.c +++ b/ltt/branches/poly/ltt/type.c @@ -1,19 +1,20 @@ /* This file is part of the Linux Trace Toolkit viewer - * Copyright (C) 2003-2004 Xiangxiu Yang, Mathieu Desnoyers + * Copyright (C) 2003-2004 Xiangxiu Yang + * 2005 Mathieu Desnoyers * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License Version 2 as - * published by the Free Software Foundation; + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License Version 2.1 as published by the Free Software Foundation. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H @@ -213,23 +214,22 @@ LttType *ltt_type_element_type(LttType *t) /***************************************************************************** *Function name - * ltt_type_element_number : obtain the number of elements for arrays + * ltt_type_element_number : obtain the number of elements for enums *Input params - * t : a type + * t : a type *Return value * unsigned : the number of elements for arrays ****************************************************************************/ -#if 0 unsigned ltt_type_element_number(LttType *t) { unsigned ret = 0; - if(likely(t->type_class == LTT_ARRAY)) - ret = t->element_number; + if(likely(t->type_class == LTT_ENUM)) + ret = g_hash_table_size(t->enum_map); return ret; } -#endif //0 + /***************************************************************************** *Function name * ltt_type_member_number : obtain the number of data members for structure