From 6b2aa68d78b43449598a82ef488343f7b9fe07ea Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Mon, 7 Mar 2016 22:35:46 +0100 Subject: Fix dialyzer warnings Whether making record declarations unreadable to compensate for dialyzer's ignorance of match specs is worth it is truly debatable. --- lib/diameter/src/base/diameter_service.erl | 19 +++++++++---------- lib/diameter/src/base/diameter_traffic.erl | 4 +++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index d83ed9e56b..cc4bb60ef7 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2015. All Rights Reserved. +%% Copyright Ericsson AB 2010-2016. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -136,16 +136,16 @@ peer = false :: match(boolean() | pid())}). %% true at accepted, pid() at okay/reopen -%% Record representing an Peer State Machine processes implemented by +%% Record representing a Peer State Machine processes implemented by %% diameter_peer_fsm. -record(peer, - {pid :: pid(), - apps :: [{0..16#FFFFFFFF, diameter:app_alias()}] %% {Id, Alias} - | [diameter:app_alias()], %% remote - caps :: #diameter_caps{}, + {pid :: pid(), + apps :: match([{0..16#FFFFFFFF, diameter:app_alias()}] %% {Id, Alias} + | [diameter:app_alias()]), %% remote + caps :: match(#diameter_caps{}), started = now(), %% at process start or sharing - watchdog :: pid() %% key into watchdogT - | undefined}). %% undefined if remote + watchdog :: match(pid() %% key into watchdogT + | undefined)}). %% undefined if remote %% --------------------------------------------------------------------------- %% # start/1 @@ -579,8 +579,7 @@ init_peers({PeerT, _, _} = T, F) PeerT); %% Populate #peer{} table given a shared peers dict. -init_peers({PeerT, _, _}, SDict) - when is_integer(SDict) -> +init_peers({PeerT, _, _}, SDict) -> dict:fold(fun(P, As, N) -> ets:update_element(PeerT, P, {#peer.apps, As}), N+1 diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl index 004c1e80d5..401e7908b2 100644 --- a/lib/diameter/src/base/diameter_traffic.erl +++ b/lib/diameter/src/base/diameter_traffic.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2013-2015. All Rights Reserved. +%% Copyright Ericsson AB 2013-2016. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1574,6 +1574,8 @@ answer(Pkt, Req) -> a(Pkt, SvcName, ModX, AE, Req). +-spec a(_, _, _) -> no_return(). %% silence dialyzer + a(#diameter_packet{errors = Es} = Pkt, SvcName, -- cgit v1.2.3