Index: trunk/psLib/src/collections/psArray.c
===================================================================
--- trunk/psLib/src/collections/psArray.c	(revision 1382)
+++ trunk/psLib/src/collections/psArray.c	(revision 1385)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-15 22:18:02 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-04 23:37:39 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -67,16 +67,17 @@
         psError(__func__, "Null input vector\n");
         return NULL;
-    } else if(in->nalloc != nalloc) {                    // No need to realloc to same size
-        if(nalloc < in->n) {
-            for (int i = nalloc; i < in->n; i++) {   // For reduction in vector size
-                psFree(in->data[i]);
+    } else
+        if(in->nalloc != nalloc) {                    // No need to realloc to same size
+            if(nalloc < in->n) {
+                for (int i = nalloc; i < in->n; i++) {   // For reduction in vector size
+                    psFree(in->data[i]);
+                }
+                in->n = nalloc;
             }
-            in->n = nalloc;
+
+            // Realloc after decrementation to avoid accessing freed array elements
+            in->data = psRealloc(in->data,nalloc*sizeof(psPTR));
+            in->nalloc = nalloc;
         }
-
-        // Realloc after decrementation to avoid accessing freed array elements
-        in->data = psRealloc(in->data,nalloc*sizeof(psPTR));
-        in->nalloc = nalloc;
-    }
 
     return in;
Index: trunk/psLib/src/collections/psBitSet.c
===================================================================
--- trunk/psLib/src/collections/psBitSet.c	(revision 1382)
+++ trunk/psLib/src/collections/psBitSet.c	(revision 1385)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-01 21:48:11 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-04 23:37:39 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -126,11 +126,13 @@
         psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return inBitSet;
-    } else if(bit < 0) {
-        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
-        return inBitSet;
-    } else if(bit > inBitSet->n*8-1) {
-        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
-        return inBitSet;
-    }
+    } else
+        if(bit < 0) {
+            psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
+            return inBitSet;
+        } else
+            if(bit > inBitSet->n*8-1) {
+                psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
+                return inBitSet;
+            }
 
     // Variable byte is the byte in the array that contains the bit to be set
@@ -148,11 +150,13 @@
         psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);
         return 0;
-    } else if(bit < 0) {
-        psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
-        return 0;
-    } else if(bit > inBitSet->n*8-1) {
-        psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
-        return 0;
-    }
+    } else
+        if(bit < 0) {
+            psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit);
+            return 0;
+        } else
+            if(bit > inBitSet->n*8-1) {
+                psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit);
+                return 0;
+            }
 
     // Variable byte is the byte in the array that contains the bit to be tested
Index: trunk/psLib/src/collections/psList.c
===================================================================
--- trunk/psLib/src/collections/psList.c	(revision 1382)
+++ trunk/psLib/src/collections/psList.c	(revision 1385)
@@ -6,6 +6,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-15 22:18:02 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-04 23:37:39 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -349,9 +349,10 @@
     if (list->iter == ITER_INIT_HEAD) {
         return list->head;
-    } else if (list->iter == ITER_INIT_TAIL) {
-        return list->tail;
-    } else {
-        return list->iter;
-    }
+    } else
+        if (list->iter == ITER_INIT_TAIL) {
+            return list->tail;
+        } else {
+            return list->iter;
+        }
 }
 
@@ -360,9 +361,10 @@
     if (list->iter == ITER_INIT_HEAD) {
         return 0;
-    } else if (list->iter == ITER_INIT_TAIL) {
-        return list->size-1;
-    } else {
-        return list->iterIndex;
-    }
+    } else
+        if (list->iter == ITER_INIT_TAIL) {
+            return list->size-1;
+        } else {
+            return list->iterIndex;
+        }
 }
 
Index: trunk/psLib/src/collections/psMetadata.c
===================================================================
--- trunk/psLib/src/collections/psMetadata.c	(revision 1382)
+++ trunk/psLib/src/collections/psMetadata.c	(revision 1385)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 21:05:24 $
+*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 23:37:39 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,15 +65,15 @@
 {
     psMetadataType type;
-    
+
     type = metadataItem->type;
-    
+
     if ( metadataItem == NULL ) {
-            return ;
-        }
-        
+        return ;
+    }
+
     psFree( metadataItem->name );
     psFree( metadataItem->comment );
     psFree( metadataItem->items );
-    
+
     if ( type == PS_META_STR ||
             type == PS_META_IMG ||
@@ -82,6 +82,6 @@
             type == PS_META_ASTROM ||
             type == PS_META_UNKNOWN ) {
-            psFree( metadataItem->data.V );
-        }
+        psFree( metadataItem->data.V );
+    }
 }
 
@@ -89,6 +89,6 @@
 {
     if ( metadata == NULL ) {
-            return ;
-        }
+        return ;
+    }
     psFree( metadata->list );
     psFree( metadata->table );
@@ -103,14 +103,14 @@
     va_list argPtr;
     psMetadataItem *metadataItem = NULL;
-    
+
     // Get the variable list parameters to pass to allocation function
     va_start( argPtr, comment );
-    
+
     // Call metadata item allocation
     metadataItem = psMetadataItemAllocV( name, type, comment, argPtr );
-    
+
     // Clean up stack after variable arguement has been used
     va_end( argPtr );
-    
+
     return metadataItem;
 }
@@ -119,67 +119,67 @@
 {
     psMetadataItem * metadataItem = NULL;
-    
+
     if ( name == NULL ) {
-            psError( __func__, "Null value for string not allowed" );
-            return NULL;
-        }
-        
+        psError( __func__, "Null value for string not allowed" );
+        return NULL;
+    }
+
     // Allocate metadata item
     metadataItem = ( psMetadataItem * ) psAlloc( sizeof( psMetadataItem ) );
     if ( metadataItem == NULL ) {
-            psAbort( __func__, "Failed to allocate memory" );
-        }
-        
+        psAbort( __func__, "Failed to allocate memory" );
+    }
+
     // Set deallocator
     p_psMemSetDeallocator( metadataItem, ( psFreeFcn ) metadataItemFree );
