Commit 8213c577 authored by Keith Bennett's avatar Keith Bennett

Only compare dims for applicable block types

This fixes issue SDF/SDF_utilities#1
parent e09a6b87
......@@ -1721,10 +1721,23 @@ int diff_block(sdf_file_t **handles, sdf_block_t *b1, sdf_block_t *b2, int inum)
if (b1->datatype != b2->datatype) gotdiff = 1;
if (b1->ndims != b2->ndims) gotdiff = 1;
for (i = 0; i < b1->ndims; i++) {
if (b1->dims[i] == b2->dims[i])
continue;
gotdiff = 1;
switch (b1->blocktype) {
case SDF_BLOCKTYPE_PLAIN_DERIVED:
case SDF_BLOCKTYPE_PLAIN_VARIABLE:
case SDF_BLOCKTYPE_POINT_DERIVED:
case SDF_BLOCKTYPE_POINT_VARIABLE:
case SDF_BLOCKTYPE_ARRAY:
case SDF_BLOCKTYPE_LAGRANGIAN_MESH:
case SDF_BLOCKTYPE_PLAIN_MESH:
case SDF_BLOCKTYPE_POINT_MESH:
for (i = 0; i < b1->ndims; i++) {
if (b1->dims[i] == b2->dims[i])
continue;
gotdiff = 1;
}
break;
default:
break;
}
if (gotdiff) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment