From faa6a36586dd1fe8a3a6bb2507c9b02781b4d386 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 15 Apr 2019 14:27:47 +0200 Subject: [snmp|agent] Fix types There no timestamp type in os (but there is in erlang). --- lib/snmp/src/misc/snmp_misc.erl | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'lib/snmp/src') diff --git a/lib/snmp/src/misc/snmp_misc.erl b/lib/snmp/src/misc/snmp_misc.erl index 0cc04d4056..39254503ac 100644 --- a/lib/snmp/src/misc/snmp_misc.erl +++ b/lib/snmp/src/misc/snmp_misc.erl @@ -151,41 +151,41 @@ formated_long_timestamp() -> %% the date in the formatted timestamp. %% --------------------------------------------------------------------------- --spec format_timestamp(Now :: os:timestamp()) -> +-spec format_timestamp(Now :: erlang:timestamp()) -> string(). format_timestamp(Now) -> format_long_timestamp(Now). --spec format_short_timestamp(Now :: os:timestamp()) -> +-spec format_short_timestamp(Now :: erlang:timestamp()) -> string(). format_short_timestamp(Now) -> N2T = fun(N) -> calendar:now_to_local_time(N) end, format_timestamp(short, Now, N2T). --spec format_long_timestamp(Now :: os:timestamp()) -> +-spec format_long_timestamp(Now :: erlang:timestamp()) -> string(). format_long_timestamp(Now) -> N2T = fun(N) -> calendar:now_to_local_time(N) end, format_timestamp(long, Now, N2T). --spec format_timestamp(Now :: os:timestamp(), +-spec format_timestamp(Now :: erlang:timestamp(), N2T :: function()) -> string(). format_timestamp(Now, N2T) when is_tuple(Now) andalso is_function(N2T) -> format_long_timestamp(Now, N2T). --spec format_short_timestamp(Now :: os:timestamp(), +-spec format_short_timestamp(Now :: erlang:timestamp(), N2T :: function()) -> string(). format_short_timestamp(Now, N2T) when is_tuple(Now) andalso is_function(N2T) -> format_timestamp(short, Now, N2T). --spec format_long_timestamp(Now :: os:timestamp(), +-spec format_long_timestamp(Now :: erlang:timestamp(), N2T :: function()) -> string(). @@ -195,14 +195,8 @@ format_long_timestamp(Now, N2T) when is_tuple(Now) andalso is_function(N2T) -> format_timestamp(Format, {_N1, _N2, N3} = Now, N2T) -> {Date, Time} = N2T(Now), do_format_timestamp(Format, Date, Time, N3). - %% case Format of - %% short -> - %% do_format_short_timestamp(Time, N3); - %% long -> - %% do_format_long_timestamp(Date, Time, N3) - %% end. - -do_format_timestamp(short, Date, Time, N3) -> + +do_format_timestamp(short, _Date, Time, N3) -> do_format_short_timestamp(Time, N3); do_format_timestamp(long, Date, Time, N3) -> do_format_long_timestamp(Date, Time, N3). -- cgit v1.2.3