-    
+
     // Allocate and set metadata item comment
     metadataItem->comment = ( char * ) psAlloc( sizeof( char ) * MAX_STRING_LENGTH );
     if ( comment == NULL ) {
-            // Per SDRS, null isn't allowed, must use "" instead
-            strncpy( metadataItem->comment, "", MAX_STRING_LENGTH );
-        } else {
-            strncpy( metadataItem->comment, comment, MAX_STRING_LENGTH );
-        }
-        
+        // Per SDRS, null isn't allowed, must use "" instead
+        strncpy( metadataItem->comment, "", MAX_STRING_LENGTH );
+    } else {
+        strncpy( metadataItem->comment, comment, MAX_STRING_LENGTH );
+    }
+
     // Set metadata item unique id
     *( int* ) ( &metadataItem->id ) = ++metadataId;
-    
+
     // Set metadata item type
     metadataItem->type = type;
-    
+
     // Set metadata item value
     switch ( type ) {
-            case PS_META_BOOL:
-            metadataItem->data.B = ( bool ) va_arg( argPtr, int );
-            break;
-            case PS_META_S32:
-            metadataItem->data.S32 = va_arg( argPtr, psS32 );
-            break;
-            case PS_META_F32:
-            metadataItem->data.F32 = ( psF32 ) va_arg( argPtr, psF64 );
-            break;
-            case PS_META_F64:
-            metadataItem->data.F64 = va_arg( argPtr, psF64 );
-            break;
-            case PS_META_STR:
-            metadataItem->data.V = psStringNCopy( va_arg( argPtr, char* ), MAX_STRING_LENGTH );
-            break;
-            case PS_META_IMG:
-            case PS_META_JPEG:
-            case PS_META_PNG:
-            case PS_META_ASTROM:
-            case PS_META_UNKNOWN:
-            default:
-            psError( __func__, "Invalid psMetadataType: %d", type );
-        }
-        
+    case PS_META_BOOL:
+        metadataItem->data.B = ( bool ) va_arg( argPtr, int );
+        break;
+    case PS_META_S32:
+        metadataItem->data.S32 = va_arg( argPtr, psS32 );
+        break;
+    case PS_META_F32:
+        metadataItem->data.F32 = ( psF32 ) va_arg( argPtr, psF64 );
+        break;
+    case PS_META_F64:
+        metadataItem->data.F64 = va_arg( argPtr, psF64 );
+        break;
+    case PS_META_STR:
+        metadataItem->data.V = psStringNCopy( va_arg( argPtr, char* ), MAX_STRING_LENGTH );
+        break;
+    case PS_META_IMG:
+    case PS_META_JPEG:
+    case PS_META_PNG:
+    case PS_META_ASTROM:
+    case PS_META_UNKNOWN:
+    default:
+        psError( __func__, "Invalid psMetadataType: %d", type );
+    }
+
     // Allocate and set metadata item name
     metadataItem->name = ( char * ) psAlloc( sizeof( char ) * MAX_STRING_LENGTH );
     vsprintf( metadataItem->name, name, argPtr );
-    
+
     // Allocate metadata items with same name.
     metadataItem->items = psListAlloc( NULL );
-    
+
     return metadataItem;
 }
@@ -190,28 +190,28 @@
     psHash *table = NULL;
     psMetadata *metadata = NULL;
-    
+
     // Allocate metadata
     metadata = ( psMetadata * ) psAlloc( sizeof( psMetadata ) );
     if ( metadata == NULL ) {
-            psAbort( __func__, "Failed to allocate metadata" );
-        }
-        
+        psAbort( __func__, "Failed to allocate metadata" );
+    }
+
     // Set deallocator
     p_psMemSetDeallocator( metadata, ( psFreeFcn ) metadataFree );
-    
+
     // Allocate metadata's internal containers
     list = ( psList * ) psListAlloc( NULL );
     if ( list == NULL ) {
-            psAbort( __func__, "Failed to allocate list" );
-        }
-        
+        psAbort( __func__, "Failed to allocate list" );
+    }
+
     table = ( psHash * ) psHashAlloc( 10 );
     if ( table == NULL ) {
-            psAbort( __func__, "Failed to allocate table" );
-        }
-        
+        psAbort( __func__, "Failed to allocate table" );
+    }
+
     metadata->list = list;
     metadata->table = table;
-    
+
     return metadata;
 }
@@ -224,48 +224,49 @@
     psMetadataItem *value = NULL;
     psMetadataType type = PS_META_ITEM_SET;
-    
+
     if ( md == NULL ) {
-            psError( __func__, "Null metadata collection not allowed" );
-            return false;
-        }
-        
+        psError( __func__, "Null metadata collection not allowed" );
+        return false;
+    }
+
     if ( metadataItem == NULL ) {
-            psError( __func__, "Null metadata item not allowed" );
-            return false;
-        }
-        
+        psError( __func__, "Null metadata item not allowed" );
+        return false;
+    }
+
     type = metadataItem->type;
