Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add dialyzer targets #89

Merged
merged 2 commits into from

2 participants

@rzezeski
  • Add dialyzer targets: build_plt, dialyzer and clean_plt.

  • Fix obvious type mistake (change record() to tuple()).

There are some dialyzer errors but I didn't attempt to fix them because I don't have the time to parse the bitcask code and determine the semantics.

rzezeski added some commits
@rzezeski rzezeski Add dialyzer targets to Makefile 5a08d16
@rzezeski rzezeski Fix unknown type
The original author of this spec used the type `record()` but I'm
pretty sure `tuple()` was intended as a record is really just a tuple
at runtime.
dcff19d
@slfritchie
Owner

+1, thanks!

@rzezeski rzezeski merged commit 1bbb5ec into master
@engelsanchez engelsanchez deleted the rz-add-dialyzer-targets branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 22, 2013
  1. @rzezeski
  2. @rzezeski

    Fix unknown type

    rzezeski authored
    The original author of this spec used the type `record()` but I'm
    pretty sure `tuple()` was intended as a record is really just a tuple
    at runtime.
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 2 deletions.
  1. +13 −0 Makefile
  2. +2 −2 src/bitcask.erl
View
13 Makefile
@@ -65,3 +65,16 @@ pkgclean:
$(MAKE) -C package pkgclean
export BITCASK_TAG PKG_VERSION REPO REVISION
+
+APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
+ xmerl webtool snmp public_key mnesia eunit syntax_tools compiler
+PLT = $(HOME)/.bitcask_dialyzer_plt
+
+build_plt: deps compile
+ dialyzer --build_plt --output_plt $(PLT) --apps $(APPS) deps/*/ebin
+
+dialyzer: deps compile
+ dialyzer -Wno_return --plt $(PLT) ebin
+
+clean_plt:
+ rm $(PLT)
View
4 src/bitcask.erl
@@ -312,7 +312,7 @@ fold_keys(Ref, Fun, Acc0, MaxAge, MaxPut) ->
%% @doc fold over all K/V pairs in a bitcask datastore.
%% Fun is expected to take F(K,V,Acc0) -> Acc
--spec fold(reference() | record(),
+-spec fold(reference() | tuple(),
fun((binary(), binary(), any()) -> any()),
any()) -> any() | {error, any()}.
fold(Ref, Fun, Acc0) when is_reference(Ref)->
@@ -326,7 +326,7 @@ fold(State, Fun, Acc0) ->
%% @doc fold over all K/V pairs in a bitcask datastore specifying max age/updates of
%% the frozen keystore.
%% Fun is expected to take F(K,V,Acc0) -> Acc
--spec fold(reference() | record(), fun((binary(), binary(), any()) -> any()), any(),
+-spec fold(reference() | tuple(), fun((binary(), binary(), any()) -> any()), any(),
non_neg_integer() | undefined, non_neg_integer() | undefined) ->
any() | {error, any()}.
fold(Ref, Fun, Acc0, MaxAge, MaxPut) when is_reference(Ref)->
Something went wrong with that request. Please try again.