astyled rtexif files, #3802

This commit is contained in:
Morgan Hardwood
2017-04-15 21:36:53 +02:00
parent 8779558763
commit 33a940cef4
9 changed files with 1902 additions and 1899 deletions

View File

@@ -332,7 +332,7 @@ public:
char buffer[32];
double v = t->toDouble();
if( v < 0. || v > 1000. ) {
if ( v < 0. || v > 1000. ) {
return "undef";
}
@@ -349,9 +349,9 @@ public:
virtual std::string toString (Tag* t)
{
char buffer[32];
double v = pow(2.0, t->toDouble() / 2.0);
double v = pow (2.0, t->toDouble() / 2.0);
if( v < 0. || v > 1000. ) {
if ( v < 0. || v > 1000. ) {
return "undef";
}
@@ -370,7 +370,7 @@ public:
char buffer[32];
double v = t->toDouble();
if( v < -1000. || v > 1000. ) {
if ( v < -1000. || v > 1000. ) {
return "undef";
}
@@ -429,7 +429,7 @@ public:
char buffer[32];
double v = t->toDouble();
if( v > 1000000. || v < 0 ) {
if ( v > 1000000. || v < 0 ) {
return "undef";
}
@@ -446,20 +446,22 @@ public:
virtual std::string toString (Tag* t)
{
int count = t->getCount();
if(count <= 8) {
if (count <= 8) {
return std::string();
}
count = std::min(count, 65535); // limit to 65535 chars to avoid crashes in case of corrupted metadata
count = std::min (count, 65535); // limit to 65535 chars to avoid crashes in case of corrupted metadata
char *buffer = new char[count - 7];
if (!memcmp((char*)t->getValue(), "ASCII\0\0\0", 8)) {
if (!memcmp ((char*)t->getValue(), "ASCII\0\0\0", 8)) {
strncpy (buffer, (char*)t->getValue() + 8, count - 8);
buffer[count - 8] = '\0';
} else {
buffer[0] = 0;
}
std::string retVal(buffer);
std::string retVal (buffer);
delete [] buffer;
return retVal;
}
@@ -483,8 +485,8 @@ public:
char colors[] = "RGB";
char buffer[1024];
for( int i = 0; i < t->getCount(); i++) {
unsigned char c = t->toInt(i, BYTE);
for ( int i = 0; i < t->getCount(); i++) {
unsigned char c = t->toInt (i, BYTE);
buffer[i] = c < 3 ? colors[c] : ' ';
}