-    
+
     mdTable = md->table;
     if ( mdTable == NULL ) {
-            psError( __func__, "Null metadata table not allowed" );
-            return false;
-        }
-        
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return false;
-        }
-        
+        psError( __func__, "Null metadata table not allowed" );
+        return false;
+    }
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return false;
+    }
+
     key = metadataItem->name;
     if ( key == NULL ) {
-            psError( __func__, "Null key item not allowed" );
-            return false;
-        }
-        
+        psError( __func__, "Null key item not allowed" );
+        return false;
+    }
+
     // Check if key is already in table
     value = ( psMetadataItem* ) psHashLookup( mdTable, key );
     if ( value != NULL && type != PS_META_ITEM_SET ) {
-    
-            // The key was found and the new metadata item is a leaf node (its type isn't PS_META_ITEM_SET), so
-            // add the new metadata item to hash as a child of the existing metadata item folder node.
-            if ( !psListAdd( value->items, metadataItem, where ) ) {
-                    psError( __func__, "Couldn't add metadata item to items list. Name: %s",
-                             metadataItem->name );
-                    return false;
-                }
-        } else if ( value != NULL ) {
-        
+
+        // The key was found and the new metadata item is a leaf node (its type isn't PS_META_ITEM_SET), so
+        // add the new metadata item to hash as a child of the existing metadata item folder node.
+        if ( !psListAdd( value->items, metadataItem, where ) ) {
+            psError( __func__, "Couldn't add metadata item to items list. Name: %s",
+                     metadataItem->name );
+            return false;
+        }
+    } else
+        if ( value != NULL ) {
+
             // The key was found and the new metadata item is a folder node. Don't add new metadata item, since
             // it will wipe out existing node.
@@ -274,20 +275,20 @@
             return false;
         } else {
-        
+
             // Duplicate key not found. Add new metadata item to metadata collection's hash
             if ( !psHashAdd( mdTable, key, metadataItem ) ) {
-                    psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
-                             metadataItem->name );
-                    return false;
-                }
-        }
-        
+                psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s",
+                         metadataItem->name );
+                return false;
+            }
+        }
+
     // Add all items to metadata collection's list, even if they have the same metadata item names
     if ( !psListAdd( md->list, metadataItem, where ) ) {
-            psError( __func__, "Couldn't add metadata item to metadata collection list. Name: %s",
-                     metadataItem->name );
-            return false;
-        }
-        
+        psError( __func__, "Couldn't add metadata item to metadata collection list. Name: %s",
+                 metadataItem->name );
+        return false;
+    }
+
     return true;
 }
@@ -298,19 +299,19 @@
     va_list argPtr;
     psMetadataItem *metadataItem = NULL;
-    
+
     va_start( argPtr, comment );
     metadataItem = psMetadataItemAllocV( name, type, comment, argPtr );
     va_end( argPtr );
-    
+
     if ( !psMetadataAddItem( md, where, metadataItem ) ) {
-            psError( __func__, "Couldn't add metadata item to metadata collection list. Name: %s",
-                     metadataItem->name );
-            psFree( metadataItem );
-            return false;
-        }
-        
+        psError( __func__, "Couldn't add metadata item to metadata collection list. Name: %s",
+                 metadataItem->name );
+        psFree( metadataItem );
+        return false;
+    }
+
     // Decrement reference count, since the metadata item is now in metadata collection and no longer needed here
     psMemDecrRefCounter( metadataItem );
-    
+
     return true;
 }
@@ -323,72 +324,72 @@
     psMetadataItem *entry = NULL;
     psMetadataItem *entryChild = NULL;
-    
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return false;
-        }
-        
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return false;
+    }
+
     mdTable = md->table;
     if ( mdTable == NULL ) {
-            psError( __func__, "Null metadata table not allowed" );
-            return false;
-        }
-        
+        psError( __func__, "Null metadata table not allowed" );
+        return false;
+    }
+
     // Select removal by key or index
     if ( key != NULL ) {
-    
-            // Remove by key name
-            entry = ( psMetadataItem* ) psHashLookup( mdTable, key );
-            if ( entry == NULL ) {
-                    psError( __func__, "Couldn't find metadata item remove. Name: %s", key );
-                    return false;
-                }
-                
-            numChildren = entry->items->size;
-            if ( entry->type == PS_META_ITEM_SET && numChildren > 0 ) {
-            
-                    // Table entry has children. Entry and children must be removed from metadata collection's list
-                    psListSetIterator( mdList, PS_LIST_HEAD );
-                    entryChild = psListGetCurrent( mdList );
-                    while ( entryChild != NULL ) {
-                            if ( !psListRemove( entry->items, entryChild, PS_LIST_UNKNOWN ) ) {
-                                    psError( __func__, "Couldn't remove metadata item from list. Name: %s", key );
-                                    return false;
-                                }
-                            entryChild = psListGetNext( entry->items );
-                        }
-                }
-                
-            // Remove entry from metadata collection's list
-            if ( !psListRemove( mdList, entry, PS_LIST_UNKNOWN ) ) {
+
+        // Remove by key name
+        entry = ( psMetadataItem* ) psHashLookup( mdTable, key );
+        if ( entry == NULL ) {
+            psError( __func__, "Couldn't find metadata item remove. Name: %s", key );
+            return false;
+        }
+
+        numChildren = entry->items->size;
+        if ( entry->type == PS_META_ITEM_SET && numChildren > 0 ) {
+
+            // Table entry has children. Entry and children must be removed from metadata collection's list
+            psListSetIterator( mdList, PS_LIST_HEAD );
+            entryChild = psListGetCurrent( mdList );
+            while ( entryChild != NULL ) {
+                if ( !psListRemove( entry->items, entryChild, PS_LIST_UNKNOWN ) ) {
                     psError( __func__, "Couldn't remove metadata item from list. Name: %s", key );
                     return false;
                 }
-                
-            // Remove entry from metadata collection's table
-            if ( !psHashRemove( mdTable, key ) ) {
-                    psError( __func__, "Couldn't remove metadata item from table. Name: %s", key );
-                    return false;
-                }
-        } else {
-        
-            // Remove by index
-            entry = psListGet( mdList, where );
-            if ( entry == NULL ) {
-                    psError( __func__, "Couldn't find metadata item from list. Index: %d", where );
-                    return false;
-                }
-                
-            key = entry->name;
-            if ( key == NULL ) {
-                    psError( __func__, "Null key name not allowed. Index: %d", where );
-                    return false;
-                }
-                
-            // Use recursive remove, now that key is known
-            psMetadataRemove( md, PS_LIST_UNKNOWN, key );
-        }
-        
+                entryChild = psListGetNext( entry->items );
+            }
+        }
+
+        // Remove entry from metadata collection's list
+        if ( !psListRemove( mdList, entry, PS_LIST_UNKNOWN ) ) {
+            psError( __func__, "Couldn't remove metadata item from list. Name: %s", key );
+            return false;
+        }
+
+        // Remove entry from metadata collection's table
+        if ( !psHashRemove( mdTable, key ) ) {
+            psError( __func__, "Couldn't remove metadata item from table. Name: %s", key );
+            return false;
+        }
+    } else {
+
+        // Remove by index
+        entry = psListGet( mdList, where );
+        if ( entry == NULL ) {
+            psError( __func__, "Couldn't find metadata item from list. Index: %d", where );
+            return false;
+        }
+
+        key = entry->name;
+        if ( key == NULL ) {
+            psError( __func__, "Null key name not allowed. Index: %d", where );
+            return false;
+        }
+
+        // Use recursive remove, now that key is known
+        psMetadataRemove( md, PS_LIST_UNKNOWN, key );
+    }
+
     return true;
 }
