From 59bb06a90248defb4c0be98f10afae88c2251fe7 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 10 Feb 2011 16:18:50 +0100 Subject: Eliminated Dialyzer warnings when using exit or throw. --- lib/cosNotification/src/CosNotification_Common.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/cosNotification/src') diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index 0e0f1da0d5..73a5550911 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. 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 @@ -28,7 +28,6 @@ %%--------------- INCLUDES ----------------------------------- -include_lib("orber/include/corba.hrl"). --include_lib("orber/include/ifr_types.hrl"). %% Application files -include("CosNotification.hrl"). -include("CosNotifyChannelAdmin.hrl"). @@ -947,6 +946,9 @@ check_limits(LQS, NPR) -> validate_event_qos(Wanted, Curr) -> v_e_q_helper(Wanted, Curr, []), []. + +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). v_e_q_helper([], _Curr, []) -> %% Parsed all and foynd no conflicts. ok; @@ -1071,6 +1073,8 @@ v_e_q_helper(What, _, _) -> %% LQS - local representation of QoS. %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> -- cgit v1.2.3 From 27d6af0ed32a25d7ea1dcd83a4163f8e6ec67844 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 14 Feb 2011 10:31:00 +0100 Subject: Corrected spec usage. --- lib/cosNotification/src/CosNotification_Common.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/cosNotification/src') diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index 73a5550911..1e2d9640aa 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -948,7 +948,7 @@ validate_event_qos(Wanted, Curr) -> []. %% To avoid dialyzer warnings due to the use of exit/throw. --spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). +%%-spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). v_e_q_helper([], _Curr, []) -> %% Parsed all and foynd no conflicts. ok; @@ -1074,7 +1074,7 @@ v_e_q_helper(What, _, _) -> %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ %% To avoid dialyzer warnings due to the use of exit/throw. --spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). +%%-spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> -- cgit v1.2.3 From d2bb03ce3a6a99f3e3f0abe1f74a355879437c4f Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 14 Feb 2011 14:34:00 +0100 Subject: Updsated macro EFORMAT exit handling. --- lib/cosNotification/src/CosNotification_Common.erl | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/cosNotification/src') diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index 1e2d9640aa..bcd241f3a8 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -947,8 +947,6 @@ validate_event_qos(Wanted, Curr) -> v_e_q_helper(Wanted, Curr, []), []. -%% To avoid dialyzer warnings due to the use of exit/throw. -%%-spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). v_e_q_helper([], _Curr, []) -> %% Parsed all and foynd no conflicts. ok; @@ -1073,8 +1071,6 @@ v_e_q_helper(What, _, _) -> %% LQS - local representation of QoS. %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ -%% To avoid dialyzer warnings due to the use of exit/throw. -%%-spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> -- cgit v1.2.3 From ed66dca80af9f203b9e2ae26c334820586b37fa5 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 15:51:05 +0100 Subject: More specs removed. --- lib/cosNotification/src/CosNotification_Common.erl | 44 ++++++++++++++-------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'lib/cosNotification/src') diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index bcd241f3a8..d3607a5eed 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -944,15 +944,19 @@ check_limits(LQS, NPR) -> %% supported. %%------------------------------------------------------------ validate_event_qos(Wanted, Curr) -> - v_e_q_helper(Wanted, Curr, []), - []. + case v_e_q_helper(Wanted, Curr, []) of + ok -> + []; + {error, Unsupp} -> + corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}) + end. v_e_q_helper([], _Curr, []) -> - %% Parsed all and foynd no conflicts. + %% Parsed all and found no conflicts. ok; v_e_q_helper([], _Curr, Unsupp) -> %% Not possible to use these requested QoS. - corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); + {error, Unsupp}; %%--- EventReliability ---%% v_e_q_helper([#'CosNotification_Property'{name=?not_EventReliability, @@ -1071,30 +1075,40 @@ v_e_q_helper(What, _, _) -> %% LQS - local representation of QoS. %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ -set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> +set_properties(Wanted, Current, Type, Supported, Unsupp, NewQoS, Parent, Childs, LQS) -> + case do_set_properties(Wanted, Current, Type, Supported, Unsupp, NewQoS, Parent, Childs, LQS) of + {error, Exc} -> + corba:raise(Exc); + Result -> + Result + end. + +do_set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); -set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> +do_set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> %% set_local_qos and merge_properties are help functions found at the end of QoS %% functions. NewLQS = set_local_qos(NewQoS, LQS), merge_properties(NewQoS, Curr, NewLQS); -set_properties([], _, channelAdm, _, Unsupp, _,_,_,_) -> - corba:raise(#'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}); -set_properties([], _, _, _, Unsupp, _,_,_,_) -> - corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); +do_set_properties([], _, channelAdm, _, Unsupp, _,_,_,_) -> + {error, #'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}}; +% corba:raise(#'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}); +do_set_properties([], _, _, _, Unsupp, _,_,_,_) -> + {error, #'CosNotification_UnsupportedQoS'{qos_err = Unsupp}}; +%corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); -set_properties([Req|Tail], Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) -> +do_set_properties([Req|Tail], Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) -> %% set_values and is_supported are help functions found at the end of QoS %% functions. case set_values(is_supported(Supported, Req), Req, Type, Curr, Parent, Childs,LQS) of {unsupported, U} -> - set_properties(Tail, Curr, Type, Supported, [U|Unsupp], NewQoS, Parent, Childs,LQS); + do_set_properties(Tail, Curr, Type, Supported, [U|Unsupp], NewQoS, Parent, Childs,LQS); {ok, S, NewLQS} -> - set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,NewLQS); + do_set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,NewLQS); {ok, S} -> - set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,LQS); + do_set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,LQS); ok -> - set_properties(Tail, Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) + do_set_properties(Tail, Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) end. -- cgit v1.2.3 From 4414036566181c45f592036a03a3b5898f725d95 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 15:52:20 +0100 Subject: Removed code commented out. --- lib/cosNotification/src/CosNotification_Common.erl | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/cosNotification/src') diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index d3607a5eed..af9b2d4368 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -1092,10 +1092,8 @@ do_set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> merge_properties(NewQoS, Curr, NewLQS); do_set_properties([], _, channelAdm, _, Unsupp, _,_,_,_) -> {error, #'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}}; -% corba:raise(#'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}); do_set_properties([], _, _, _, Unsupp, _,_,_,_) -> {error, #'CosNotification_UnsupportedQoS'{qos_err = Unsupp}}; -%corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); do_set_properties([Req|Tail], Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) -> %% set_values and is_supported are help functions found at the end of QoS -- cgit v1.2.3