File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -583,9 +583,9 @@ and checkExp (isconst: bool) (e: exp) : typ =
583583 | AddrOfLabel (gref ) -> begin
584584 (* Find a label *)
585585 let lab =
586- match List. filter (function Label _ -> true | _ -> false )
586+ match List. find_opt (function Label _ -> true | _ -> false )
587587 ! gref.labels with
588- Label (lab , _ , _ ) :: _ -> lab
588+ Some ( Label (lab , _ , _ )) -> lab
589589 | _ ->
590590 ignore (warn " Address of label to block without a label" );
591591 " <missing label>"
@@ -748,9 +748,9 @@ and checkStmt (s: stmt) =
748748 currentLoc := l;
749749 (* Find a label *)
750750 let lab =
751- match List. filter (function Label _ -> true | _ -> false )
751+ match List. find_opt (function Label _ -> true | _ -> false )
752752 ! gref.labels with
753- Label (lab , _ , _ ) :: _ -> lab
753+ Some ( Label (lab , _ , _ )) -> lab
754754 | _ ->
755755 ignore (warn " Goto to block without a label" );
756756 " <missing label>"
Original file line number Diff line number Diff line change @@ -1427,7 +1427,7 @@ and filterAttributes (s: string) (al: attribute list) : attribute list =
14271427
14281428(* sm: *)
14291429let hasAttribute s al =
1430- (filterAttributes s al <> [] )
1430+ List. exists ( fun (Attr( an , _ )) -> an = s) al
14311431
14321432
14331433type attributeClass =
Original file line number Diff line number Diff line change @@ -5637,10 +5637,10 @@ and doInit
56375637 (* We have a designator *)
56385638 | _ , (what , ie ) :: restil when what != A. NEXT_INIT ->
56395639 let rec unrollDesignatorForNestedAnonymous (comp : compinfo ) (designator : string ) (whatnext : initwhat ) =
5640- let own_field = List. filter (fun fld -> fld.fname = designator) comp.cfields in
5640+ let own_field = List. find_opt (fun fld -> fld.fname = designator) comp.cfields in
56415641 match own_field with
5642- | fld :: _ -> (true , Some (A. INFIELD_INIT (designator, whatnext)))
5643- | [] ->
5642+ | Some _ -> (true , Some (A. INFIELD_INIT (designator, whatnext)))
5643+ | None ->
56445644 let anonymous_compounds = List. filter_map (fun f ->
56455645 (* f.ftype need not be unrolled here, inner anonymous struct cannot be typdef'ed *)
56465646 match f.ftype with
You can’t perform that action at this time.
0 commit comments