Age | Commit message (Collapse) | Author |
|
|
|
* blt/gen_server-typo/OTP-11398:
Change 'recive' to 'receive' in gen_server.erl
|
|
A small spelling correction merely; no functionality change.
|
|
files as delimiters.
While working on a tool that processes Erlang code and testing it against this repo,
I found out about those little sneaky 0xff. I thought it may be of help to other
people build such tools to remove non-conforming-to-standard characters.
|
|
When reporting a field redefinition in a record, erl_lint can forget
about some old unused variables.
f() -> X = 1, #r{a=foo,a=bar,a=qux}.
|
|
Variables used in the body of a try expression were marked as unsafe
*and* used, which makes no sense as an unsafe variable can't be used.
Function vtsubtract/2 is used to forget usage of such unsafe variables.
Reported-by: Paul Davis
|
|
When analyzing complex expressions (i.e. comprehensions, cases, tries,
ifs and receives), erl_lint does not forget about old unused variables
when returning the updated variable table. This causes a bug where old
unused variables are not recorded as such:
t(X, Y) ->
#r{a=[ K || K <- Y ],b=[ K || K <- Y ]}.
As erl_lint uses vtmerge_pat/2 to merge the results of the analysis of
the two list comprehensions, X is marked as used and the warning is not
emitted.
The function vtmerge_pat/2 is used instead of the similar vtmerge/2
which does not mark multiple occurrences of a variable as usage to
handle cases like the following one:
t(X, Y) ->
#r{a=A=X,b=A=Y}.
Other simpler expressions like conses, tuples and external fun
references do not correctly follow this behaviour, e.g. A is not marked
as used in the following code:
t(X, Y) ->
{A=X,A=Y}.
This commit fixes both issues and makes erl_lint not return old unused
variables in updated tables and makes all compound expressions use
vtmerge_pat/2.
Reported-by: Anders Ramsell
|
|
* sze/edlin_understand_keys/OTP-11251:
Added primary bootstrap
erts: fixed documentation regarding tty and arrow keys
make edlin understand a few important control keys
|
|
* alexrp/export_edge/OTP-11266:
Export the edge/0 type from the digraph module
|
|
Thanks to Chris King and Kostis Sagonas for pinpointing the bug.
|
|
* hb/stdlib/dets_bugfix/OTP-11245:
Fix a Dets bug concerning traversal of tables
|
|
If the fun M:F/A construct was used erroneously the linter could
crash.
Thanks to Mikhail Sobolev for reporting the bug.
|
|
The bug was introduced in R16B.
Thanks to Manuel Durán Aguete.
|
|
|
|
Hi Fredrik,
> I've gotten some feedback from your review,
> You need to add documentation under Erts-> "User's Guide" -> "tty - A
> command line interface"
>
> You need to add testcase in interactive_shell_SUITE a simplified
> example of how this testcase could look like;
> ctrl_w_and_ctrl_u(_Conf) ->
> rtnode([{putline,""}, {putline, "2."}, {getline, "2"},
> {putline,"xxx yy"++[$\^w]++"."}, {getline,"xxx"}, {putline,"xxx
> yy"++[$\^u]++"z."}, {getline,"z"}],[]).
Please find an updated version of the patch attached to this e-mail. I
hope that you still accept it via e-mail because the former patch was
sent the same way ;-).
I have extended the documentation to list the new key combinations and
added tests to make sure they work.
Kind regards,
--
Dr. Stefan Zegenhagen
arcutronix GmbH
Garbsener Landstr. 10
30419 Hannover
Germany
Tel: +49 511 277-2734
Fax: +49 511 277-2709
Email: [email protected]
Web: www.arcutronix.com
*Synchronize the Ethernet*
General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer -
Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht
Hannover; Ust-Id: DE257551767.
Please consider the environment before printing this message.
>From ce4b827c78d18f39bb1146fd2959ffd7ae2b4bb6 Mon Sep 17 00:00:00 2001
From: Stefan Zegenhagen <[email protected]>
Date: Mon, 6 May 2013 14:39:07 +0200
Subject: [PATCH] [EDLIN] support a few more control keys
Add support for the following control keys that many users have become
accustomed to:
- <CTRL>+W : backward kill word
- <CTRL>+U : backward kill line
- <HOME> : goto start of line
- <END> : goto end of line
- <CTRL>+<LEFT> : backward word
- <CTRL>+<RIGHT> : forward word
It seems that the <CTRL>+<LEFT|RIGHT> control key sequences are
different between terminal emulators, therefore a few possible
combinations were added (similar to how libreadline is configured).
Documentation and tests are extended to reflect the new functionality.
|
|
|
|
* jv/update-io_prompt-type/OTP-11208:
Update io:prompt() type
|
|
Most functions in filelib support binaries as arguments but
that was not reflected in the typespecs.
The types filename_all() and dirname_all() were introduced
to mimic file:name_all().
|
|
Functions that expect an io:prompt() also accept binaries and
iolists as arguments. Therefore its type has been updated to
reflect the same types accepted by other io functions.
|
|
* genrich/stdlib/gen_server_typo/OTP-11200:
handle_info Info type possible typo
|
|
|
|
Should it be 'timeout' instead of timeout(), as in doc: http://www.erlang.org/doc/man/gen_server.html#Module:handle_info-2?
|
|
* jv/erl_lint-default_types/OTP-11143:
Updated primary bootstrap
stdlib: re-factored erl_lint.erl
Improve erl_lint performance
|
|
* nox/erl_pp-callback/OTP-11140:
Update primary bootstrap
Support callback attributes in erl_pp
|
|
The function was updated in 5805b576, but not the type specificatin.
|
|
|
|
* nox/erl_eval-receive/OTP-11137:
Updated primary bootstrap for erl_eval
Added preloaded prim_eval
Fix receive support in erl_eval with a BEAM module
|
|
* bjorn/stdlib/improve-ls/OTP-11108:
Teach c:ls/1 to show non-directory files
|
|
bmk/snmp/snmp424_integration/r16
Conflicts:
lib/snmp/doc/src/notes.xml
|
|
|
|
|
|
The default_types() in erl_lint returned a dictionary
with all default types. However, calculating this dict
was expensive and we actually didn't use the default
values in this dictionary.
This patch replaces the dictionary use for one function
that checks if the type is a default type or not,
and remove the bits that checked explicitly for those
default types when iterating the dictionary.
|
|
|
|
Using the low-level BEAM instructions, we can loop over each message in
the process queue and removes the first message that matches, without
receiving them all to later send them back to itself.
The function prim_eval:'receive'/2 is equivalent to the
following pseudo-code:
'receive'(F, T) ->
RESET MESSAGE QUEUE POINTER,
LOOP:
case PEEK CURRENT MESSAGE WITH TIMEOUT T of
{ok,Msg} ->
case F(Msg) of
nomatch ->
DECREMENT TIMEOUT T,
ADVANCE MESSAGE QUEUE POINTER,
GOTO LOOP;
Result ->
RESET MESSAGE QUEUE POINTER,
Result
end;
timeout ->
RESET MESSAGE QUEUE POINTER,
timeout
end.
To not break Dialyzer and other tools, we use a stub Erlang module which
abstract code is forcefully inserted into prim_inet.erl afterwards
compilation.
|
|
In an email to erlang-questions, Bengt Kleberg wrote:
When I use c:ls/1 it reminds me so much of Unix "ls" that I
expect c:ls("filename") to work. The resulting error surprises
me every time (not the same day).
While teaching c:ls/1 to show non-directory files, update the
error handling to make use of the POSIX error codes from
file:list_dir/1 and file:format_error/1 (which had not been
invented when the c module was first implemented).
Suggested-by: Bengt Kleberg
Test-suite-by: Bengt Kleberg
|
|
Since both the STDLIB and compiler applications turn warnings
into errors, we must stop using the old deprecated crypto functions.
While we are at it, generalize the format of the key tuple returned
by beam_lib:make_crypto_key/2 to facilitate introducing new crypto
methods in the future. Change the format to:
{Type,Key,IV,BlockSize}
where Type, Key, and IV are the first three arguments for either
crypto:block_encrypt4/ or crypto:block_decrypt/4, and BlockSize
is the block size for the crypto algorithm (it is needed to properly
pad the plaintext blocks before encryption).
|
|
|
|
Thanks to Tomáš Janoušek.
|
|
|
|
|
|
|
|
* nox/fix-epp-file-attrs/OTP-11079:
Fix an inconsistent state in epp
|
|
This function is used all over the place in OTP itself and people
sometimes want that functionality, they may as well not reimplement it
themselves.
|
|
When entering a new file, epp doesn't properly set #epp.name2 like it
does on initialisation, generating a malformed file attribute when it
leaves the file.
|
|
I've found stdlib's timer to burn CPU without good reason. Here's what
happens.
The problem is that it sleeps in milliseconds but computes time in
microseconds. And there is bug in code to compute milliseconds to
sleep. It computes microseconds difference between now and nearest
timer event and then does _truncating_ division by 1000. So on average
it sleeps 500 microseconds _less than needed_. On wakeup its checks do
I have timer tick that already occurred? No. Ok how much I need to
sleep ? It does that bad computation again and gets 0
milliseconds. So next gen_server timeout happens right away only to
find we're still before closest timer tick and to decide to sleep 0
milliseconds again. And again and again.
This commit changes division to pick ceiling of ratio rather than
floor. So that we always sleep not less then difference between now
and closest event time.
|
|
|
|
* lh/demonitor-flush/OTP-11039:
Use erlang:demonitor(Ref, [flush]) where applicable
|
|
* lh/otp-optims/OTP-11035:
Use erlang:demonitor's flush option on timeout
Don't lookup the node unless required in gen:call/{3,4}
|
|
|
|
* sv/stdlib/sys-get-state/OTP-11013:
Removed ?line macro
add sys:get_state/1,2 and sys:replace_state/2,3
update sys:get_status/2,3 documentation for gen_event
|