From 1ee29c3e9632510d5c24974f5a65eaf22793fca9 Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 23 Jul 2010 17:23:13 +0000 Subject: [PATCH] use a void* instead of a char* for anonymous `InitInfo' in src/sparse/*.c --- ChangeLog | 6 ++++++ src/include/spmatrix.h | 4 ++-- src/maths/sparse/spbuild.c | 8 ++++---- src/maths/sparse/spdefs.h | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44d608983..f67652b92 100644 --- a/ChangeLog +++ b/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 * src/maths/sparse/sputils.c : convert K&R function definitions to ansi style diff --git a/src/include/spmatrix.h b/src/include/spmatrix.h index 6dfe3881c..3dbbb2a81 100644 --- a/src/include/spmatrix.h +++ b/src/include/spmatrix.h @@ -266,11 +266,11 @@ extern int spFillinCount( void * ); extern int spGetAdmittance( void *, int, int, struct spTemplate* ); extern spREAL *spFindElement( void *eMatrix, int Row, int Col ); 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 spGetQuad( void *, int, int, int, int, struct spTemplate* ); 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 spREAL spLargestElement( void * ); extern void spMNA_Preorder( void * ); diff --git a/src/maths/sparse/spbuild.c b/src/maths/sparse/spbuild.c index 241bf39ad..f7cbb4581 100644 --- a/src/maths/sparse/spbuild.c +++ b/src/maths/sparse/spbuild.c @@ -1126,7 +1126,7 @@ ExpandTranslationArrays(MatrixPtr Matrix, int NewSize) */ void -spInstallInitInfo(RealNumber *pElement, char *pInitInfo) +spInstallInitInfo(RealNumber *pElement, void *pInitInfo) { /* Begin `spInstallInitInfo'. */ assert(pElement != NULL); @@ -1135,18 +1135,18 @@ spInstallInitInfo(RealNumber *pElement, char *pInitInfo) } -char * +void * spGetInitInfo(RealNumber *pElement) { /* Begin `spGetInitInfo'. */ assert(pElement != NULL); - return (char *)((ElementPtr)pElement)->pInitInfo; + return ((ElementPtr)pElement)->pInitInfo; } 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; ElementPtr pElement; diff --git a/src/maths/sparse/spdefs.h b/src/maths/sparse/spdefs.h index 85058b41b..b9d9e919c 100644 --- a/src/maths/sparse/spdefs.h +++ b/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 * this element. If this element is the last nonzero in the column then * NextInCol contains NULL. - * pInitInfo (char *) + * pInitInfo (void *) * Pointer to user data used for initialization of the matrix element. * Initialized to NULL. * @@ -447,7 +447,7 @@ struct MatrixElement struct MatrixElement *NextInRow; struct MatrixElement *NextInCol; #if INITIALIZE - char *pInitInfo; + void *pInitInfo; #endif };