From abb427adc6fcb4182047ea0a6df8ab40ce66396c Mon Sep 17 00:00:00 2001
From: Adam Knapp <adam.knapp@ericsson.com>
Date: Thu, 17 Mar 2022 13:16:12 +0100
Subject: [PATCH] Rename UNKNOWN in enum version_t (issue #586)

Signed-off-by: Adam Knapp <adam.knapp@ericsson.com>
---
 common/version.h                  |  2 +-
 compiler2/AST.cc                  |  2 +-
 compiler2/AST.hh                  |  2 +-
 compiler2/ttcn3/Ttcnstuff.cc      |  6 +++---
 compiler2/ttcn3/Ttcnstuff.hh      |  2 +-
 compiler2/ttcn3/coding_attrib_p.y | 12 ++++++------
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/common/version.h b/common/version.h
index c25302652..0222f5cb4 100644
--- a/common/version.h
+++ b/common/version.h
@@ -165,6 +165,6 @@ public:
 #undef FN
 
 /* Enum to identify version types */
-enum version_t { UNKNOWN, LEGACY_CRL, LEGACY_CAX, DOT_SEPARATED /*current*/ };
+enum version_t { UNKNOWN_VERSION_TYPE, LEGACY_CRL, LEGACY_CAX, DOT_SEPARATED /*current*/ };
 
 #endif
diff --git a/compiler2/AST.cc b/compiler2/AST.cc
index adf3babb0..adbba85eb 100644
--- a/compiler2/AST.cc
+++ b/compiler2/AST.cc
@@ -1320,7 +1320,7 @@ namespace Common {
     control_ns_prefix(p_mt == MOD_ASN ? mcopystr("asn1") : NULL),
     // only ASN.1 modules have default control namespace (X.693 amd1, 16.9)
     used_namespaces(), type_conv_v(), product_number(NULL),
-    suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL), version_type(UNKNOWN)
+    suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL), version_type(UNKNOWN_VERSION_TYPE)
   {
     if(!p_modid)
       FATAL_ERROR("NULL parameter: Common::Module::Module()");
diff --git a/compiler2/AST.hh b/compiler2/AST.hh
index da35f6c06..24665ccfa 100644
--- a/compiler2/AST.hh
+++ b/compiler2/AST.hh
@@ -371,7 +371,7 @@ namespace Common {
     void write_checksum();
     static char* get_product_identifier(const char* product_number,
         const unsigned int suffix, unsigned int release, unsigned int patch,
-        unsigned int build, const char* extra=NULL, enum version_t version_type = UNKNOWN);
+        unsigned int build, const char* extra=NULL, enum version_t version_type = UNKNOWN_VERSION_TYPE);
     ModuleVersion getVersion() const;
   protected: // *::Module need access
     /** Collects the set of visible modules into \a visible_mods. */
diff --git a/compiler2/ttcn3/Ttcnstuff.cc b/compiler2/ttcn3/Ttcnstuff.cc
index ee5c6d9de..566b7f19e 100644
--- a/compiler2/ttcn3/Ttcnstuff.cc
+++ b/compiler2/ttcn3/Ttcnstuff.cc
@@ -2749,7 +2749,7 @@ namespace Ttcn {
 	  value_.version_.extra_ = NULL;
 	  break;
 
-	case UNKNOWN:
+	case UNKNOWN_VERSION_TYPE:
 	case LEGACY_CRL:
 	case LEGACY_CAX:
 	  check_product_number(ABCClass, type_number, sequence);
@@ -2794,7 +2794,7 @@ namespace Ttcn {
 	  value_.version_.extra_ = NULL;
 	  break;
 
-	case UNKNOWN:
+	case UNKNOWN_VERSION_TYPE:
 	case LEGACY_CRL:
 	case LEGACY_CAX:
 	  check_product_number(ABCClass, type_number, sequence);
@@ -2841,7 +2841,7 @@ namespace Ttcn {
     	value_.version_.extra_ = NULL;
     	break;
 
-      case UNKNOWN:
+      case UNKNOWN_VERSION_TYPE:
       case LEGACY_CRL:
       case LEGACY_CAX:
     	check_product_number(ABCClass, type_number, sequence);
diff --git a/compiler2/ttcn3/Ttcnstuff.hh b/compiler2/ttcn3/Ttcnstuff.hh
index 1321e00cb..9b5c9c51b 100644
--- a/compiler2/ttcn3/Ttcnstuff.hh
+++ b/compiler2/ttcn3/Ttcnstuff.hh
@@ -723,7 +723,7 @@ private:
       unsigned int patch_;  ///< patch
       unsigned int build_;  ///< build number
       char* extra_; ///< extra junk at the end, for titansim
-      enum version_t version_type_; ///< possible values: UNKNOWN, LEGACY_CRL, LEGACY_CAX and DOT_SEPARATED for the current version
+      enum version_t version_type_; ///< possible values: UNKNOWN_VERSION_TYPE, LEGACY_CRL, LEGACY_CAX and DOT_SEPARATED for the current version
     } version_;
     PrintingType *pt_;
   } value_;
diff --git a/compiler2/ttcn3/coding_attrib_p.y b/compiler2/ttcn3/coding_attrib_p.y
index f731593b6..eba712daa 100644
--- a/compiler2/ttcn3/coding_attrib_p.y
+++ b/compiler2/ttcn3/coding_attrib_p.y
@@ -307,7 +307,7 @@ ExtensionAttribute:
 VersionAttribute:
 VersionKeyword IDentifier
 { // version   R2D2
-  $$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, UNKNOWN); // VERSION
+  $$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, UNKNOWN_VERSION_TYPE); // VERSION
   $$->set_location(coding_attrib_infile, @$);
   if ($$->get_type() == ExtensionAttribute::NONE) {
     $$->error("Incorrect version data '%s'", $2->get_name().c_str());
@@ -329,7 +329,7 @@ VersionKeyword IDentifier
 }
 | VersionKeyword IDentifier Number Number IDentifier
 { // version     CNL        113    200    R2D2
-  $$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, UNKNOWN); // VERSION
+  $$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, UNKNOWN_VERSION_TYPE); // VERSION
   $$->set_location(coding_attrib_infile, @$);
   if ($$->get_type() == ExtensionAttribute::NONE) {
     $$->error("Incorrect version data '%s %d %d %s'",
@@ -407,7 +407,7 @@ VersionKeyword IDentifier
 RequiresAttribute:
 RequiresKeyword IDentifier IDentifier
 { //            module     R1B
-  $$ = new ExtensionAttribute($2, NULL, 0, 0, 0, $3, UNKNOWN); // REQUIRES
+  $$ = new ExtensionAttribute($2, NULL, 0, 0, 0, $3, UNKNOWN_VERSION_TYPE); // REQUIRES
   $$->set_location(coding_attrib_infile, @$);
   if ($$->get_type() == ExtensionAttribute::NONE) {
     /* parsing the version has failed */
@@ -420,7 +420,7 @@ RequiresKeyword IDentifier IDentifier
 }
 | RequiresKeyword IDentifier IDentifier Number Number IDentifier
 { //              module     CNL        xxx    xxx    R1A
-  $$ = new ExtensionAttribute($2, $3->get_dispname().c_str(), $4, $5, 0, $6, UNKNOWN); // REQUIRES
+  $$ = new ExtensionAttribute($2, $3->get_dispname().c_str(), $4, $5, 0, $6, UNKNOWN_VERSION_TYPE); // REQUIRES
   $$->set_location(coding_attrib_infile, @$);
   if ($$->get_type() == ExtensionAttribute::NONE) {
     $$->error("Incorrect version data '%s %d %d %s'",
@@ -473,7 +473,7 @@ RequiresKeyword IDentifier IDentifier
 }
 | ReqTitanKeyword IDentifier
 { //              R1A
-  $$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, ExtensionAttribute::REQ_TITAN, UNKNOWN);
+  $$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, ExtensionAttribute::REQ_TITAN, UNKNOWN_VERSION_TYPE);
   $$->set_location(coding_attrib_infile, @$);
   if ($$->get_type() == ExtensionAttribute::NONE) {
     /* parsing the version has failed */
@@ -485,7 +485,7 @@ RequiresKeyword IDentifier IDentifier
 }
 | ReqTitanKeyword IDentifier Number Number IDentifier
 { //              CRL        113    200    R1A
-  $$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, ExtensionAttribute::REQ_TITAN, UNKNOWN);
+  $$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, ExtensionAttribute::REQ_TITAN, UNKNOWN_VERSION_TYPE);
   $$->set_location(coding_attrib_infile, @$);
   if ($$->get_type() == ExtensionAttribute::NONE) {
     $$->error("Incorrect version data '%s %d %d %s'",
-- 
GitLab