@@ -192,13 +192,13 @@ std::ostream& Nikon1MakerNote::print0x0007(std::ostream& os, const Value& value,
192192
193193std::ostream& Nikon1MakerNote::print0x0085 (std::ostream& os, const Value& value, const ExifData*) {
194194 std::ios::fmtflags f (os.flags ());
195- Rational distance = value.toRational ();
196- if (distance. first == 0 ) {
195+ auto [r, s] = value.toRational ();
196+ if (r == 0 ) {
197197 os << _ (" Unknown" );
198- } else if (distance. second != 0 ) {
198+ } else if (s != 0 ) {
199199 std::ostringstream oss;
200200 oss.copyfmt (os);
201- os << std::fixed << std::setprecision (2 ) << static_cast <float >(distance. first ) / distance. second << " m" ;
201+ os << std::fixed << std::setprecision (2 ) << static_cast <float >(r ) / s << " m" ;
202202 os.copyfmt (oss);
203203 } else {
204204 os << " (" << value << " )" ;
@@ -209,13 +209,13 @@ std::ostream& Nikon1MakerNote::print0x0085(std::ostream& os, const Value& value,
209209
210210std::ostream& Nikon1MakerNote::print0x0086 (std::ostream& os, const Value& value, const ExifData*) {
211211 std::ios::fmtflags f (os.flags ());
212- Rational zoom = value.toRational ();
213- if (zoom. first == 0 ) {
212+ auto [r, s] = value.toRational ();
213+ if (r == 0 ) {
214214 os << _ (" Not used" );
215- } else if (zoom. second != 0 ) {
215+ } else if (s != 0 ) {
216216 std::ostringstream oss;
217217 oss.copyfmt (os);
218- os << std::fixed << std::setprecision (1 ) << static_cast <float >(zoom. first ) / zoom. second << " x" ;
218+ os << std::fixed << std::setprecision (1 ) << static_cast <float >(r ) / s << " x" ;
219219 os.copyfmt (oss);
220220 } else {
221221 os << " (" << value << " )" ;
@@ -342,13 +342,13 @@ const TagInfo* Nikon2MakerNote::tagList() {
342342
343343std::ostream& Nikon2MakerNote::print0x000a (std::ostream& os, const Value& value, const ExifData*) {
344344 std::ios::fmtflags f (os.flags ());
345- Rational zoom = value.toRational ();
346- if (zoom. first == 0 ) {
345+ auto [r, s] = value.toRational ();
346+ if (r == 0 ) {
347347 os << _ (" Not used" );
348- } else if (zoom. second != 0 ) {
348+ } else if (s != 0 ) {
349349 std::ostringstream oss;
350350 oss.copyfmt (os);
351- os << std::fixed << std::setprecision (1 ) << static_cast <float >(zoom. first ) / zoom. second << " x" ;
351+ os << std::fixed << std::setprecision (1 ) << static_cast <float >(r ) / s << " x" ;
352352 os.copyfmt (oss);
353353 } else {
354354 os << " (" << value << " )" ;
@@ -1355,18 +1355,18 @@ std::ostream& Nikon3MakerNote::print0x0084(std::ostream& os, const Value& value,
13551355 const int64_t len1 = value.toInt64 (0 );
13561356 const int64_t len2 = value.toInt64 (1 );
13571357
1358- Rational fno1 = value.toRational (2 );
1359- Rational fno2 = value.toRational (3 );
1358+ auto [r1, s1] = value.toRational (2 );
1359+ auto [r2, s2] = value.toRational (3 );
13601360 os << len1;
13611361 if (len2 != len1) {
13621362 os << " -" << len2;
13631363 }
13641364 os << " mm " ;
13651365 std::ostringstream oss;
13661366 oss.copyfmt (os);
1367- os << " F" << std::setprecision (2 ) << static_cast <float >(fno1. first ) / fno1. second ;
1368- if (fno2 != fno1 ) {
1369- os << " -" << std::setprecision (2 ) << static_cast <float >(fno2. first ) / fno2. second ;
1367+ os << " F" << std::setprecision (2 ) << static_cast <float >(r1 ) / s1 ;
1368+ if (r2 != r1 ) {
1369+ os << " -" << std::setprecision (2 ) << static_cast <float >(r2 ) / s2 ;
13701370 }
13711371 os.copyfmt (oss);
13721372 os.flags (f);
@@ -1375,13 +1375,13 @@ std::ostream& Nikon3MakerNote::print0x0084(std::ostream& os, const Value& value,
13751375
13761376std::ostream& Nikon3MakerNote::print0x0085 (std::ostream& os, const Value& value, const ExifData*) {
13771377 std::ios::fmtflags f (os.flags ());
1378- Rational distance = value.toRational ();
1379- if (distance. first == 0 ) {
1378+ auto [r, s] = value.toRational ();
1379+ if (r == 0 ) {
13801380 os << _ (" Unknown" );
1381- } else if (distance. second != 0 ) {
1381+ } else if (s != 0 ) {
13821382 std::ostringstream oss;
13831383 oss.copyfmt (os);
1384- os << std::fixed << std::setprecision (2 ) << static_cast <float >(distance. first ) / distance. second << " m" ;
1384+ os << std::fixed << std::setprecision (2 ) << static_cast <float >(r ) / s << " m" ;
13851385 os.copyfmt (oss);
13861386 } else {
13871387 os << " (" << value << " )" ;
@@ -1392,13 +1392,13 @@ std::ostream& Nikon3MakerNote::print0x0085(std::ostream& os, const Value& value,
13921392
13931393std::ostream& Nikon3MakerNote::print0x0086 (std::ostream& os, const Value& value, const ExifData*) {
13941394 std::ios::fmtflags f (os.flags ());
1395- Rational zoom = value.toRational ();
1396- if (zoom. first == 0 ) {
1395+ auto [r, s] = value.toRational ();
1396+ if (r == 0 ) {
13971397 os << _ (" Not used" );
1398- } else if (zoom. second != 0 ) {
1398+ } else if (s != 0 ) {
13991399 std::ostringstream oss;
14001400 oss.copyfmt (os);
1401- os << std::fixed << std::setprecision (1 ) << static_cast <float >(zoom. first ) / zoom. second << " x" ;
1401+ os << std::fixed << std::setprecision (1 ) << static_cast <float >(r ) / s << " x" ;
14021402 os.copyfmt (oss);
14031403 } else {
14041404 os << " (" << value << " )" ;
0 commit comments