From 77a86f5d1e238e01416955a0855103eb8d823a24 Mon Sep 17 00:00:00 2001 From: Hombre57 Date: Tue, 19 Sep 2017 01:07:25 +0200 Subject: [PATCH] Bugfix: wrong interpreter called due to invalid overriding (#4008) --- rtexif/canonattribs.cc | 4 ++-- rtexif/nikonattribs.cc | 4 ++-- rtexif/pentaxattribs.cc | 22 +++++++++++----------- rtexif/sonyminoltaattribs.cc | 20 ++++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index 01b00dd53..8998c653a 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -1102,7 +1102,7 @@ public: sprintf (buffer, "%d", a); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = Interpreter::toInt (t, ofs); @@ -1113,7 +1113,7 @@ public: return 0.; } } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { int a = Interpreter::toInt (t, ofs, astype); diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index bf4fc5a6b..c977d076e 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -55,7 +55,7 @@ public: sprintf (buffer, "%d", a); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->getValue()[ofs]; @@ -66,7 +66,7 @@ public: return 0.; } } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { int a = t->getValue()[ofs]; diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index e9a7a3544..109ea0e78 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -1335,7 +1335,7 @@ public: sprintf (buffer, "%d", a ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a; @@ -1366,7 +1366,7 @@ public: return "n/a"; } } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { double a = double (t->toInt (0, LONG)); @@ -1396,7 +1396,7 @@ public: return "n/a"; } } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (ofs, BYTE); float b = float (10 * int (a >> 2)) * pow (4.f, float (int (a & 0x03) - 2)); @@ -1422,7 +1422,7 @@ public: sprintf (buffer, "%.1f", v ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (0, BYTE); return 100.*exp (double (a - 32) * log (2.) / 8.); @@ -1453,7 +1453,7 @@ public: return "n/a"; } } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (0, BYTE); a &= 0x7F; @@ -1479,7 +1479,7 @@ public: sprintf (buffer, "%.1f", v ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (0, BYTE); return double (a - 64) / 8.; @@ -1499,7 +1499,7 @@ public: sprintf (buffer, "%.1f", v ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (0, SBYTE); return double (a) / 8.; @@ -1519,7 +1519,7 @@ public: sprintf (buffer, "%.1f", v ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (0, BYTE); return exp ((double (a) - 68.) * log (2.) / 16.); @@ -1539,7 +1539,7 @@ public: sprintf (buffer, "%.6f", v ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (0, BYTE); return 24.*exp (- (double (a) - 32.) * log (2.) / 8.); @@ -1559,7 +1559,7 @@ public: sprintf (buffer, "%.1f", double (int (pow (2.0, double (mina + 10) / 4.0) + 0.2))); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = t->toInt (0, BYTE) & 0x0F; return double (int (pow (2.0, double (a + 10) / 4.0) + 0.2)); @@ -1579,7 +1579,7 @@ public: sprintf (buffer, "%.1f", double (int (pow (2.0, double (maxa) / 4.0) + 0.2)) ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { int a = ( t->toInt (0, BYTE) & 0xF0) >> 4; return double (int (pow (2.0, double (a) / 4.0) + 0.2)); diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index 7195bf8e5..738b33d50 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -2010,7 +2010,7 @@ public: return "n/a"; } } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { // Get the value; Depending on the camera model, this parameter can be a BYTE or a SHORT TagType astype = t->getType(); @@ -2029,7 +2029,7 @@ public: return 0.; } } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { // Get the value; Depending on the camera model, this parameter can be a BYTE or a SHORT int a = 0; @@ -2070,7 +2070,7 @@ public: return "n/a"; } } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { // Get the value; Depending on the camera model, this parameter can be a BYTE or a SHORT TagType astype = t->getType(); @@ -2089,7 +2089,7 @@ public: return 0.; } } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { // Get the value; Depending on the camera model, this parameter can be a BYTE or a SHORT int a = 0; @@ -2130,7 +2130,7 @@ public: return "Auto"; } } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { // Get the value; Depending on the camera model, this parameter can be a BYTE or a SHORT int a = 0; @@ -2166,7 +2166,7 @@ public: sprintf (buffer, "%.2f", a ); return buffer; } - virtual double toDouble (Tag* t, int ofs) + virtual double toDouble (const Tag* t, int ofs) { // Get the value int a = t->getValue()[ofs]; @@ -2186,7 +2186,7 @@ public: sprintf (buffer, "%d", t->getValue()[0] - 20); return buffer; } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { return t->getValue()[0] - 20; } @@ -2207,7 +2207,7 @@ public: return "Off"; } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { return (t->getValue()[0] & 0x80) == 0x80 ? 1 : 0; } @@ -2225,7 +2225,7 @@ public: sprintf (buffer, "%d", t->getValue()[0] & 0x7f); return buffer; } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { return t->getValue()[0] & 0x7f; } @@ -2281,7 +2281,7 @@ public: sprintf (buffer, "%d", t->toInt()); return buffer; } - virtual int toInt (Tag* t, int ofs, TagType astype) + virtual int toInt (const Tag* t, int ofs, TagType astype) { int a = 0;