]> andersk Git - splint.git/blob - src/uentryList.c
Merged this branch with the one in the splint.sf.net repository.
[splint.git] / src / uentryList.c
1 /*
2 ** Splint - annotation-assisted static program checker
3 ** Copyright (C) 1994-2002 University of Virginia,
4 **         Massachusetts Institute of Technology
5 **
6 ** This program is free software; you can redistribute it and/or modify it
7 ** under the terms of the GNU General Public License as published by the
8 ** Free Software Foundation; either version 2 of the License, or (at your
9 ** option) any later version.
10 ** 
11 ** This program is distributed in the hope that it will be useful, but
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 ** General Public License for more details.
15 ** 
16 ** The GNU General Public License is available from http://www.gnu.org/ or
17 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 ** MA 02111-1307, USA.
19 **
20 ** For information on splint: info@splint.org
21 ** To report a bug: splint-bug@splint.org
22 ** For more information: http://www.splint.org
23 */
24 /*
25 ** uentryList.c (from slist_template.c)
26 */
27
28 # include "splintMacros.nf"
29 # include "basic.h"
30
31 /*@only@*/ /*@notnull@*/ uentryList
32 uentryList_new ()
33 {
34   uentryList s = (uentryList) dmalloc (sizeof (*s));
35   
36   s->nelements = 0;
37   s->nspace = uentryListBASESIZE;
38   s->elements = (uentry *) 
39     dmalloc (sizeof (*s->elements) * uentryListBASESIZE);
40   s->current = 0;
41
42   return (s);
43 }
44
45 /*@only@*/ uentryList
46 uentryList_single (/*@keep@*/ uentry el)
47 {
48   uentryList s = (uentryList) dmalloc (sizeof (*s));
49   
50   s->nelements = 1;
51   s->nspace = uentryListBASESIZE - 1;
52   s->elements = (uentry *) dmalloc (sizeof (*s->elements) * uentryListBASESIZE);
53   
54   s->elements[0] = el;
55   s->current = 0;
56
57   return (s);
58 }
59
60 static void
61 uentryList_grow (uentryList s)
62 {
63   int i;
64   uentry *newelements;
65
66   llassert (!uentryList_isUndefined (s));
67
68   s->nspace += uentryListBASESIZE; 
69   
70   newelements = (uentry *) dmalloc (sizeof (*newelements) 
71                                     * (s->nelements + s->nspace));
72     
73   for (i = 0; i < s->nelements; i++)
74     {
75       newelements[i] = s->elements[i];
76     }
77   
78   sfree (s->elements);
79   s->elements = newelements;
80 }
81
82 void uentryList_clear (uentryList s)
83 {
84   if (uentryList_isUndefined (s))
85     {
86       ;
87     }
88   else
89     {
90       s->nspace += s->nelements;
91       s->nelements = 0;
92     }
93 }
94
95 uentryList uentryList_add (uentryList s, /*@keep@*/ uentry el)
96 {
97   if (uentryList_isUndefined (s))
98     {
99       s = uentryList_new ();
100     }
101
102   if (s->nspace <= 0)
103     uentryList_grow (s);
104   
105   s->nspace--;
106   s->elements[s->nelements] = el;
107   s->nelements++;
108
109   return s;
110 }
111
112 /*@only@*/ cstring
113   uentryList_unparse (uentryList s)
114 {
115   cstring st = cstring_undefined;
116   int i;
117   
118   if (uentryList_isDefined (s))
119     {
120       for (i = 0; i < uentryList_size (s); i++)
121         {
122           if (i == 0)
123             {
124               st = message ("%q;", uentry_unparse (s->elements[i]));
125             }
126           else
127             st = message ("%q %q;", st, uentry_unparse (s->elements[i]));
128         }
129     }
130   
131   return (st);
132 }
133
134 /*@unused@*/ /*@only@*/ cstring
135   uentryList_unparseFull (uentryList s)
136 {
137   cstring st = cstring_undefined;
138   int i;
139   
140   if (uentryList_isDefined (s))
141     {
142       for (i = 0; i < uentryList_size (s); i++)
143         {
144           if (i == 0)
145             {
146               st = message ("%q;", uentry_unparseFull (s->elements[i]));
147             }
148           else
149             {
150               st = message ("%q %q;", st, uentry_unparseFull (s->elements[i]));
151             }
152         }
153     }
154   
155   return (st);
156 }
157
158 cstring uentryList_unparseParamsComplete (uentryList s)
159 {
160   int i;
161   cstring st = cstring_undefined;
162   cstring cur;
163   
164   if (uentryList_isUndefined (s))
165     {
166       return st;
167     }
168   else if (uentryList_isVoid (s))
169     {
170       return (cstring_makeLiteral ("void"));
171     }
172   else
173     {
174       for (i = 0; i < uentryList_size (s); i++)
175         {
176           cstring cQuals, name, ctypeName;
177
178           cQuals = qualList_unparse(s->elements[i]->cQuals);
179
180           name =  uentry_getName(s->elements[i]);
181
182           if (ctype_isFunction (uentry_getType (s->elements[i])) )
183             {
184               cur = ctype_unparseFunctionPointer(uentry_getType (s->elements[i] ), cQuals, name);
185               cstring_free(cQuals);
186             }
187           else
188             {
189               ctypeName =  message("%s", ctype_unparse(uentry_getType (s->elements[i] ) ) );
190
191               if (ctype_isFixedArray (uentry_getType (s->elements[i] ) ) )
192                 {
193                   cstring aType, aSize;
194                   aType =   cstring_beforeChar(ctypeName, '[');
195                   aSize =    cstring_afterChar(ctypeName, '[');
196
197                   cur = message ("%q %q %q %s",
198                                  cQuals, aType, name, aSize  );
199
200                   //              cstring_free(ctypeName);
201                 }
202               else    if (ctype_isArray (uentry_getType (s->elements[i] ) ) )
203                 {
204                   cstring aType;
205                   aType =   cstring_beforeChar(ctypeName, '[');
206
207                   cur = message ("%s %s %s []",
208                                  cQuals, aType, name);
209
210                   //              cstring_free(ctypeName);
211                 }
212               else if (ctype_isElips (uentry_getType (s->elements[i] ) ) )
213                 {
214                   cur = message(" ... ");
215                 }
216               else
217                 {
218                   cur = message ("%s %s %s",
219                                  cQuals, ctypeName,
220                                  name  );
221                 }
222               if (qualList_hasInnerConstQualifier (s->elements[i]->cQuals) )
223                 {
224                   cur = insertInnerConstQual(cur);
225                 }
226             }
227           
228           if (i == 0)
229             {
230               st = message ("%q", cur);
231             }
232           else
233             {
234               st = message ("%q, %q",
235                             st, cur);
236             }
237         }
238       
239       return st;
240     }
241 }
242
243 cstring uentryList_unparseParams (uentryList s)
244 {
245   int i;
246   cstring st = cstring_undefined;
247
248   
249   if (uentryList_isUndefined (s))
250     {
251       return st;
252     }
253   else if (uentryList_isVoid (s))
254     {
255       return (cstring_makeLiteral ("void"));
256     }
257   else
258     {
259       for (i = 0; i < uentryList_size (s); i++)
260         {
261           if (i == 0)
262             {
263               st = message ("%s", ctype_unparse (uentry_getType (s->elements[i])));
264             }
265           else
266             {
267               st = message ("%q, %s", st, ctype_unparse (uentry_getType (s->elements[i])));
268             }
269         }
270       
271       return st;
272     }
273 }
274
275 bool uentryList_matchParams (uentryList p1, uentryList p2, bool force, bool arg)
276 {
277   int sz1 = uentryList_size (p1);
278   int sz2 = uentryList_size (p2);
279   int i;
280   
281   if (p1 == p2) return TRUE;
282
283   if (uentryList_isMissingParams (p1) || uentryList_isMissingParams (p2))
284     {
285       return TRUE;
286     }
287
288   if (sz1 != sz2)
289     return FALSE;
290
291   for (i = 0; i < sz1; i++)
292     {
293       if (!ctype_genMatch (uentry_getType (p1->elements[i]), 
294                            uentry_getType (p2->elements[i]), 
295                            force, arg, FALSE, FALSE))
296         {
297           return FALSE;
298         }
299     }
300
301   return TRUE;
302 }
303
304 /*@only@*/ cstring
305 uentryList_unparseAbbrev (uentryList p)
306 {
307   bool first = TRUE;
308   cstring s = cstring_undefined;
309   int i = 0;
310   
311   if (uentryList_isUndefined (p))
312     return s;
313
314   if (uentryList_size (p) == 0)
315     return cstring_makeLiteral ("void");
316
317   for (i = 0; i < p->nelements && i < uentryList_abbrevBreadth; i++)
318     {
319       if (first)
320         {
321           s = message ("%q;", uentry_unparseAbbrev (p->elements[i]));
322           first = FALSE;
323         }
324       else
325         {
326           s = message ("%q %q;", s, uentry_unparseAbbrev (p->elements[i]));
327         }
328     }
329   
330   if (i != uentryList_size (p))
331     s = message ("%q, ...", s);
332   
333   return (s);
334 }
335
336 static int
337 uentryList_lookupDirectName (uentryList s, cstring name)
338 {
339   if (uentryList_isDefined (s))
340     {
341       int i;
342       
343       for (i = 0; i < uentryList_size (s); i++)
344         {
345           if (cstring_equal (name, uentry_rawName (s->elements[i])))
346             {
347               return i;
348             }
349         }
350     }
351
352    return -1;
353 }
354
355 int
356 uentryList_lookupRealName (uentryList s, cstring name)
357 {
358   if (uentryList_isDefined (s))
359     {
360       int i;
361       
362       for (i = 0; i < uentryList_size (s); i++)
363         {
364           cstring uname = uentry_getName (s->elements[i]);
365
366           if (cstring_equal (name, uname))
367             {
368               cstring_free (uname);
369               return i;
370             }      
371
372           cstring_free (uname);
373         }
374     }
375
376    return -1;
377 }
378
379 uentryList uentryList_copy (uentryList s)
380 {
381   if (uentryList_isDefined (s))
382     {
383       uentryList t = (uentryList) dmalloc (sizeof (*t));
384       int i;
385       
386       t->nelements = s->nelements;
387       t->nspace = 0;
388       t->current = s->current;
389       
390       if (s->nelements > 0)
391         {
392           t->elements = (uentry *) dmalloc (sizeof (*t->elements) * t->nelements);
393           
394           for (i = 0; i < s->nelements; i++) 
395             {
396               t->elements[i] = uentry_copy (s->elements[i]); 
397             }
398         }
399       else
400         {
401           t->elements = NULL;
402         }
403       
404       return t;
405     }
406   else
407     {
408       return uentryList_undefined;
409     }
410 }
411
412 void
413 uentryList_free (uentryList s)
414 {
415   
416   if (!uentryList_isUndefined (s)) 
417     {
418       int i;
419
420       for (i = 0; i < s->nelements; i++)
421         {
422           uentry_free (s->elements[i]);  
423         }
424
425       sfree (s->elements);
426       sfree (s);
427     }
428 }
429
430 bool
431 uentryList_isVoid (uentryList cl)
432 {
433   if (cl != NULL && cl->nelements == 1)
434     {
435       return (ctype_isVoid (ctype_realType (uentry_getType (cl->elements[0]))));
436     }
437
438   return FALSE;
439 }
440
441 /*@exposed@*/ uentry
442 uentryList_getN (uentryList p, int n)
443 {
444   llassert (uentryList_isDefined (p));
445
446   if (n < 0 || (n >= uentryList_size (p)))
447     {
448       llcontbug (message ("uentryList_getN: out of range: %d (size %d)",
449                           n, uentryList_size (p)));
450       return uentry_undefined;
451     }
452
453   return (p->elements[n]);
454 }
455
456 void uentryList_fixMissingNames (uentryList cl)
457 {
458   uentryList_elements (cl, ce)
459     {
460       if (!uentry_hasRealName (ce))
461         {
462           ctype ct = uentry_getType (ce);
463
464           if (ctype_isUA (ct))
465             {
466               uentry_setName (ce, usymtab_getTypeEntryName (ctype_typeId (ct)));
467             }
468           else
469             {
470               llbug (message ("uentryList_fixMissingNames: not UA: %s", 
471                               ctype_unparse (ct)));
472             }
473
474           uentry_setType (ce, ctype_int);
475         }
476     } end_uentryList_elements;
477 }
478
479 void uentryList_fixImpParams (uentryList cl)
480 {
481   
482   if (context_getFlag (FLG_PARAMIMPTEMP))
483     {
484       uentryList_elements (cl, ce)
485         {
486           sRef s = uentry_getSref (ce);
487           alkind ak = sRef_getAliasKind (s);
488
489           if (alkind_isUnknown (ak) || alkind_isImplicit (ak))
490             {
491               exkind ek = sRef_getExKind (s);
492
493               if (exkind_isKnown (ek))
494                 {
495                   sRef_setAliasKind (s, AK_IMPDEPENDENT, fileloc_undefined);
496                 }
497               else
498                 {
499                   sRef_setAliasKind (s, AK_IMPTEMP, fileloc_undefined);
500                 }
501                     }
502           else
503             {
504                     }
505         } end_uentryList_elements;
506     }
507 }
508
509 int
510 uentryList_compareParams (uentryList s, uentryList t)
511 {
512   int i, sz;
513
514   if (s == t) return 0;
515
516   if (uentryList_isUndefined (s)) return 1;
517   if (uentryList_isUndefined (t)) return -1;
518   
519   sz = uentryList_size (s);
520   
521   INTCOMPARERETURN (uentryList_size (t), sz);
522   
523   for (i = 0; i < sz; i++)
524     {
525       COMPARERETURN (uentry_compare (s->elements[i], t->elements[i]));
526     }
527   
528   return 0;
529 }
530
531 int
532 uentryList_compareStrict (uentryList s, uentryList t)
533 {
534   int i, sz;
535
536   if (s == t) 
537     {
538       return 0;
539     }
540   
541   if (uentryList_isMissingParams (s))
542     {
543       if (uentryList_isMissingParams (t))
544         {
545           return 0;
546         }
547       else
548         {
549           return 1;
550         }
551     }
552   else 
553     {
554       if (uentryList_isMissingParams (t))
555         {
556           return -1;
557         }
558       else
559         {
560           sz = uentryList_size (s);
561           
562           INTCOMPARERETURN (uentryList_size (t), sz);
563           
564           for (i = 0; i < sz; i++)
565             {
566               COMPARERETURN (uentry_compareStrict (s->elements[i], t->elements[i]));
567             }
568           
569           return 0;
570         }
571     }
572 }
573
574 int
575 uentryList_compareFields (uentryList s, uentryList t)
576 {
577   int i, sz;
578
579   if (s == t) return 0;
580
581   if (uentryList_isUndefined (s))
582     return 1;
583   if (uentryList_isUndefined (t))
584     return -1;
585   
586   sz = uentryList_size (s);
587   
588   if (uentryList_size (t) != sz)
589     {
590       return (int_compare (sz, uentryList_size (t)));
591     }
592   
593   for (i = 0; i < sz; i++)
594     {
595       uentry se = s->elements[i];
596       uentry te = t->elements[i];
597       int namecmp = cstring_compare (uentry_rawName (se), uentry_rawName (te));
598
599       if (namecmp == 0)
600         {
601           int uc = uentry_compare (s->elements[i], t->elements[i]);
602           
603           if (uc != 0) 
604             { 
605               DPRINTF (("Bad compare: %s / %s",
606                         uentry_unparseFull (s->elements [i]),
607                         uentry_unparseFull (t->elements [i])));
608
609               return uc; 
610             }
611         }
612       else
613         {
614           return (namecmp);
615         }
616     }
617
618   return 0;
619 }
620
621 /*@exposed@*/ uentry 
622 uentryList_current (uentryList s)
623 {
624   llassert (uentryList_isDefined (s));
625   llassert (!(s->current < 0 || (s->current >= s->nelements)));
626   return (s->elements[s->current]);
627 }
628
629 cstring
630 uentryList_dumpParams (uentryList s)
631 {
632   cstring st = cstring_undefined;
633
634   if (uentryList_isUndefined (s)) return st;
635   
636   uentryList_elements (s, current)
637     {
638       DPRINTF (("Dump param: %s", uentry_unparse (current)));
639       st = message ("%q%q,", st, uentry_dumpParam (current));
640   } end_uentryList_elements;
641
642   return st;
643 }
644
645 /*@only@*/ cstring
646 uentryList_dumpFields (uentryList s)
647 {
648   cstring st = cstring_undefined;
649
650   if (uentryList_isUndefined (s)) return st;
651
652   uentryList_elements (s, current)
653   {
654     if (!uentry_isVariable (current))
655       {
656         llassert (uentry_isFunction (current));
657         DPRINTF (("Dump field: %s", uentry_unparse (current)));
658         st = message ("%q!%q,", st, uentry_dump (current));
659       }
660     else
661       {
662         DPRINTF (("Dump field: %s", uentry_unparse (current)));
663         st = message ("%q%q,", st, uentry_dump (current));
664       }
665   } end_uentryList_elements;
666   
667   return st;
668 }
669
670 /*@only@*/ uentryList 
671 uentryList_undumpFields (char **s, fileloc loc)
672 {
673   uentryList ul = uentryList_new ();
674
675   while (**s != '\0' && **s != '}') 
676     {
677       if (**s == '!')
678         {
679           reader_checkChar (s, '!');
680           ul = uentryList_add (ul, uentry_undump (ekind_function, loc, s));
681         }
682       else
683         {
684           ul = uentryList_add (ul, uentry_undump (ekind_variable, loc, s));
685         }
686       reader_checkChar (s, ',');
687     }
688
689   reader_checkChar (s, '}');
690   return ul;
691 }
692
693 /*@only@*/ uentryList
694 uentryList_undump (char **s)
695 {
696   char c;
697   uentryList pn = uentryList_new ();
698   int paramno = 0;
699
700   c = **s;
701
702   while (c != '#' && c != '@' && c != ')')
703     {
704       uentry ue = uentry_undump (ekind_variable, g_currentloc, s);
705       
706       
707       if (!uentry_isUndefined (ue))
708         {
709           pn = uentryList_add (pn, ue);
710         }
711       else
712         {
713           uentry_free (ue);
714         }
715
716       reader_checkChar (s, ',');
717       c = **s;
718       paramno++;
719     }
720
721   reader_checkChar (s, ')');
722   return pn;
723 }
724
725 void 
726 uentryList_reset (uentryList s)
727 {
728   if (uentryList_isUndefined (s)) return;
729   s->current = 0;
730 }
731
732 bool
733 uentryList_isFinished (uentryList s)
734 {
735   if (uentryList_isUndefined (s)) return TRUE;
736   return (s->current > s->nelements - 1);
737 }
738
739 void 
740 uentryList_advanceSafe (uentryList s)
741 {
742   if (uentryList_isUndefined (s)) return;
743
744   s->current++;
745
746   if (s->current > s->nelements)
747     {
748       s->current = s->nelements;
749     }
750 }
751
752 int
753 uentryList_size (uentryList s)
754 {
755   if (uentryList_isUndefined (s)) return 0;
756
757   if (uentryList_isVoid (s))
758     return 0;
759   
760   return s->nelements;
761 }
762
763 bool
764 uentryList_isMissingParams (uentryList s)
765 {
766   return (uentryList_isUndefined (s) || s->nelements == 0);
767 }
768
769 bool uentryList_hasReturned (uentryList ul)
770 {
771   uentryList_elements (ul, current)
772     {
773       if (uentry_isReturned (current)) return TRUE;
774     } end_uentryList_elements;
775
776   return FALSE;
777 }
778
779 /*@exposed@*/ uentry 
780 uentryList_lookupField (uentryList f, cstring name)
781 {
782   int i = uentryList_lookupDirectName (f, name);
783
784   if (i >= 0)
785     {
786       return (uentryList_getN (f, i));
787     }
788   else
789     {
790       uentryList_elements (f, el)
791         {
792           if (uentry_isUnnamedVariable (el))
793             {
794               ctype ct = uentry_getType (el);
795
796               if (ctype_isStruct (ct) || ctype_isUnion (ct))
797                 {
798                   uentryList fields = ctype_getFields (ct);
799                   uentry ue = uentryList_lookupField (fields, name);
800
801                   if (uentry_isValid (ue))
802                     {
803                       return ue;
804                     }
805                 }
806             }
807         }
808       end_uentryList_elements ;
809
810       return uentry_undefined;
811     }
812 }
813
814 /*@only@*/ uentryList
815   uentryList_mergeFields (/*@only@*/ uentryList f1, /*@only@*/ uentryList f2)
816 {
817   DPRINTF (("Merge: %s + %s", uentryList_unparse (f1), uentryList_unparse (f2)));
818
819   if (uentryList_isUndefined (f1))
820     {
821       return  (f2);
822     }
823
824   if (uentryList_isDefined (f2))
825     {
826       uentryList_elements (f2, current)
827         {
828           uentry old = uentryList_lookupField (f1, uentry_rawName (current));
829           
830           if (uentry_isValid (old))
831             {
832               voptgenerror
833                 (FLG_SYNTAX,
834                  message ("Field name reused: %s", uentry_rawName (current)),
835                  uentry_whereDefined (current));
836               llgenmsg (message ("Previous use of %s", uentry_rawName (current)),
837                         uentry_whereDefined (old));
838             }
839           
840           /* okay to use exposed current since f2 is killed */
841           /*@-exposetrans@*/ /*@-dependenttrans@*/
842           f1 = uentryList_add (f1, current); 
843           /*@=exposetrans@*/ /*@=dependenttrans@*/
844
845         } end_uentryList_elements;
846       
847       sfree (f2->elements);
848       sfree (f2);
849     }
850
851   return (f1);
852 }
853
854 void
855 uentryList_showFieldDifference (uentryList p1, uentryList p2)
856 {
857   uentry cp1, cp2;
858   int index;
859
860   llassert (NOALIAS (p1, p2));
861   llassert (uentryList_isDefined (p1));
862   llassert (uentryList_isDefined (p2));
863   
864   for (index = 0; index < p1->nelements; index++)
865     {
866       cp1 = p1->elements[index];
867
868       if (index == p2->nelements)
869         {
870           llgenindentmsg
871             (message ("Field present in %s, missing in %rdeclaration: %q", 
872                       uentry_specDeclName (cp1),
873                       uentry_isDeclared (cp1),
874                       uentry_unparse (cp1)),
875              uentry_whereEither (cp1));
876           return;
877         }
878           
879       cp2 = p2->elements[index];
880
881       if (!(cstring_equal (uentry_rawName (cp1), uentry_rawName (cp2))))
882         {
883           llgenindentmsg 
884             (message ("Field %s in %s corresponds to %s in %rdeclaration", 
885                       uentry_rawName (cp1),
886                       uentry_specOrDefName (cp1),
887                       uentry_rawName (cp2),
888                       uentry_isCodeDefined (cp1)),
889              uentry_whereDefined (cp2));
890           uentry_showWhereLastPlain (cp1);
891           return;
892         }
893       else 
894         {
895           /* evs 2000-07-25 was ctype_match, should match uentryList_matchFields */
896
897           if (!ctype_almostEqual (uentry_getType (cp1), uentry_getType (cp2)))
898             {
899               llgenindentmsg 
900                 (message ("Field %s %rdeclared as %s, %s as %s",
901                           uentry_rawName (cp2),
902                           uentry_isCodeDefined (cp1),
903                           ctype_unparse (uentry_getType (cp1)),
904                           uentry_specOrDefName (cp2),
905                           ctype_unparse (uentry_getType (cp2))),
906                  uentry_whereDefined (cp2));
907               uentry_showWhereLastPlain (cp1);
908               return;
909             }
910         }
911     }
912
913   if (index != p2->nelements)
914     {
915       cp2 = p2->elements[index];
916
917       llgenindentmsg 
918         (message ("Extra field in new declaration: %q",
919                   uentry_unparse (cp2)),
920          uentry_whereEither (cp2));
921
922       return;
923     }
924
925   llbug (message ("uentryList_showFieldDifference: match: %q / %q",
926                   uentryList_unparse (p1), uentryList_unparse (p2)));
927 }
928
929 bool
930 uentryList_equivFields (uentryList p1, uentryList p2)
931 {
932   return (uentryList_compareFields (p1, p2) == 0);
933 }
934
935 bool
936 uentryList_matchFields (uentryList p1, uentryList p2)
937 {
938   int index;
939   uentry cp1, cp2;
940
941   if (p1 == p2) 
942     {
943       return (TRUE);
944     }
945
946   if (uentryList_isEmpty (p1) || uentryList_isEmpty (p2))
947     {
948       return (TRUE);
949     }
950
951   if (uentryList_size (p1) != uentryList_size (p2))
952     {
953       return FALSE;
954     }
955
956   for (index = 0; index < p1->nelements; index++)
957     {
958       cp1 = p1->elements[index];
959       cp2 = p2->elements[index];
960
961       /*@i32*/
962       /*
963       ** Should compare uentry's --- need to fix report errors too.
964       */
965
966       if (!(cstring_equal (uentry_rawName (cp1), uentry_rawName (cp2))
967             && (ctype_almostEqual (uentry_getType (cp1), uentry_getType (cp2)))))
968         { 
969           return FALSE;
970         }
971     }
972
973   return TRUE;
974 }
This page took 0.117794 seconds and 5 git commands to generate.