Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > DynArray
changeset 1:2698781db812
Not sure changes -- not being used in VMSHW_matrix_mult
| author | Me |
|---|---|
| date | Wed, 28 Jul 2010 13:14:00 -0700 |
| parents | b1f178ed41a3 |
| children | ad8621ee5986 |
| files | Vector.c Vector.h |
| diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line diff
1.1 --- a/Vector.c Sat May 22 19:51:49 2010 -0700 1.2 +++ b/Vector.c Wed Jul 28 13:14:00 2010 -0700 1.3 @@ -9,6 +9,7 @@ 1.4 #include <stdio.h> 1.5 #include <malloc.h> 1.6 1.7 +#include "Vector.h" 1.8 1.9 1.10 /*make a struct with the sizes and a pointer to the 1.11 @@ -22,7 +23,7 @@ 1.12 * the array ptr from the vector struct at the sequence start.. 1.13 */ 1.14 bool8 1.15 -addToVect( Vector *vect, void *ptrToElem ) 1.16 +addToVect( void *ptrToElem, Vector *vect ) 1.17 { int32 numPtrsInVect, sizeOfVect; 1.18 1.19 /* 1.20 @@ -38,7 +39,7 @@ 1.21 vect->numPtrsInArray++; 1.22 } 1.23 1.24 -void ** 1.25 +void 1.26 increaseSizeOfVect( Vector *vect ) 1.27 { int32 oldSizeOfArray, newSizeOfArray, i; 1.28 void **newArray, **oldArray; 1.29 @@ -57,7 +58,6 @@ 1.30 vect->sizeOfArray = newSizeOfArray; 1.31 1.32 free( oldArray -1 ); 1.33 - return newArray; 1.34 } 1.35 1.36 /*
2.1 --- a/Vector.h Sat May 22 19:51:49 2010 -0700 2.2 +++ b/Vector.h Wed Jul 28 13:14:00 2010 -0700 2.3 @@ -8,6 +8,8 @@ 2.4 #ifndef _VECTOR_H 2.5 #define _VECTOR_H 2.6 2.7 +#include "../VMS_primitive_data_types.h" 2.8 + 2.9 //Doing one special cheat -- hiding a back-ptr in front of array 2.10 typedef struct 2.11 { 2.12 @@ -18,7 +20,7 @@ 2.13 Vector; 2.14 2.15 Vector *createVect ( int32 initialSizeOfArray ); 2.16 -Vector *increaseSizeOfVect( Vector *vect ); 2.17 +void increaseSizeOfVect( Vector *vect ); 2.18 bool8 addToVect ( void *ptrToAdd, Vector *vect ); 2.19 bool8 removeLastInVect ( Vector *vect ); 2.20
