File 2424-asn1ct_gen-Clean-up-generation-of-.hrl-file-header.patch of Package erlang

From d734056a59ff12fe74e38482bde558c86597e08d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Tue, 14 Feb 2017 12:46:41 +0100
Subject: [PATCH 4/7] asn1ct_gen: Clean up generation of .hrl file header

Note that put(currmod, Mod) is not needed because it has already
been done by the caller.
---
 lib/asn1/src/asn1ct_gen.erl | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index aa8bd58e5..147c6d01f 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1226,13 +1226,12 @@ gen_head(#gen{options=Options}=Gen, Mod, Hrl) ->
     emit(["%% Generated by the Erlang ASN.1 ",Name,
           "compiler. Version:",asn1ct:vsn(),nl,
           "%% Purpose: encoder and decoder of the types in ",Mod,nl,nl,
-          "-module('",Mod,"').",nl]),
-    put(currmod,Mod),
-    emit({"-compile(nowarn_unused_vars).",nl}),
-    emit({"-dialyzer(no_improper_lists).",nl}),
+          "-module('",Mod,"').",nl,
+          "-compile(nowarn_unused_vars).",nl,
+          "-dialyzer(no_improper_lists).",nl]),
     case Hrl of
 	0 -> ok;
-	_ -> emit({"-include(\"",Mod,".hrl\").",nl})
+	_ -> emit(["-include(\"",Mod,".hrl\").",nl])
     end,
     emit(["-asn1_info([{vsn,'",asn1ct:vsn(),"'},",nl,
 	  "            {module,'",Mod,"'},",nl,
@@ -1240,11 +1239,11 @@ gen_head(#gen{options=Options}=Gen, Mod, Hrl) ->
 
 
 gen_hrlhead(Mod) ->
-    emit({"%% Generated by the Erlang ASN.1 compiler version:",asn1ct:vsn(),nl}),
-    emit({"%% Purpose: Erlang record definitions for each named and unnamed",nl}),
-    emit({"%% SEQUENCE and SET, and macro definitions for each value",nl}),
-    emit({"%% definition,in module ",Mod,nl,nl}),
-    emit({nl,nl}).
+    emit(["%% Generated by the Erlang ASN.1 compiler. Version: ",
+          asn1ct:vsn(),nl,
+          "%% Purpose: Erlang record definitions for each named and unnamed",nl,
+          "%% SEQUENCE and SET, and macro definitions for each value",nl,
+          "%% definition in module ",Mod,".",nl,nl]).
 
 %% May only be a list or a two-tuple.
 to_textual_order({Root,Ext}) ->
-- 
2.11.1

openSUSE Build Service is sponsored by