@@ -398,22 +399,22 @@
     psHash * mdTable = NULL;
     psMetadataItem *entry = NULL;
-    
+
     mdTable = md->table;
     if ( mdTable == NULL ) {
-            psError( __func__, "Null metadata table not allowed" );
-            return NULL;
-        }
-        
+        psError( __func__, "Null metadata table not allowed" );
+        return NULL;
+    }
+
     if ( key == NULL ) {
-            psError( __func__, "Null key name not allowed" );
-            return NULL;
-        }
-        
+        psError( __func__, "Null key name not allowed" );
+        return NULL;
+    }
+
     entry = ( psMetadataItem* ) psHashLookup( mdTable, key );
     if ( entry == NULL ) {
-            psError( __func__, "Could not find metadata item with given key. Key: %s", key );
-            return NULL;
-        }
-        
+        psError( __func__, "Could not find metadata item with given key. Key: %s", key );
+        return NULL;
+    }
+
     return entry;
 }
@@ -423,17 +424,17 @@
     psList * mdList = NULL;
     psMetadataItem *entry = NULL;
-    
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return NULL;
-        }
-        
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return NULL;
+    }
+
     entry = ( psMetadataItem* ) psListGet( mdList, where );
     if ( entry == NULL ) {
-            psError( __func__, "Couldn't find metadata item with given index. Index: %d", where );
-            return NULL;
-        }
-        
+        psError( __func__, "Couldn't find metadata item with given index. Index: %d", where );
+        return NULL;
+    }
+
     return entry;
 }
@@ -442,13 +443,13 @@
 {
     psList * mdList = NULL;
-    
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return false;
-        }
-        
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return false;
+    }
+
     psListSetIterator( mdList, where );
-    
+
     return true;
 }
@@ -458,33 +459,33 @@
     psList * mdList = NULL;
     psMetadataItem *entry = NULL;
-    
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return NULL;
-        }
-        
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return NULL;
-        }
-        
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return NULL;
+    }
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return NULL;
+    }
+
     psListSetIterator( mdList, which );
     entry = psListGetCurrent( mdList );
     while ( entry != NULL ) {
-            if ( !strncmp( match, entry->name, strlen( match ) ) ) {
-            
-                    // Match found
-                    return entry;
-                }
-            entry = psListGetNext( mdList );
-        }
-        
+        if ( !strncmp( match, entry->name, strlen( match ) ) ) {
+
+            // Match found
+            return entry;
+        }
+        entry = psListGetNext( mdList );
+    }
+
     // Match not found
     if ( entry == NULL ) {
-            psError( __func__, "Couldn't find metadata item with given match. Match: %s", match );
-        }
-        
+        psError( __func__, "Couldn't find metadata item with given match. Match: %s", match );
+    }
+
     return entry;
 }
@@ -494,33 +495,33 @@
     psList * mdList = NULL;
     psMetadataItem *entry = NULL;
-    
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return NULL;
-        }
-        
-    mdList = md->list;
-    if ( mdList == NULL ) {
-            psError( __func__, "Null metadata list not allowed" );
-            return NULL;
-        }
-        
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return NULL;
+    }
+
+    mdList = md->list;
+    if ( mdList == NULL ) {
+        psError( __func__, "Null metadata list not allowed" );
+        return NULL;
+    }
+
     psListSetIterator( mdList, which );
     entry = psListGetCurrent( mdList );
     while ( entry != NULL ) {
-            if ( !strncmp( match, entry->name, strlen( match ) ) ) {
-            
-                    // Match found
-                    return entry;
-                }
-            entry = psListGetPrevious( mdList );
-        }
-        
+        if ( !strncmp( match, entry->name, strlen( match ) ) ) {
+
+            // Match found
+            return entry;
+        }
+        entry = psListGetPrevious( mdList );
+    }
+
     // Match not found
     if ( entry == NULL ) {
-            psError( __func__, "Couldn't find metadata item with given match. Match: %s", match );
-        }
-        
+        psError( __func__, "Couldn't find metadata item with given match. Match: %s", match );
+    }
+
     return entry;
 }
@@ -529,47 +530,47 @@
 {
     psMetadataType type;
-    
+
     if ( fd == NULL ) {
-            psError( __func__, "Null file descriptor not allowed" );
-            return ;
-        }
-        
+        psError( __func__, "Null file descriptor not allowed" );
+        return ;
+    }
+
     if ( format == NULL ) {
-            psError( __func__, "Null format not allowed" );
-            return ;
-        }
-        
+        psError( __func__, "Null format not allowed" );
+        return ;
+    }
+
     if ( metadataItem == NULL ) {
-            psError( __func__, "Null metadata not allowed" );
-            return ;
-        }
-        
+        psError( __func__, "Null metadata not allowed" );
+        return ;
+    }
+
     type = metadataItem->type;
