From af61de4fee3f5936e2ea368ded527414b69c4a78 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 28 Jun 2011 22:29:50 +0200 Subject: wx: fix obsolete guard warning (list/1) --- lib/wx/test/wxt.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/wx/test/wxt.erl b/lib/wx/test/wxt.erl index 1f5b1cc3b1..2f52c58f26 100644 --- a/lib/wx/test/wxt.erl +++ b/lib/wx/test/wxt.erl @@ -72,7 +72,7 @@ resolve({Suite0, Case}) when is_atom(Suite0), is_atom(Case) -> {Suite, Case2} -> {Suite, Case2} end; -resolve(List) when list(List) -> +resolve(List) when is_list(List) -> [resolve(Case) || Case <- List]. alias(Suite) when is_atom(Suite) -> @@ -104,7 +104,7 @@ read_config() -> end. %% Write new default config file -write_config(Config) when list(Config) -> +write_config(Config) when is_list(Config) -> Fname = config_fname(), {ok, Fd} = file:open(Fname, write), write_list(Fd, Config), -- cgit v1.2.3 From aa1d02f72d86995fb29646fd55417ccf1f88fbca Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 5 Jul 2011 11:02:15 +0200 Subject: Clean up hipe.hrl.src (Signed-off-by: Kostis) --- lib/hipe/main/hipe.hrl.src | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/hipe/main/hipe.hrl.src b/lib/hipe/main/hipe.hrl.src index a1fbeda9cf..ec55c707ef 100644 --- a/lib/hipe/main/hipe.hrl.src +++ b/lib/hipe/main/hipe.hrl.src @@ -50,9 +50,8 @@ %% Flags: %% DEBUG - Turns on debugging. (Can be defined to a integer %% value to determine the level of debugging) -%% VERBOSE - More info is printed... %% HIPE_LOGGING - Turn on logging of messages with erl_logger. -%% DO_ASSERT - Turn on Assertions. +%% DO_ASSERT - Turn on assertions. %% TIMING - Turn on timing. %% HIPE_INSTRUMENT_COMPILER - Turn on instrumentation of the compiler. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -107,13 +106,9 @@ %% %% Define the exit macro %% --ifdef(VERBOSE). --define(EXIT(Reason), erlang:error({?MODULE,?LINE,Reason})). --else. -define(EXIT(Reason), ?msg("EXITED with reason ~w @~w:~w\n", [Reason,?MODULE,?LINE]), erlang:error({?MODULE,?LINE,Reason})). --endif. %% %% Assertions. -- cgit v1.2.3 From a863e974b2281046419f60a0c9c2220a9bca83e0 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Thu, 21 Jul 2011 12:09:59 +0400 Subject: Do not install *.bat files on non-win32 machines Signed-off-by: Peter Lemenkov Signed-off-by: Hans Ulrich Niedermann --- lib/observer/src/Makefile | 9 ++++++--- lib/webtool/priv/Makefile | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile index 2d06cb6bc4..3875b62101 100644 --- a/lib/observer/src/Makefile +++ b/lib/observer/src/Makefile @@ -56,13 +56,16 @@ TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET) PRIVDIR= ../priv WEBTOOLFILES= $(PRIVDIR)/crashdump_viewer.tool BINDIR= $(PRIVDIR)/bin +ifeq ($(findstring win32,$(TARGET)),win32) +WIN32_EXECUTABLES= $(BINDIR)/etop.bat $(BINDIR)/getop.bat $(BINDIR)/cdv.bat +else +WIN32_EXECUTABLES= +endif EXECUTABLES= \ $(BINDIR)/etop \ $(BINDIR)/getop \ $(BINDIR)/cdv \ - $(BINDIR)/etop.bat \ - $(BINDIR)/getop.bat \ - $(BINDIR)/cdv.bat + $(WIN32_EXECUTABLES) CDVDIR= $(PRIVDIR)/crashdump_viewer GIF_FILES= \ $(CDVDIR)/collapsd.gif \ diff --git a/lib/webtool/priv/Makefile b/lib/webtool/priv/Makefile index 56ab772c45..6e1c6606fe 100644 --- a/lib/webtool/priv/Makefile +++ b/lib/webtool/priv/Makefile @@ -39,8 +39,12 @@ HTDOCS_FILES = root/doc/index.html \ root/doc/tool_management.html \ root/doc/start_info.html -SCRIPTS = bin/start_webtool \ - bin/start_webtool.bat +ifeq ($(findstring win32,$(TARGET)),win32) +WIN32_SCRIPTS= bin/start_webtool.bat +else +WIN32_SCRIPTS= +endif +SCRIPTS = bin/start_webtool $(WIN32_SCRIPTS) # ---------------------------------------------------- # FLAGS -- cgit v1.2.3 From af8938714416c0b1393a0830fdc6e8a5ab4be87c Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Sun, 19 Jun 2011 21:16:45 +0100 Subject: Fix type of Packet arg of gen_tcp:send/2 and gen_udp:send/4 The type is marked as a binary() or a string() but in practice it can be an iodata(). The test suite was updated to confirm the gen_tcp/2 and gen_udp:send/4 functions accept iodata() (iolists) packets. --- lib/kernel/src/gen_tcp.erl | 2 +- lib/kernel/src/gen_udp.erl | 2 +- lib/kernel/test/gen_tcp_api_SUITE.erl | 8 ++++++++ lib/kernel/test/gen_udp_SUITE.erl | 14 +++++++++++--- 4 files changed, 21 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/kernel/src/gen_tcp.erl b/lib/kernel/src/gen_tcp.erl index df326b59d6..8ab18c01b4 100644 --- a/lib/kernel/src/gen_tcp.erl +++ b/lib/kernel/src/gen_tcp.erl @@ -250,7 +250,7 @@ close(S) -> -spec send(Socket, Packet) -> ok | {error, Reason} when Socket :: socket(), - Packet :: string() | binary(), + Packet :: iodata(), Reason :: inet:posix(). send(S, Packet) when is_port(S) -> diff --git a/lib/kernel/src/gen_udp.erl b/lib/kernel/src/gen_udp.erl index 554f4ece4a..8688799ae9 100644 --- a/lib/kernel/src/gen_udp.erl +++ b/lib/kernel/src/gen_udp.erl @@ -109,7 +109,7 @@ close(S) -> Socket :: socket(), Address :: inet:ip_address() | inet:hostname(), Port :: inet:port_number(), - Packet :: string() | binary(), + Packet :: iodata(), Reason :: not_owner | inet:posix(). send(S, Address, Port, Packet) when is_port(S) -> diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index fd4685cdad..cbaec2d6dd 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -158,6 +158,10 @@ t_shutdown_error(Config) when is_list(Config) -> t_fdopen(Config) when is_list(Config) -> ?line Question = "Aaaa... Long time ago in a small town in Germany,", + ?line Question1 = list_to_binary(Question), + ?line Question2 = [<<"Aaaa">>, "... ", $L, <<>>, $o, "ng time ago ", + ["in ", [], <<"a small town">>, [" in Germany,", <<>>]]], + ?line Question1 = iolist_to_binary(Question2), ?line Answer = "there was a shoemaker, Schumacher was his name.", ?line {ok, L} = gen_tcp:listen(0, [{active, false}]), ?line {ok, Port} = inet:port(L), @@ -167,6 +171,10 @@ t_fdopen(Config) when is_list(Config) -> ?line {ok, Server} = gen_tcp:fdopen(FD, []), ?line ok = gen_tcp:send(Client, Question), ?line {ok, Question} = gen_tcp:recv(Server, length(Question), 2000), + ?line ok = gen_tcp:send(Client, Question1), + ?line {ok, Question} = gen_tcp:recv(Server, length(Question), 2000), + ?line ok = gen_tcp:send(Client, Question2), + ?line {ok, Question} = gen_tcp:recv(Server, length(Question), 2000), ?line ok = gen_tcp:send(Server, Answer), ?line {ok, Answer} = gen_tcp:recv(Client, length(Answer), 2000), ?line ok = gen_tcp:close(Client), diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index b734d7fd98..514deaf065 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -201,13 +201,21 @@ binary_passive_recv(suite) -> binary_passive_recv(doc) -> ["OTP-3823 gen_udp:recv does not return address in binary mode"]; binary_passive_recv(Config) when is_list(Config) -> - ?line D = "The quick brown fox jumps over a lazy dog", - ?line B = list_to_binary(D), + ?line D1 = "The quick brown fox jumps over a lazy dog", + ?line D2 = list_to_binary(D1), + ?line D3 = ["The quick", <<" brown ">>, "fox jumps ", <<"over ">>, + <<>>, $a, [[], " lazy ", <<"dog">>]], + ?line D2 = iolist_to_binary(D3), + ?line B = D2, ?line {ok, R} = gen_udp:open(0, [binary, {active, false}]), ?line {ok, RP} = inet:port(R), ?line {ok, S} = gen_udp:open(0), ?line {ok, SP} = inet:port(S), - ?line ok = gen_udp:send(S, localhost, RP, D), + ?line ok = gen_udp:send(S, localhost, RP, D1), + ?line {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1), + ?line ok = gen_udp:send(S, localhost, RP, D2), + ?line {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1), + ?line ok = gen_udp:send(S, localhost, RP, D3), ?line {ok, {{127, 0, 0, 1}, SP, B}} = gen_udp:recv(R, byte_size(B)+1), ?line ok = gen_udp:close(S), ?line ok = gen_udp:close(R), -- cgit v1.2.3