Changeset 5421 for trunk


Ignore:
Timestamp:
May 5, 2015, 12:55:33 AM (10 years ago)
Author:
ldelgass
Message:

Reject invalid keyword ordering in DX: rank keyword must precede shape keyword.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/src/RpDxToVtk.c

    r5389 r5421  
    501501        } else if (sscanf(line, "object %*d class array type %*s shape 3 rank 1"
    502502                          " items %d data follows", &nPoints) == 1) {
     503            // XXX: Deprecated, invalid ordering of keywords
     504            fprintf(stderr, "Invalid DX: 'rank' keyword should precede 'shape'.");
     505            return TCL_ERROR;
     506        } else if (sscanf(line, "object %*d class array type %*s rank 1 shape 3"
     507                          " items %d data follows", &nPoints) == 1) {
    503508#ifdef notdef
    504509                fprintf(stderr, "found class array type shape 3 nPoints=%d\n",
     
    525530                }
    526531            }
    527         } else if (sscanf(line, "object %*d class array type %*s rank 1 shape 3"
     532        } else if (sscanf(line, "object %*d class array type %*s rank 0"
    528533                          " items %d data follows", &nPoints) == 1) {
    529 #ifdef notdef
    530                 fprintf(stderr, "found class array type shape 3 nPoints=%d\n",
    531                         nPoints);
    532 #endif
    533             if (isUniform) {
    534                 hasVectors = 1;
    535                 if (GetUniformFieldVectors(interp, nPoints, count, &p, pend, fieldObjPtr)
    536                     != TCL_OK) {
    537                     return TCL_ERROR;
    538                 }
    539             } else {
    540                 // This is a 2D point cloud in xy with a uniform zgrid
    541                 isUniform = 0;
    542                 nXYPoints = nPoints;
    543                 if (nXYPoints < 0) {
    544                     sprintf(mesg, "bad # points %d", nXYPoints);
    545                     Tcl_AppendResult(interp, mesg, (char *)NULL);
    546                     return TCL_ERROR;
    547                 }
    548                 points = malloc(sizeof(double) * nXYPoints * 2);
    549                 if (GetPoints(interp, points, nXYPoints, &p, pend) != TCL_OK) {
    550                     return TCL_ERROR;
    551                 }
    552             }
    553         } else if (sscanf(line, "object %*d class array type %*s rank 0"
    554                           " %*s %d data follows", &nPoints) == 1) {
    555534#ifdef notdef
    556535            fprintf(stderr, "found class array type rank 0 nPoints=%d\n",
Note: See TracChangeset for help on using the changeset viewer.