From: Siraaj Khandkar Date: Fri, 27 Jul 2012 03:18:37 +0000 (-0400) Subject: Explicitly matching casts with 'ok'. X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=1d121bcf9312f8c869537e5d28f2c2964fe35169;p=cellular-automata.git Explicitly matching casts with 'ok'. --- diff --git a/001/src/life_cell.erl b/001/src/life_cell.erl index ada70e6..e7cebcd 100644 --- a/001/src/life_cell.erl +++ b/001/src/life_cell.erl @@ -80,7 +80,7 @@ handle_cast({next_gen, GenID}, %% possible. The more there're cells, the more likely this is to happen.) handle_cast({state_broadcast, ReceivedGenID, _NeighborState}=Msg, #state{gen_id=GenID, name=Name}=State) when GenID =/= ReceivedGenID-> - gen_server:cast(Name, Msg), + ok = gen_server:cast(Name, Msg), {noreply, State}; diff --git a/001/src/life_time.erl b/001/src/life_time.erl index 49ab646..2552421 100644 --- a/001/src/life_time.erl +++ b/001/src/life_time.erl @@ -62,7 +62,7 @@ init([X, Y, Cells]) -> ,replies_pending = 0 ,gen_id = 0 }, - schedule_next_gen(), + ok = schedule_next_gen(), {ok, State}. @@ -117,7 +117,7 @@ handle_cast({report_state, {CellID, GenID, CellState}}, ok = do_print_bar(X), ok = do_print_state_chars(X, StateChars), ok = timer:sleep(?INTERVAL), - schedule_next_gen(), + ok = schedule_next_gen(), {noreply, NewState#state{state_pairs=[]}}; _N -> @@ -137,7 +137,7 @@ handle_info(_Msg, State) -> %% ============================================================================ schedule_next_gen() -> - gen_server:cast(?MODULE, next_gen). + ok = gen_server:cast(?MODULE, next_gen). cast_all([], _) -> ok;