Browse Source

use a void* instead of a char* for anonymous `InitInfo' in src/sparse/*.c

pre-master-46
rlar 16 years ago
parent
commit
1ee29c3e96
  1. 6
      ChangeLog
  2. 4
      src/include/spmatrix.h
  3. 8
      src/maths/sparse/spbuild.c
  4. 4
      src/maths/sparse/spdefs.h

6
ChangeLog

@ -1,3 +1,9 @@
2010-07-23 Robert Larice
* src/include/spmatrix.h ,
* src/maths/sparse/spbuild.c ,
* src/maths/sparse/spdefs.h :
use a void* instead of a char* for anonymous `InitInfo' in src/sparse/*.c
2010-07-23 Robert Larice 2010-07-23 Robert Larice
* src/maths/sparse/sputils.c : * src/maths/sparse/sputils.c :
convert K&R function definitions to ansi style convert K&R function definitions to ansi style

4
src/include/spmatrix.h

@ -266,11 +266,11 @@ extern int spFillinCount( void * );
extern int spGetAdmittance( void *, int, int, struct spTemplate* ); extern int spGetAdmittance( void *, int, int, struct spTemplate* );
extern spREAL *spFindElement( void *eMatrix, int Row, int Col ); extern spREAL *spFindElement( void *eMatrix, int Row, int Col );
extern spREAL *spGetElement( void *, int, int ); extern spREAL *spGetElement( void *, int, int );
extern char *spGetInitInfo( spREAL* );
extern void *spGetInitInfo( spREAL* );
extern int spGetOnes( void *, int, int, int, struct spTemplate* ); extern int spGetOnes( void *, int, int, int, struct spTemplate* );
extern int spGetQuad( void *, int, int, int, int, struct spTemplate* ); extern int spGetQuad( void *, int, int, int, int, struct spTemplate* );
extern int spGetSize( void *, int ); extern int spGetSize( void *, int );
extern int spInitialize( void *, int (*pInit)(spREAL*, char *InitInfo, int, int Col));
extern int spInitialize( void *, int (*pInit)(spREAL*, void *InitInfo, int, int Col));
extern void spInstallInitInfo( spREAL*, void * ); extern void spInstallInitInfo( spREAL*, void * );
extern spREAL spLargestElement( void * ); extern spREAL spLargestElement( void * );
extern void spMNA_Preorder( void * ); extern void spMNA_Preorder( void * );

8
src/maths/sparse/spbuild.c

@ -1126,7 +1126,7 @@ ExpandTranslationArrays(MatrixPtr Matrix, int NewSize)
*/ */
void void
spInstallInitInfo(RealNumber *pElement, char *pInitInfo)
spInstallInitInfo(RealNumber *pElement, void *pInitInfo)
{ {
/* Begin `spInstallInitInfo'. */ /* Begin `spInstallInitInfo'. */
assert(pElement != NULL); assert(pElement != NULL);
@ -1135,18 +1135,18 @@ spInstallInitInfo(RealNumber *pElement, char *pInitInfo)
} }
char *
void *
spGetInitInfo(RealNumber *pElement) spGetInitInfo(RealNumber *pElement)
{ {
/* Begin `spGetInitInfo'. */ /* Begin `spGetInitInfo'. */
assert(pElement != NULL); assert(pElement != NULL);
return (char *)((ElementPtr)pElement)->pInitInfo;
return ((ElementPtr)pElement)->pInitInfo;
} }
int int
spInitialize(void *eMatrix, int (*pInit)(RealNumber*, char *InitInfo, int , int Col))
spInitialize(void *eMatrix, int (*pInit)(RealNumber*, void *InitInfo, int , int Col))
{ {
MatrixPtr Matrix = (MatrixPtr)eMatrix; MatrixPtr Matrix = (MatrixPtr)eMatrix;
ElementPtr pElement; ElementPtr pElement;

4
src/maths/sparse/spdefs.h

@ -424,7 +424,7 @@ extern void * trealloc(void *, size_t);
* NextInCol contains a pointer to the next element in the column below * NextInCol contains a pointer to the next element in the column below
* this element. If this element is the last nonzero in the column then * this element. If this element is the last nonzero in the column then
* NextInCol contains NULL. * NextInCol contains NULL.
* pInitInfo (char *)
* pInitInfo (void *)
* Pointer to user data used for initialization of the matrix element. * Pointer to user data used for initialization of the matrix element.
* Initialized to NULL. * Initialized to NULL.
* *
@ -447,7 +447,7 @@ struct MatrixElement
struct MatrixElement *NextInRow; struct MatrixElement *NextInRow;
struct MatrixElement *NextInCol; struct MatrixElement *NextInCol;
#if INITIALIZE #if INITIALIZE
char *pInitInfo;
void *pInitInfo;
#endif #endif
}; };

Loading…
Cancel
Save