Various minor fixes for compiler/linter (other then splint itself) warnings.
[splint-patched.git] / src / Headers / ctypeList.h
blob643b882f83965dcaa1b82b351fd368ab907e8dac
1 /*
2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
3 ** See ../LICENSE for license information.
4 **
5 */
6 # ifndef ctypeLIST_H
7 # define ctypeLIST_H
9 /*
10 ** there is a special ctypeList used to represent the () argument list
11 ** this has nelements = -1
13 ** (that is, not void, so any number of arguments is okay.)
16 struct s_ctypeList
18 int nelements;
19 int nspace;
20 /*@reldef@*/ /*@relnull@*/ ctype *elements;
21 } ;
23 extern int ctypeList_size (/*@sef@*/ ctypeList p_s) /*@*/ ;
24 # define ctypeList_size(s) (ctypeList_isDefined(s) ? (s)->nelements : 0)
26 extern /*@only@*/ ctypeList ctypeList_new(void);
27 extern void ctypeList_addh (ctypeList p_s, ctype p_el) /*@modifies p_s@*/;
29 extern void ctypeList_free (/*@only@*/ /*@only@*/ ctypeList p_s) /*@modifies p_s@*/;
31 extern /*@falsewhennull@*/ bool ctypeList_isDefined (/*@null@*/ ctypeList p_ct) /*@*/ ;
32 extern /*@unused@*/ /*@nullwhentrue@*/ bool
33 ctypeList_isUndefined (/*@null@*/ ctypeList p_ct) /*@*/ ;
35 /*@constant null ctypeList ctypeList_undefined; @*/
36 # define ctypeList_undefined ((ctypeList) NULL)
38 # define ctypeList_isDefined(ct) ((ct) != ctypeList_undefined)
39 # define ctypeList_isUndefined(ct) ((ct) == ctypeList_undefined)
41 /*@iter ctypeList_elements (sef ctypeList x, yield ctype el); @*/
42 # define ctypeList_elements(x, m_el) \
43 { if (!ctypeList_isUndefined(x)) \
44 { int m_ind; ctype *m_elements = &((x)->elements[0]); \
45 for (m_ind = 0 ; m_ind < (x)->nelements; m_ind++) \
46 { ctype m_el = *(m_elements++);
48 # define end_ctypeList_elements }}}
50 /*@constant int ctypeListBASESIZE;@*/
51 # define ctypeListBASESIZE SMALLBASESIZE
53 # else
54 # error "Multiple include"
55 # endif