-    
+
     switch ( type ) {
-            case PS_META_BOOL:
-            fprintf( fd, format, metadataItem->data.B );
-            break;
-            case PS_META_S32:
-            fprintf( fd, format, metadataItem->data.S32 );
-            break;
-            case PS_META_F32:
-            fprintf( fd, format, metadataItem->data.F32 );
-            break;
-            case PS_META_F64:
-            fprintf( fd, format, metadataItem->data.F64 );
-            break;
-            case PS_META_STR:
-            fprintf( fd, format, metadataItem->data.V );
-            break;
-            case PS_META_ITEM_SET:
-            case PS_META_IMG:
-            case PS_META_JPEG:
-            case PS_META_PNG:
-            case PS_META_ASTROM:
-            case PS_META_UNKNOWN:
-            default:
-            psError( __func__, " Invalid psMetadataType to print: %d", type );
-        }
+    case PS_META_BOOL:
+        fprintf( fd, format, metadataItem->data.B );
+        break;
+    case PS_META_S32:
+        fprintf( fd, format, metadataItem->data.S32 );
+        break;
+    case PS_META_F32:
+        fprintf( fd, format, metadataItem->data.F32 );
+        break;
+    case PS_META_F64:
+        fprintf( fd, format, metadataItem->data.F64 );
+        break;
+    case PS_META_STR:
+        fprintf( fd, format, metadataItem->data.V );
+        break;
+    case PS_META_ITEM_SET:
+    case PS_META_IMG:
+    case PS_META_JPEG:
+    case PS_META_PNG:
+    case PS_META_ASTROM:
+    case PS_META_UNKNOWN:
+    default:
+        psError( __func__, " Invalid psMetadataType to print: %d", type );
+    }
 }
 
@@ -590,100 +591,102 @@
     int keyNum = 0;
     psMetadataType metadataItemType;
-    
+
     if ( fd == NULL ) {
-            psError( __func__, "Null FITS file descriptor not allowed" );
-            return NULL;
-        }
-        
+        psError( __func__, "Null FITS file descriptor not allowed" );
+        return NULL;
+    }
+
     if ( extname == NULL && extnum == 0 ) {
-            psError( __func__, "Null extname AND extnum = 0 not allowed" );
-            return NULL;
-        } else if ( extname && extnum ) {
+        psError( __func__, "Null extname AND extnum = 0 not allowed" );
+        return NULL;
+    } else
+        if ( extname && extnum ) {
             psError( __func__, "Both extname AND extnum arguments should not have values." );
             return NULL;
         }
-        
+
     // Allocate metadata if user didn't
     if ( output == NULL ) {
-            output = psMetadataAlloc();
-        }
-        
+        output = psMetadataAlloc();
+    }
+
     // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one.
     if ( extname == NULL ) {
-            if ( fits_movabs_hdu( fd, extnum, &hduType, &status ) != 0 ) {
-                    fits_get_errstatus( status, fitsErr );
-                    psError( __func__, "FITS error while locating header: %s", fitsErr );
-                    status = 0;
-                    return output;
-                }
-        } else if ( extnum > 0 ) {
+        if ( fits_movabs_hdu( fd, extnum, &hduType, &status ) != 0 ) {
+            fits_get_errstatus( status, fitsErr );
+            psError( __func__, "FITS error while locating header: %s", fitsErr );
+            status = 0;
+            return output;
+        }
+    } else
+        if ( extnum > 0 ) {
             tempExtname = ( char* ) extname;
             if ( fits_movnam_hdu( fd, ANY_HDU, tempExtname, 0, &status ) != 0 ) {
-                    fits_get_errstatus( status, fitsErr );
-                    psError( __func__, "FITS error while locating header: %s", fitsErr );
-                    status = 0;
-                    return output;
-                }
-        }
-        
+                fits_get_errstatus( status, fitsErr );
+                psError( __func__, "FITS error while locating header: %s", fitsErr );
+                status = 0;
+                return output;
+            }
+        }
+
     // Get number of key names
     if ( fits_get_hdrpos( fd, &numKeys, &keyNum, &status ) != 0 ) {
+        fits_get_errstatus( status, fitsErr );
+        psError( __func__, "FITS error while reading keys: %s", fitsErr );
+        status = 0;
+        return output;
+    }
+
+    // Get each key name. Keywords start at one.
+    for ( i = 1; i <= numKeys; i++ ) {
+        if ( fits_read_keyn( fd, i, keyName, keyValue, keyComment, &status ) != 0 ) {
             fits_get_errstatus( status, fitsErr );
-            psError( __func__, "FITS error while reading keys: %s", fitsErr );
+            psError( __func__, "FITS error while reading key number %d: %s", i, fitsErr );
             status = 0;
             return output;
         }
-        
-    // Get each key name. Keywords start at one.
-    for ( i = 1; i <= numKeys; i++ ) {
-            if ( fits_read_keyn( fd, i, keyName, keyValue, keyComment, &status ) != 0 ) {
-                    fits_get_errstatus( status, fitsErr );
-                    psError( __func__, "FITS error while reading key number %d: %s", i, fitsErr );
-                    status = 0;
-                    return output;
-                }
-            if ( fits_get_keytype( keyValue, &keyType, &status ) != 0 ) {
-                    fits_get_errstatus( status, fitsErr );
-                    if ( status != VALUE_UNDEFINED ) {
-                            psError( __func__, "FITS error while determining key type: %s", fitsErr );
-                            status = 0;
-                            return output;
-                        } else {
-                            // Some keywords are still valid even though they don't have a type or value, like COMMENTS
-                            keyType = 'C';
-                            status = 0;
-                        }
-                }
-                
-            switch ( keyType ) {
-                    case 'I':
-                    metadataItemType = PS_META_S32;
-                    success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, atoi( keyValue ) );
-                    break;
-                    case 'F':
-                    metadataItemType = PS_META_F64;
-                    success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, atof( keyValue ) );
-                    break;
-                    case 'C':
-                    metadataItemType = PS_META_STR;
-                    success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, keyValue );
-                    break;
-                    case 'L':
-                    metadataItemType = PS_META_BOOL;
-                    tempBool = ( keyValue[ 0 ] == 'T' ) ? 1 : 0;
-                    success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, tempBool );
-                    break;
-                    case 'U':
-                    case 'X':
-                    default:
-                    psError( __func__, "Invalid psMetadataType: %c", keyType );
-                    return output;
-                }
-                
-            if ( !success ) {
-                    psError( __func__, "Failed to add metadata item. Name: %s", keyName );
-                }
-        }
-        
+        if ( fits_get_keytype( keyValue, &keyType, &status ) != 0 ) {
+            fits_get_errstatus( status, fitsErr );
+            if ( status != VALUE_UNDEFINED ) {
+                psError( __func__, "FITS error while determining key type: %s", fitsErr );
+                status = 0;
+                return output;
+            } else {
+                // Some keywords are still valid even though they don't have a type or value, like COMMENTS
+                keyType = 'C';
+                status = 0;
+            }
+        }
+
+        switch ( keyType ) {
+        case 'I':
+            metadataItemType = PS_META_S32;
+            success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, atoi( keyValue ) );
+            break;
+        case 'F':
+            metadataItemType = PS_META_F64;
+            success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, atof( keyValue ) );
+            break;
+        case 'C':
+            metadataItemType = PS_META_STR;
+            success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, keyValue );
+            break;
+        case 'L':
+            metadataItemType = PS_META_BOOL;
+            tempBool = ( keyValue[ 0 ] == 'T' ) ? 1 : 0;
+            success = psMetadataAdd( output, PS_LIST_HEAD, keyName, metadataItemType, keyComment, tempBool );
+            break;
+        case 'U':
+        case 'X':
+        default:
+            psError( __func__, "Invalid psMetadataType: %c", keyType );
+            return output;
+        }
+
+        if ( !success ) {
+            psError( __func__, "Failed to add metadata item. Name: %s", keyName );
+        }
+    }
+
     return output;
 }
