diff options
author | Hans Bolinder <[email protected]> | 2011-09-02 08:43:14 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2011-09-02 08:43:14 +0200 |
commit | 1eac5476aa7faad600bb940ca3fe07be78273425 (patch) | |
tree | c5d73b53f588503d3f872e413716b3a9b2e3c91b /lib/stdlib/src | |
parent | 8fc59a1ff776a472299db26b175da09a03b3d30b (diff) | |
parent | bb94e589c8495caf7c1fa6ebe808f6983ceaf44a (diff) | |
download | otp-1eac5476aa7faad600bb940ca3fe07be78273425.tar.gz otp-1eac5476aa7faad600bb940ca3fe07be78273425.tar.bz2 otp-1eac5476aa7faad600bb940ca3fe07be78273425.zip |
Merge branch 'dev' into major
* dev:
Fix a couple of minor bugs with hook priority
Update to reflect addition of CTH priority addition
Update CTH priority default to be 0
Update to reflect new cth callback api
Update the return from init/2 to be {ok, NewState} or {ok,NewState,Priority} instead of NewState.
Add priority functionality and tests for ct hooks
Update internal hooks state to use a record instead of tuples
Improve and correct types and specifications in Kernel and STDLIB
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/dets.erl | 13 | ||||
-rw-r--r-- | lib/stdlib/src/escript.erl | 6 | ||||
-rw-r--r-- | lib/stdlib/src/io_lib.erl | 4 | ||||
-rw-r--r-- | lib/stdlib/src/sofs.erl | 5 | ||||
-rw-r--r-- | lib/stdlib/src/sys.erl | 4 |
5 files changed, 19 insertions, 13 deletions
diff --git a/lib/stdlib/src/dets.erl b/lib/stdlib/src/dets.erl index 671b5a9dd4..fa0641ffd9 100644 --- a/lib/stdlib/src/dets.erl +++ b/lib/stdlib/src/dets.erl @@ -411,7 +411,8 @@ init_table(Tab, InitFun) -> InitFun :: fun((Arg) -> Res), Arg :: read | close, Res :: end_of_input | {[object()], InitFun} | {Data, InitFun} | term(), - Options :: [{min_no_slots,no_slots()} | {format,term | bchunk}], + Options :: Option | [Option], + Option :: {min_no_slots,no_slots()} | {format,term | bchunk}, Reason :: term(), Data :: binary() | tuple(). @@ -871,11 +872,15 @@ to_ets(DTab, ETab) -> -spec traverse(Name, Fun) -> Return | {'error', Reason} when Name :: tab_name(), Fun :: fun((Object) -> FunReturn), - FunReturn :: 'continue' | {'continue', Val} | {'done', Value}, + Object :: object(), + FunReturn :: 'continue' + | {'continue', Val} + | {'done', Value} + | OtherValue, + Return :: [term()] | OtherValue, Val :: term(), Value :: term(), - Object :: object(), - Return :: [term()], + OtherValue :: term(), Reason :: term(). traverse(Tab, Fun) -> diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl index 2325bb63e5..ad49d89908 100644 --- a/lib/stdlib/src/escript.erl +++ b/lib/stdlib/src/escript.erl @@ -62,10 +62,10 @@ -type zip_create_option() :: term(). -type section() :: shebang - | {shebang, shebang()} + | {shebang, shebang() | default | undefined} | comment - | {comment, comment()} - | {emu_args, emu_args()} + | {comment, comment() | default | undefined} + | {emu_args, emu_args() | undefined} | {source, file:filename() | binary()} | {beam, file:filename() | binary()} | {archive, file:filename() | binary()} diff --git a/lib/stdlib/src/io_lib.erl b/lib/stdlib/src/io_lib.erl index 165e03e506..0252cdf742 100644 --- a/lib/stdlib/src/io_lib.erl +++ b/lib/stdlib/src/io_lib.erl @@ -109,9 +109,9 @@ fwrite(Format, Args) -> fread(Chars, Format) -> io_lib_fread:fread(Chars, Format). --spec fread(Continuation, String, Format) -> Return when +-spec fread(Continuation, CharSpec, Format) -> Return when Continuation :: continuation() | [], - String :: string(), + CharSpec :: string() | eof, Format :: string(), Return :: {'more', Continuation1 :: continuation()} | {'done', Result, LeftOverChars :: string()}, diff --git a/lib/stdlib/src/sofs.erl b/lib/stdlib/src/sofs.erl index d38b8ab37a..34eb224647 100644 --- a/lib/stdlib/src/sofs.erl +++ b/lib/stdlib/src/sofs.erl @@ -81,7 +81,8 @@ -define(ORDTAG, 'OrdSet'). -record(?TAG, {data = [] :: list(), type = type :: term()}). --record(?ORDTAG, {orddata = {} :: tuple(), ordtype = type :: term()}). +-record(?ORDTAG, {orddata = {} :: tuple() | atom(), + ordtype = type :: term()}). -define(LIST(S), (S)#?TAG.data). -define(TYPE(S), (S)#?TAG.type). @@ -375,7 +376,7 @@ to_sets(S) when ?IS_ORDSET(S) -> -spec(no_elements(ASet) -> NoElements when ASet :: a_set() | ordset(), - NoElements :: pos_integer()). + NoElements :: non_neg_integer()). no_elements(S) when ?IS_SET(S) -> length(?LIST(S)); no_elements(S) when ?IS_ORDSET(S), is_tuple(?ORDTYPE(S)) -> diff --git a/lib/stdlib/src/sys.erl b/lib/stdlib/src/sys.erl index 8ab72c9b50..f34201604c 100644 --- a/lib/stdlib/src/sys.erl +++ b/lib/stdlib/src/sys.erl @@ -154,7 +154,7 @@ log_to_file(Name, FileName, Timeout) -> -spec statistics(Name, Flag) -> 'ok' | {'ok', Statistics} when Name :: name(), Flag :: 'true' | 'false' | 'get', - Statistics :: [StatisticsTuple], + Statistics :: [StatisticsTuple] | no_statistics, StatisticsTuple :: {'start_time', DateTime1} | {'current_time', DateTime2} | {'reductions', non_neg_integer()} @@ -168,7 +168,7 @@ statistics(Name, Flag) -> -spec statistics(Name, Flag, Timeout) -> 'ok' | {'ok', Statistics} when Name :: name(), Flag :: 'true' | 'false' | 'get', - Statistics :: [StatisticsTuple], + Statistics :: [StatisticsTuple] | no_statistics, StatisticsTuple :: {'start_time', DateTime1} | {'current_time', DateTime2} | {'reductions', non_neg_integer()} |