Skip to content

Commit abbcca3

Browse files
Mas 310 merge (#990)
Merge in 3.0.10 updates, as well as removal of deprecated functions pre OTP 22 Co-authored-by: Thomas Arts <thomas.arts@quviq.com>
1 parent f15acd3 commit abbcca3

16 files changed

+45
-102
lines changed

eqc/hashtree_eqc.erl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,8 @@
6666
integer_to_binary(Int) ->
6767
list_to_binary(integer_to_list(Int)).
6868

69-
-ifndef(old_hash).
7069
sha(Bin) ->
7170
crypto:hash(sha, Bin).
72-
-else.
73-
sha(Bin) ->
74-
crypto:sha(Bin).
75-
-endif.
7671

7772
key() ->
7873
?LET(Key, int(), ?MODULE:integer_to_binary(Key)).

include/riak_core.hrl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
-ifdef(namespaced_types).
21
-type riak_core_dict() :: dict:dict().
3-
-type riak_core_set() :: sets:set().
4-
-else.
5-
-type riak_core_dict() :: dict().
6-
-type riak_core_set() :: set().
7-
-endif.
2+
-type riak_core_set() :: sets:set().

include/riak_core_handoff.hrl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
-ifdef(namespaced_types).
21
-type riak_core_handoff_dict() :: dict:dict().
3-
-else.
4-
-type riak_core_handoff_dict() :: dict().
5-
-endif.
62

73
-define(PT_MSG_INIT, 0).
84
-define(PT_MSG_OBJ, 1).

rebar.config

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55

66
{cover_enabled, true}.
77

8-
{erl_opts, [warnings_as_errors,
9-
debug_info,
10-
{platform_define, "^[0-9]+", namespaced_types},
11-
{platform_define, "^R15", "old_hash"},
12-
{platform_define, "^[2-9][1-9][0-9]*(.?[0-9]*)", deprecated_21},
13-
{platform_define, "^[2-9][2-9][0-9]*(.?[0-9]*)", deprecated_22}]}.
8+
{erl_opts, [warnings_as_errors, debug_info]}.
149

1510
{edoc_opts, [{preprocess, true}]}.
1611

src/chash.erl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,8 @@ lookup(IndexAsInt, CHash) ->
9797
{IndexAsInt, X} = proplists:lookup(IndexAsInt, Nodes),
9898
X.
9999

100-
-ifndef(old_hash).
101100
sha(Bin) ->
102101
crypto:hash(sha, Bin).
103-
-else.
104-
sha(Bin) ->
105-
crypto:sha(Bin).
106-
-endif.
107102

108103
%% @doc Given any term used to name an object, produce that object's key
109104
%% into the ring. Two names with the same SHA-1 hash value are

src/hashtree.erl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,8 @@
135135

136136
-include_lib("kernel/include/logger.hrl").
137137

138-
-ifdef(namespaced_types).
139138
-type hashtree_dict() :: dict:dict().
140139
-type hashtree_array() :: array:array().
141-
-else.
142-
-type hashtree_dict() :: dict().
143-
-type hashtree_array() :: array().
144-
-endif.
145140

146141
-define(ALL_SEGMENTS, ['*', '*']).
147142
-define(BIN_TO_INT(B), list_to_integer(binary_to_list(B))).
@@ -638,7 +633,6 @@ get_bucket(Level, Bucket, State) ->
638633
%%% Internal functions
639634
%%%===================================================================
640635

641-
-ifndef(old_hash).
642636
md5(Bin) ->
643637
crypto:hash(md5, Bin).
644638

@@ -655,25 +649,7 @@ esha_update(Ctx, Bin) ->
655649

656650
esha_final(Ctx) ->
657651
crypto:hash_final(Ctx).
658-
-else.
659-
md5(Bin) ->
660-
crypto:md5(Bin).
661652

662-
-ifdef(TEST).
663-
esha(Bin) ->
664-
crypto:sha(Bin).
665-
-endif.
666-
667-
esha_init() ->
668-
crypto:sha_init().
669-
670-
esha_update(Ctx, Bin) ->
671-
crypto:sha_update(Ctx, Bin).
672-
673-
esha_final(Ctx) ->
674-
crypto:sha_final(Ctx).
675-
676-
-endif.
677653

678654
-spec set_bucket(integer(), integer(), any(), hashtree()) -> hashtree().
679655
set_bucket(Level, Bucket, Val, State) ->

src/hashtree_tree.erl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,7 @@
119119

120120
-export_type([tree/0, tree_node/0, handler_fun/1, remote_fun/0]).
121121

122-
-ifdef(namespaced_types).
123122
-type hashtree_gb_set() :: gb_sets:set().
124-
-else.
125-
-type hashtree_gb_set() :: gb_set().
126-
-endif.
127123

128124
-record(hashtree_tree, {
129125
%% the identifier for this tree. used as part of the ids

src/riak_core_gen_server.erl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,8 @@
182182
%%% Preprocessor
183183
%%%=========================================================================
184184

185-
-ifdef(deprecated_22).
186185
get_log(Debug) ->
187186
sys:get_log(Debug).
188-
-else.
189-
get_log(Debug) ->
190-
sys:get_debug(log, Debug, []).
191-
-endif.
192187

193188
%%% -----------------------------------------------------------------
194189
%%% Starts a generic server.

src/riak_core_handoff_receiver.erl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,8 @@
5252
%% set the timeout for the vnode to process the handoff_data msg to 60s
5353
-define(VNODE_TIMEOUT, 60000).
5454

55-
-ifdef(deprecated_21).
5655
ssl_handshake(Socket, SslOpts, Timeout) ->
5756
ssl:handshake(Socket, SslOpts, Timeout).
58-
-else.
59-
ssl_handshake(Socket, SslOpts, Timeout) ->
60-
ssl:ssl_accept(Socket, SslOpts, Timeout).
61-
-endif.
6257

6358
start_link() ->
6459
start_link([]).

src/riak_core_node_watcher.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ service_down(Id) ->
135135
gen_server:call(?MODULE, {service_down, Id}, infinity).
136136

137137
service_down(Id, true) ->
138-
gen_server:call(?MODULE, {service_down, Id, health_check}, infinitiy);
138+
gen_server:call(?MODULE, {service_down, Id, health_check}, infinity);
139139
service_down(Id, false) ->
140140
service_down(Id).
141141

0 commit comments

Comments
 (0)