Index: trunk/psLib/src/collections/psMetadata.h
===================================================================
--- trunk/psLib/src/collections/psMetadata.h	(revision 1382)
+++ trunk/psLib/src/collections/psMetadata.h	(revision 1385)
@@ -10,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-04 22:11:09 $
+*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 23:37:39 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -59,19 +59,19 @@
  */
 typedef struct psMetadataItem
+{
+    const int id;                       ///< Unique ID for metadata item.
+    char *restrict name;                ///< Name of metadata item.
+    psMetadataType type;                ///< Type of metadata item.
+    union
     {
-        const int id;                       ///< Unique ID for metadata item.
-        char *restrict name;                ///< Name of metadata item.
-        psMetadataType type;                ///< Type of metadata item.
-        union
-            {
-                bool B;
-                psS32 S32;                  ///< Signed 32-bit integer data.
-                psF32 F32;                  ///< Single-precision float data.
-                psF64 F64;                  ///< Double-precision float data.
-                psPTR V;                    ///< Pointer to other type of data.
-            }data;                          ///< Union for data types.
-        char *comment;                      ///< Optional comment ("", not NULL).
-        psList *restrict items;             ///< List of psMetadataItems with same name.
-    }
+        bool B;
+        psS32 S32;                  ///< Signed 32-bit integer data.
+        psF32 F32;                  ///< Single-precision float data.
+        psF64 F64;                  ///< Double-precision float data.
+        psPTR V;                    ///< Pointer to other type of data.
+    }data;                          ///< Union for data types.
+    char *comment;                      ///< Optional comment ("", not NULL).
+    psList *restrict items;             ///< List of psMetadataItems with same name.
+}
 psMetadataItem;
 
@@ -83,8 +83,8 @@
  */
 typedef struct psMetadata
-    {
-        psList* restrict list;
-        psHash* restrict table;
-    }
+{
+    psList* restrict list;
+    psHash* restrict table;
+}
 psMetadata;
 
Index: trunk/psLib/src/collections/psScalar.c
===================================================================
--- trunk/psLib/src/collections/psScalar.c	(revision 1382)
+++ trunk/psLib/src/collections/psScalar.c	(revision 1385)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-01 00:14:40 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-04 23:37:39 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Index: trunk/psLib/src/collections/psScalar.h
===================================================================
--- trunk/psLib/src/collections/psScalar.h	(revision 1382)
+++ trunk/psLib/src/collections/psScalar.h	(revision 1385)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-18 23:36:02 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-04 23:37:39 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Index: trunk/psLib/src/collections/psVector.c
===================================================================
--- trunk/psLib/src/collections/psVector.c	(revision 1382)
+++ trunk/psLib/src/collections/psVector.c	(revision 1385)
@@ -8,6 +8,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-07-31 02:28:10 $
+*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-04 23:37:39 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -63,25 +63,25 @@
     psVector * psVec = NULL;
     int elementSize = 0;
-    
+
     // Invalid nalloc
     if ( nalloc < 1 ) {
-            psError( __func__, "Invalid value for nalloc. nalloc: %d\n", nalloc );
-            return NULL;
-        }
-        
+        psError( __func__, "Invalid value for nalloc. nalloc: %d\n", nalloc );
+        return NULL;
+    }
+
     elementSize = PSELEMTYPE_SIZEOF( elemType );
-    
+
     // Create vector struct
     psVec = ( psVector * ) psAlloc( sizeof( psVector ) );
     p_psMemSetDeallocator( psVec, ( psFreeFcn ) vectorFree );
-    
+
     psVec->type.dimen = PS_DIMEN_VECTOR;
     psVec->type.type = elemType;
     psVec->nalloc = nalloc;
     psVec->n = nalloc;
-    
+
     // Create vector data array
     psVec->data.V = psAlloc( nalloc * elementSize );
-    
+
     return psVec;
 }
@@ -91,26 +91,27 @@
     int elementSize = 0;
     psElemType elemType;
