Revert "Make RenderScript constants variables instead of macros."
This reverts commit ef0c455c3dc44e9919e20062792584cbf01d6255.
The use of UNRELEASED tag in .rsh file is wrong. It leads to incorrect API checking. UNRELEASED can only be used in the .spec files for API definition.
Change-Id: I398c749b5243e4f71cb3c14e7c50e1f5b7c14a9d
diff --git a/api/GenerateHeaderFiles.cpp b/api/GenerateHeaderFiles.cpp
index 9f40d3d..ce778b3 100644
--- a/api/GenerateHeaderFiles.cpp
+++ b/api/GenerateHeaderFiles.cpp
@@ -120,13 +120,7 @@
const Constant* constant = spec.getConstant();
VersionInfo info = spec.getVersionInfo();
writeVersionGuardStart(file, info, constant->getFinalVersion());
-
- *file << "#if (defined(RS_VERSION) && (RS_VERSION >= UNRELEASED))\n";
- *file << "extern const " << spec.getType() << " " << constant->getName() << ";\n";
- *file << "#else\n";
- *file << "#define " << constant->getName() << " " << spec.getValue() << "\n";
- *file << "#endif\n\n";
-
+ *file << "#define " << constant->getName() << " " << spec.getValue() << "\n\n";
writeVersionGuardEnd(file, info);
}
diff --git a/api/Generator.cpp b/api/Generator.cpp
index f67e473..456f214 100644
--- a/api/Generator.cpp
+++ b/api/Generator.cpp
@@ -62,7 +62,6 @@
* [version: ({Starting API level} [ {Last API level that supports this.}] | UNRELEASED)
* [size: {32 or 64. Used if this is available only for 32 or 64 bit code.}]
* value: {The value of the constant.}
- * type: {The type of the constant.}
* [hidden:] ...If present, don't document the constant. Omit the following two fields.
* [deprecated: [{Deprecation message.}] ... This is deprecated. Compiler will issue a wrning.
* summary: {A one line string describing this section.}
diff --git a/api/Specification.cpp b/api/Specification.cpp
index 024b8b6..7afeea4 100644
--- a/api/Specification.cpp
+++ b/api/Specification.cpp
@@ -380,9 +380,6 @@
if (scanner->findTag("value:")) {
spec->mValue = scanner->getValue();
}
- if (scanner->findTag("type:")) {
- spec->mType = scanner->getValue();
- }
constant->scanDocumentationTags(scanner, created, specFile);
scanner->findTag("end:");
diff --git a/api/Specification.h b/api/Specification.h
index 8326659..c467c5c 100644
--- a/api/Specification.h
+++ b/api/Specification.h
@@ -262,13 +262,11 @@
Constant* mConstant; // Not owned
std::string mValue; // E.g. "3.1415"
- std::string mType;
public:
ConstantSpecification(Constant* constant) : mConstant(constant) {}
Constant* getConstant() const { return mConstant; }
std::string getValue() const { return mValue; }
- std::string getType() const { return mType; }
// Parse a constant specification and add it to specFile.
static void scanConstantSpecification(Scanner* scanner, SpecFile* specFile, unsigned int maxApiLevel);
diff --git a/api/rs_math.spec b/api/rs_math.spec
index 96eee81..acc2eb6 100644
--- a/api/rs_math.spec
+++ b/api/rs_math.spec
@@ -51,7 +51,6 @@
# TODO Add f16 versions of these constants.
constant: M_1_PI
value: 0.318309886183790671537767526745028724f
-type: float
summary: 1 / pi, as a 32 bit float
description:
The inverse of pi, as a 32 bit float.
@@ -59,7 +58,6 @@
constant: M_2_PI
value: 0.636619772367581343075535053490057448f
-type: float
summary: 2 / pi, as a 32 bit float
description:
2 divided by pi, as a 32 bit float.
@@ -67,7 +65,6 @@
constant: M_2_PIl
value: 0.636619772367581343075535053490057448f
-type: float
hidden:
deprecated: 22, Use M_2_PI instead.
summary: 2 / pi, as a 32 bit float
@@ -77,7 +74,6 @@
constant: M_2_SQRTPI
value: 1.128379167095512573896158903121545172f
-type: float
summary: 2 / sqrt(pi), as a 32 bit float
description:
2 divided by the square root of pi, as a 32 bit float.
@@ -85,7 +81,6 @@
constant: M_E
value: 2.718281828459045235360287471352662498f
-type: float
summary: e, as a 32 bit float
description:
The number e, the base of the natural logarithm, as a 32 bit float.
@@ -93,7 +88,6 @@
constant: M_LN10
value: 2.302585092994045684017991454684364208f
-type: float
summary: log_e(10), as a 32 bit float
description:
The natural logarithm of 10, as a 32 bit float.
@@ -101,7 +95,6 @@
constant: M_LN2
value: 0.693147180559945309417232121458176568f
-type: float
summary: log_e(2), as a 32 bit float
description:
The natural logarithm of 2, as a 32 bit float.
@@ -109,7 +102,6 @@
constant: M_LOG10E
value: 0.434294481903251827651128918916605082f
-type: float
summary: log_10(e), as a 32 bit float
description:
The logarithm base 10 of e, as a 32 bit float.
@@ -117,7 +109,6 @@
constant: M_LOG2E
value: 1.442695040888963407359924681001892137f
-type: float
summary: log_2(e), as a 32 bit float
description:
The logarithm base 2 of e, as a 32 bit float.
@@ -125,7 +116,6 @@
constant: M_PI
value: 3.141592653589793238462643383279502884f
-type: float
summary: pi, as a 32 bit float
description:
The constant pi, as a 32 bit float.
@@ -133,7 +123,6 @@
constant: M_PI_2
value: 1.570796326794896619231321691639751442f
-type: float
summary: pi / 2, as a 32 bit float
description:
Pi divided by 2, as a 32 bit float.
@@ -141,7 +130,6 @@
constant: M_PI_4
value: 0.785398163397448309615660845819875721f
-type: float
summary: pi / 4, as a 32 bit float
description:
Pi divided by 4, as a 32 bit float.
@@ -149,7 +137,6 @@
constant: M_SQRT1_2
value: 0.707106781186547524400844362104849039f
-type: float
summary: 1 / sqrt(2), as a 32 bit float
description:
The inverse of the square root of 2, as a 32 bit float.
@@ -157,7 +144,6 @@
constant: M_SQRT2
value: 1.414213562373095048801688724209698079f
-type: float
summary: sqrt(2), as a 32 bit float
description:
The square root of 2, as a 32 bit float.