Changeset 6887 for trunk/stac/src/stacRead.c
- Timestamp:
- Apr 18, 2006, 12:20:45 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/stac/src/stacRead.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/stac/src/stacRead.c
r6771 r6887 13 13 int nFiles = filenames->n; // The number of input files 14 14 psArray *images = psArrayAlloc(nFiles); // The input files, to be returned 15 images->n = nFiles; 15 16 assert(!headers || ! *headers || (*headers)->n == nFiles); 16 17 if (headers && ! *headers) { 17 18 *headers = psArrayAlloc(nFiles); 19 (*headers)->n = nFiles; 18 20 } 19 21 … … 71 73 psArray *coords = psArrayAlloc(BUFFER); // The array of coordinates to be returned 72 74 float x, y; // Coordinates to read 73 int num = 0; // Number of coordinates read74 75 while (fscanf(file, "%f %f\n", &x, &y) == 2) { 75 76 psPlane *coord = psPlaneAlloc();// A coordinate 76 77 coord->x = x; 77 78 coord->y = y; 78 coords->data[num] = coord; 79 num++; 80 if (num % BUFFER) { 81 coords = psArrayRealloc(coords, num + BUFFER); 82 } 83 } 84 coords->n = num; 79 coords->data[coords->n] = coord; 80 coords->n++; 81 if (coords->n % BUFFER == 0) { 82 coords = psArrayRealloc(coords, coords->n + BUFFER); 83 } 84 } 85 85 86 86 psTrace("stac.read.coords", 5, "%d coordinates read.\n", num); … … 184 184 int nFiles = filenames->n; // The number of input files 185 185 psArray *maps = psArrayAlloc(nFiles); // The maps, to be returned 186 maps->n = nFiles; 186 187 char mapfile[MAXCHAR]; // Filename of map 187 188
Note:
See TracChangeset
for help on using the changeset viewer.