-    
+
     // Invalid nalloc
     if ( nalloc < 1 ) {
-            psError( __func__, "Invalid value for realloc (%d)\n", nalloc );
-            return NULL;
-        }
-        
+        psError( __func__, "Invalid value for realloc (%d)\n", nalloc );
+        return NULL;
+    }
+
     if ( in == NULL ) {
-            psError( __func__, "Null input vector\n" );
-            return NULL;
-        } else if ( in->nalloc != nalloc ) {                    // No need to realloc to same size
+        psError( __func__, "Null input vector\n" );
+        return NULL;
+    } else
+        if ( in->nalloc != nalloc ) {                    // No need to realloc to same size
             elemType = in->type.type;
             elementSize = PSELEMTYPE_SIZEOF( elemType );
             if ( nalloc < in->n ) {
-                    in->n = nalloc;
-                }
-                
+                in->n = nalloc;
+            }
+
             // Realloc after decrementation to avoid accessing freed array elements
             in->data.V = psRealloc( in->data.V, nalloc * elementSize );
             in->nalloc = nalloc;
         }
-        
+
     return in;
 }
@@ -119,30 +120,30 @@
 {
     psElemType elemType;
-    
+
     if ( in == NULL ) {
-            return psVectorAlloc( nalloc, type );
-        }
-        
+        return psVectorAlloc( nalloc, type );
+    }
+
     elemType = in->type.type;
-    
+
     if ( in->nalloc == nalloc && elemType == type ) {
-            // it is proper size/type already
-            return in;
-        }
-        
+        // it is proper size/type already
+        return in;
+    }
+
     // Invalid nalloc
     if ( nalloc < 1 ) {
-            psError( __func__, "Invalid value for nalloc (%d)\n", nalloc );
-            psFree( in );
-            return NULL;
-        }
-        
-        
+        psError( __func__, "Invalid value for nalloc (%d)\n", nalloc );
+        psFree( in );
+        return NULL;
+    }
+
+
     in->data.V = psRealloc( in->data.V, nalloc * PSELEMTYPE_SIZEOF( type ) );
-    
+
     in->type.type = type;
     in->nalloc = nalloc;
     in->n = nalloc;
-    
+
     return in;
 }
@@ -156,84 +157,84 @@
     void *outVec = NULL;
     psElemType inType = 0;
-    
+
     if ( inVector == NULL ) {
-            psError( __func__, " : Line %d - Null input vector\n", __LINE__ );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - Null input vector\n", __LINE__ );
+        return outVector;
+    }
+
     inType = inVector->type.type;
     inN = inVector->n;
     inVec = inVector->data.V;
     elSize = PSELEMTYPE_SIZEOF( inType );
-    
+
     if ( outVector == NULL ) {
-            outVector = psVectorAlloc( inN, inType );
-            outVector->n = inVector->n;
-        }
-        
+        outVector = psVectorAlloc( inN, inType );
+        outVector->n = inVector->n;
+    }
+
     outN = outVector->n;
     outVec = outVector->data.V;
-    
+
     if ( inN != outN ) {
-            psError( __func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", __LINE__,
-                     inN, outN );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", __LINE__,
+                 inN, outN );
+        return outVector;
+    }
+
     if ( inType != outVector->type.type ) {
-            psError( __func__, " : Line %d - Input and output vectors are not same type: in=%d out=%d\n", __LINE__,
-                     inType, outVector->type.type );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - Input and output vectors are not same type: in=%d out=%d\n", __LINE__,
+                 inType, outVector->type.type );
+        return outVector;
+    }
+
     if ( inN == 0 ) {
-            psError( __func__, " : Line %d - No elements in use for input vector\n", __LINE__ );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - No elements in use for input vector\n", __LINE__ );
+        return outVector;
+    }
+
     if ( outN == 0 ) {
-            psError( __func__, " : Line %d - No elements in use for output vector\n", __LINE__ );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - No elements in use for output vector\n", __LINE__ );
+        return outVector;
+    }
+
     // Copy input vector values into output vector
     memcpy( outVec, inVec, elSize * outN );
-    
+
     // Sort output vector
     switch ( inType ) {
-            case PS_TYPE_U8:
-            qsort( outVec, inN, elSize, psCompareU8 );
-            break;
-            case PS_TYPE_U16:
-            qsort( outVec, inN, elSize, psCompareU16 );
-            break;
-            case PS_TYPE_U32:
-            qsort( outVec, inN, elSize, psCompareU32 );
-            break;
-            case PS_TYPE_U64:
-            qsort( outVec, inN, elSize, psCompareU64 );
-            break;
-            case PS_TYPE_S8:
-            qsort( outVec, inN, elSize, psCompareS8 );
-            break;
-            case PS_TYPE_S16:
-            qsort( outVec, inN, elSize, psCompareS16 );
-            break;
-            case PS_TYPE_S32:
-            qsort( outVec, inN, elSize, psCompareS32 );
-            break;
-            case PS_TYPE_S64:
-            qsort( outVec, inN, elSize, psCompareS64 );
-            break;
-            case PS_TYPE_F32:
-            qsort( outVec, inN, elSize, psCompareF32 );
-            break;
-            case PS_TYPE_F64:
-            qsort( outVec, inN, elSize, psCompareF64 );
-            break;
-            default:
-            psError( __func__, " : Line %d - Invalid psType\n", __LINE__ );
-        }
-        
+    case PS_TYPE_U8:
+        qsort( outVec, inN, elSize, psCompareU8 );
+        break;
+    case PS_TYPE_U16:
+        qsort( outVec, inN, elSize, psCompareU16 );
+        break;
+    case PS_TYPE_U32:
+        qsort( outVec, inN, elSize, psCompareU32 );
+        break;
+    case PS_TYPE_U64:
+        qsort( outVec, inN, elSize, psCompareU64 );
+        break;
+    case PS_TYPE_S8:
+        qsort( outVec, inN, elSize, psCompareS8 );
+        break;
+    case PS_TYPE_S16:
+        qsort( outVec, inN, elSize, psCompareS16 );
+        break;
+    case PS_TYPE_S32:
+        qsort( outVec, inN, elSize, psCompareS32 );
+        break;
+    case PS_TYPE_S64:
+        qsort( outVec, inN, elSize, psCompareS64 );
+        break;
+    case PS_TYPE_F32:
+        qsort( outVec, inN, elSize, psCompareF32 );
+        break;
+    case PS_TYPE_F64:
+        qsort( outVec, inN, elSize, psCompareF64 );
+        break;
+    default:
+        psError( __func__, " : Line %d - Invalid psType\n", __LINE__ );
+    }
+
     return outVector;
 }
