Changeset 8839
- Timestamp:
- Sep 19, 2006, 1:54:43 PM (20 years ago)
- Location:
- trunk/psLib
- Files:
-
- 4 edited
-
src/types/psHash.h (modified) (2 diffs)
-
src/types/psPixels.c (modified) (6 diffs)
-
src/types/psPixels.h (modified) (3 diffs)
-
test/types/execute_tap (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psHash.h
r4920 r8839 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $14 * @date $Date: 200 5-08-31 02:07:12$13 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-09-19 23:54:43 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 57 57 ; 58 58 59 60 59 /// Allocate hash buckets in table. 61 60 psHash* psHashAlloc( -
trunk/psLib/src/types/psPixels.c
r8232 r8839 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 8-08 23:32:23 $9 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-09-19 23:54:43 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 26 26 static void pixelsFree(psPixels* pixels) 27 27 { 28 if (pixels != NULL) { 29 psFree(pixels->data); 30 } 28 psFree(pixels->data); 31 29 } 32 30 … … 296 294 psError(PS_ERR_BAD_PARAMETER_NULL, true, 297 295 _("Input psPixels can not be NULL.")); 296 psFree(out); 298 297 return NULL; 299 298 } … … 333 332 } 334 333 335 bool p_psPixelsPrint (FILE *fd, psPixels* pixels, const char *name) 336 { 337 338 fprintf (fd, "psPixels: %s\n", name); 334 bool p_psPixelsPrint (FILE *fd, 335 psPixels* pixels, 336 const char *name) 337 { 338 if (fd == NULL) { 339 fd = stdout; 340 } else { 341 if ( fprintf(fd, "\n") < 0 ) { 342 psError(PS_ERR_IO, true, 343 "Invalid file pointer in p_psPixelsPrint. Could not write to fd.\n"); 344 return false; 345 } 346 } 347 348 if (name != NULL) { 349 fprintf (fd, "psPixels: %s\n", name); 350 } 339 351 340 352 if (pixels == NULL) { … … 398 410 if (pixels == NULL) { 399 411 psError(PS_ERR_BAD_PARAMETER_NULL, true, _("Input psPixels can not be NULL.")); 400 out.x = 0; //XXX: should be NAN when changed to float401 out.y = 0; //XXX: should be NAN when changed to float412 out.x = NAN; //XXX: should be NAN when changed to float 413 out.y = NAN; //XXX: should be NAN when changed to float 402 414 return out; 403 415 } 404 416 if (position >= pixels->n) { 405 417 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid position. Number too large\n"); 406 out.x = 0; //XXX: should be NAN when changed to float407 out.y = 0; //XXX: should be NAN when changed to float418 out.x = NAN; //XXX: should be NAN when changed to float 419 out.y = NAN; //XXX: should be NAN when changed to float 408 420 return out; 409 421 } … … 413 425 if (position < 0) { 414 426 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid position. Negative number too large\n"); 415 out.x = 0; //XXX: should be NAN when changed to float416 out.y = 0; //XXX: should be NAN when changed to float427 out.x = NAN; //XXX: should be NAN when changed to float 428 out.y = NAN; //XXX: should be NAN when changed to float 417 429 return out; 418 430 } -
trunk/psLib/src/types/psPixels.h
r6874 r8839 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 4-17 22:00:03 $9 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-09-19 23:54:43 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 #define P_PSPIXELS_SET_NALLOC(pix,n) *(long*)&pix->nalloc = n 52 52 53 53 54 /** Allocates a new psPixels structure 54 55 * … … 77 78 psPixels* psPixelsRealloc( 78 79 psPixels* pixels, ///< psPixels to resize, or NULL to create new psPixels 79 long nalloc ///< the size of the coordinate vectors80 long nalloc ///< the size of the coordinate vectors 80 81 ); 81 82 82 83 /** Add a pixel location to a psPixels 83 84 * 85 * Grow the psPixels input by growth. If growth is less that 1, 10 is used. If a NULL 86 * psPixels is given, a new one is created. 87 * 84 88 * @return psPixels* psPixels with the value appended. 85 89 */ 86 90 psPixels* p_psPixelsAppend( 87 psPixels* pixels, ///< psPixels to append new coordinate to. NULL creates a new one. 88 long growth, 89 ///< number of elements to grow the psPixels list, if necessary. if growth < 1, 10 is used. 90 float x, ///< x coordinate to append 91 float y ///< y coordinate to append 91 psPixels* pixels, ///< psPixels to append new coordinate to. 92 long growth, ///< Number of elements to grow the pixels list if necessary. 93 float x, ///< x coordinate to append 94 float y ///< y coordinate to append 92 95 ); 93 96 -
trunk/psLib/test/types/execute_tap
r8805 r8839 1 make tests1 make 2 2 ./tap_psArray_all 3 3 ./tap_psListIterator 4 ./tap_psMetadataConfigParse 4 ./tap_psMetadataConfigParse_time 5 ./tap_psMetadataConfigRead 5 6 ./tap_psMetadata_copying 6 7 ./tap_psMetadata_creating … … 12 13 ./tap_psMetadata_polynomials 13 14 ./tap_psArguments_all 15 ./tap_psPixels_all
Note:
See TracChangeset
for help on using the changeset viewer.