@@ -241,13 +242,13 @@
 #define SORT_INDICES(TYPE)                                                                                   \
 for(i=0; i<inN; i++) {                                                                                       \
-        for(j=0; j<inN; j++) {                                                                                   \
-                diff = fabs((double)tmpVector->data.TYPE[i] - inVec[j]);                                             \
-                if(diff < FLT_EPSILON) {                                                                             \
-                        outVec[i] = j;                                                                                   \
-                        break;                                                                                           \
-                    }                                                                                                    \
-            }                                                                                                        \
-    }
-    
+    for(j=0; j<inN; j++) {                                                                                   \
+        diff = fabs((double)tmpVector->data.TYPE[i] - inVec[j]);                                             \
+        if(diff < FLT_EPSILON) {                                                                             \
+            outVec[i] = j;                                                                                   \
+            break;                                                                                           \
+        }                                                                                                    \
+    }                                                                                                        \
+}
+
 psVector *psVectorSortIndex( psVector *restrict outVector, const psVector *restrict inVector )
 {
@@ -261,77 +262,77 @@
     psVector *tmpVector = NULL;
     psElemType inType = 0;
-    
+
     if ( inVector == NULL ) {
-            psError( __func__, " : Line %d - Null input vector\n", __LINE__ );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - Null input vector\n", __LINE__ );
+        return outVector;
+    }
+
     inN = inVector->n;
     inVec = inVector->data.V;
     inType = inVector->type.type;
-    
+
     if ( outVector == NULL ) {
-            outVector = psVectorAlloc( inN, PS_TYPE_U32 );
-            outVector->n = inN;
-        }
-        
+        outVector = psVectorAlloc( inN, PS_TYPE_U32 );
+        outVector->n = inN;
+    }
+
     outN = outVector->n;
     outVec = outVector->data.V;
-    
+
     if ( inN != outN ) {
-            psError( __func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n",
-                     __LINE__, inN, outN );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n",
+                 __LINE__, inN, outN );
+        return outVector;
+    }
+
     if ( outVector->type.type != PS_TYPE_U32 ) {
-            psError( __func__, " : Line %d - Output vector is not of type U32: out=%d\n",
-                     __LINE__, outVector->type.type );
-            return outVector;
-        }
-        
+        psError( __func__, " : Line %d - Output vector is not of type U32: out=%d\n",
+                 __LINE__, outVector->type.type );
+        return outVector;
+    }
+
     tmpVector = psVectorAlloc( inN, inType );
     tmpVector->n = inN;
     tmpVector = psVectorSort( tmpVector, inVector );
-    
+
     // Sort output vector
     switch ( inType ) {
-            case PS_TYPE_U8:
-            SORT_INDICES( U8 );
-            break;
-            case PS_TYPE_U16:
-            SORT_INDICES( U16 );
-            break;
-            case PS_TYPE_U32:
-            SORT_INDICES( U32 );
-            break;
-            case PS_TYPE_U64:
-            SORT_INDICES( U64 );
-            break;
-            case PS_TYPE_S8:
-            SORT_INDICES( S8 );
-            break;
-            case PS_TYPE_S16:
-            SORT_INDICES( S16 );
-            break;
-            case PS_TYPE_S32:
-            SORT_INDICES( S32 );
-            break;
-            case PS_TYPE_S64:
-            SORT_INDICES( S64 );
-            break;
-            case PS_TYPE_F32:
-            SORT_INDICES( F32 );
-            break;
-            case PS_TYPE_F64:
-            SORT_INDICES( F64 );
-            break;
-            default:
-            psError( __func__, " : Line %d - Invalid psType\n", __LINE__ );
-        }
-        
+    case PS_TYPE_U8:
+        SORT_INDICES( U8 );
+        break;
+    case PS_TYPE_U16:
+        SORT_INDICES( U16 );
+        break;
+    case PS_TYPE_U32:
+        SORT_INDICES( U32 );
+        break;
+    case PS_TYPE_U64:
+        SORT_INDICES( U64 );
+        break;
+    case PS_TYPE_S8:
+        SORT_INDICES( S8 );
+        break;
+    case PS_TYPE_S16:
+        SORT_INDICES( S16 );
+        break;
+    case PS_TYPE_S32:
+        SORT_INDICES( S32 );
+        break;
+    case PS_TYPE_S64:
+        SORT_INDICES( S64 );
+        break;
+    case PS_TYPE_F32:
+        SORT_INDICES( F32 );
+        break;
+    case PS_TYPE_F64:
+        SORT_INDICES( F64 );
+        break;
+    default:
+        psError( __func__, " : Line %d - Invalid psType\n", __LINE__ );
+    }
+
     // Free temp memory
     psFree( tmpVector );
-    
+
     return outVector;
 }
@@ -340,7 +341,7 @@
 {
     if ( psVec == NULL ) {
-            return ;
-        }
-        
+        return ;
+    }
+
     psFree( psVec->data.V );
 }
Index: trunk/psLib/src/collections/psVector.h
===================================================================
--- trunk/psLib/src/collections/psVector.h	(revision 1382)
+++ trunk/psLib/src/collections/psVector.h	(revision 1385)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-07-15 23:52:33 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-08-04 23:37:39 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
