From c78e44cdc563853c250da78ee78ba622c39126b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Luc=20Peuri=C3=A8re?= Date: Wed, 9 Mar 2005 19:45:59 +0000 Subject: big warning hunt commit lot of casts, added prototypes, missing includes and some true errors --- intern/opennl/extern/ONL_opennl.h | 6 +++--- intern/opennl/intern/opennl.c | 34 +++++++++++++++++----------------- intern/opennl/superlu/get_perm_c.c | 6 +++--- intern/opennl/superlu/lsame.c | 3 +++ intern/opennl/superlu/memory.c | 4 ++++ intern/opennl/superlu/mmd.c | 6 ++++++ intern/opennl/superlu/sp_preorder.c | 3 +++ intern/opennl/superlu/ssp_defs.h | 3 +++ intern/opennl/superlu/superlu_timer.c | 2 ++ intern/opennl/superlu/sutil.c | 8 ++++++++ intern/opennl/superlu/util.c | 6 ++++++ intern/opennl/superlu/xerbla.c | 1 + 12 files changed, 59 insertions(+), 23 deletions(-) (limited to 'intern/opennl') diff --git a/intern/opennl/extern/ONL_opennl.h b/intern/opennl/extern/ONL_opennl.h index 5e4bd24313c..a84a153709d 100644 --- a/intern/opennl/extern/ONL_opennl.h +++ b/intern/opennl/extern/ONL_opennl.h @@ -109,10 +109,10 @@ typedef void* NLContext ; /* * Contexts */ - NLContext nlNewContext() ; + NLContext nlNewContext(void) ; void nlDeleteContext(NLContext context) ; void nlMakeCurrent(NLContext context) ; - NLContext nlGetCurrent() ; + NLContext nlGetCurrent(void) ; /* * State set/get @@ -153,7 +153,7 @@ typedef void* NLContext ; * Solve */ - NLboolean nlSolve() ; + NLboolean nlSolve(void) ; #ifdef __cplusplus } diff --git a/intern/opennl/intern/opennl.c b/intern/opennl/intern/opennl.c index be797223f51..3bc87c8dc76 100644 --- a/intern/opennl/intern/opennl.c +++ b/intern/opennl/intern/opennl.c @@ -416,7 +416,7 @@ static void __nlSparseMatrix_mult_cols( /************************************************************************************/ /* SparseMatrix x Vector routines, main driver routine */ -void __nlSparseMatrixMult(__NLSparseMatrix* A, NLfloat* x, NLfloat* y) { +static void __nlSparseMatrixMult(__NLSparseMatrix* A, NLfloat* x, NLfloat* y) { if(A->storage & __NL_ROWS) { if(A->storage & __NL_SYMMETRIC) { __nlSparseMatrix_mult_rows_symmetric(A, x, y) ; @@ -481,12 +481,12 @@ typedef struct { static __NLContext* __nlCurrentContext = NULL ; -void __nlMatrixVectorProd_default(NLfloat* x, NLfloat* y) { +static void __nlMatrixVectorProd_default(NLfloat* x, NLfloat* y) { __nlSparseMatrixMult(&(__nlCurrentContext->M), x, y) ; } -NLContext nlNewContext() { +NLContext nlNewContext(void) { __NLContext* result = __NL_NEW(__NLContext) ; result->state = __NL_STATE_INITIAL ; result->row_scaling = 1.0 ; @@ -533,15 +533,15 @@ void nlMakeCurrent(NLContext context) { __nlCurrentContext = (__NLContext*)(context) ; } -NLContext nlGetCurrent() { +NLContext nlGetCurrent(void) { return __nlCurrentContext ; } -void __nlCheckState(NLenum state) { +static void __nlCheckState(NLenum state) { __nl_assert(__nlCurrentContext->state == state) ; } -void __nlTransition(NLenum from_state, NLenum to_state) { +static void __nlTransition(NLenum from_state, NLenum to_state) { __nlCheckState(from_state) ; __nlCurrentContext->state = to_state ; } @@ -737,7 +737,7 @@ NLboolean nlVariableIsLocked(NLuint index) { /************************************************************************************/ /* System construction */ -void __nlVariablesToVector() { +static void __nlVariablesToVector() { NLuint i ; __nl_assert(__nlCurrentContext->alloc_x) ; __nl_assert(__nlCurrentContext->alloc_variable) ; @@ -750,7 +750,7 @@ void __nlVariablesToVector() { } } -void __nlVectorToVariables() { +static void __nlVectorToVariables() { NLuint i ; __nl_assert(__nlCurrentContext->alloc_x) ; __nl_assert(__nlCurrentContext->alloc_variable) ; @@ -764,7 +764,7 @@ void __nlVectorToVariables() { } -void __nlBeginSystem() { +static void __nlBeginSystem() { __nlTransition(__NL_STATE_INITIAL, __NL_STATE_SYSTEM) ; __nl_assert(__nlCurrentContext->nb_variables > 0) ; __nlCurrentContext->variable = __NL_NEW_ARRAY( @@ -773,11 +773,11 @@ void __nlBeginSystem() { __nlCurrentContext->alloc_variable = NL_TRUE ; } -void __nlEndSystem() { +static void __nlEndSystem() { __nlTransition(__NL_STATE_MATRIX_CONSTRUCTED, __NL_STATE_SYSTEM_CONSTRUCTED) ; } -void __nlBeginMatrix() { +static void __nlBeginMatrix() { NLuint i ; NLuint n = 0 ; NLenum storage = __NL_ROWS ; @@ -828,7 +828,7 @@ void __nlBeginMatrix() { __nlCurrentContext->current_row = 0 ; } -void __nlEndMatrix() { +static void __nlEndMatrix() { __nlTransition(__NL_STATE_MATRIX, __NL_STATE_MATRIX_CONSTRUCTED) ; __nlRowColumnDestroy(&__nlCurrentContext->af) ; @@ -846,14 +846,14 @@ void __nlEndMatrix() { } } -void __nlBeginRow() { +static void __nlBeginRow() { __nlTransition(__NL_STATE_MATRIX, __NL_STATE_ROW) ; __nlRowColumnZero(&__nlCurrentContext->af) ; __nlRowColumnZero(&__nlCurrentContext->al) ; __nlRowColumnZero(&__nlCurrentContext->xl) ; } -void __nlScaleRow(NLfloat s) { +static void __nlScaleRow(NLfloat s) { __NLRowColumn* af = &__nlCurrentContext->af ; __NLRowColumn* al = &__nlCurrentContext->al ; NLuint nf = af->size ; @@ -868,7 +868,7 @@ void __nlScaleRow(NLfloat s) { __nlCurrentContext->right_hand_side *= s ; } -void __nlNormalizeRow(NLfloat weight) { +static void __nlNormalizeRow(NLfloat weight) { __NLRowColumn* af = &__nlCurrentContext->af ; __NLRowColumn* al = &__nlCurrentContext->al ; NLuint nf = af->size ; @@ -885,7 +885,7 @@ void __nlNormalizeRow(NLfloat weight) { __nlScaleRow(weight / norm) ; } -void __nlEndRow() { +static void __nlEndRow() { __NLRowColumn* af = &__nlCurrentContext->af ; __NLRowColumn* al = &__nlCurrentContext->al ; __NLRowColumn* xl = &__nlCurrentContext->xl ; @@ -1137,7 +1137,7 @@ static NLboolean __nlSolve_SUPERLU( NLboolean do_perm) { /************************************************************************/ /* nlSolve() driver routine */ -NLboolean nlSolve() { +NLboolean nlSolve(void) { NLboolean result = NL_TRUE ; __nlCheckState(__NL_STATE_SYSTEM_CONSTRUCTED) ; diff --git a/intern/opennl/superlu/get_perm_c.c b/intern/opennl/superlu/get_perm_c.c index 9cdf5a876bf..e255b4a76bd 100644 --- a/intern/opennl/superlu/get_perm_c.c +++ b/intern/opennl/superlu/get_perm_c.c @@ -12,7 +12,7 @@ extern int genmmd_(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *); -void +static void get_colamd( const int m, /* number of rows in matrix A. */ const int n, /* number of columns in matrix A. */ @@ -47,7 +47,7 @@ get_colamd( SUPERLU_FREE(p); } -void +static void getata( const int m, /* number of rows in matrix A. */ const int n, /* number of columns in matrix A. */ @@ -189,7 +189,7 @@ getata( } -void +static void at_plus_a( const int n, /* number of columns in matrix A. */ const int nz, /* number of nonzeros in matrix A */ diff --git a/intern/opennl/superlu/lsame.c b/intern/opennl/superlu/lsame.c index 29f27d38fa9..79fb4d428a5 100644 --- a/intern/opennl/superlu/lsame.c +++ b/intern/opennl/superlu/lsame.c @@ -1,3 +1,6 @@ +int lsame_(char *, char *); + + int lsame_(char *ca, char *cb) { /* -- LAPACK auxiliary routine (version 2.0) -- diff --git a/intern/opennl/superlu/memory.c b/intern/opennl/superlu/memory.c index 54d863ea9e9..279b60b5239 100644 --- a/intern/opennl/superlu/memory.c +++ b/intern/opennl/superlu/memory.c @@ -10,6 +10,10 @@ #include "ssp_defs.h" +/* prototypes --------------------------------- */ +void copy_mem_int(int, void *, void *); +void user_bcopy(char *, char *, int); + #if ( DEBUGlevel>=1 ) /* Debug malloc/free. */ int superlu_malloc_total = 0; diff --git a/intern/opennl/superlu/mmd.c b/intern/opennl/superlu/mmd.c index 05f26ce0995..cc45aea7b41 100644 --- a/intern/opennl/superlu/mmd.c +++ b/intern/opennl/superlu/mmd.c @@ -1,6 +1,12 @@ typedef int shortint; + +/* prototypes -------------------- */ +int genmmd_(int *, int *, int *, int *, int *, int *, int *, + int *, int *, int *, int *, int *); + + /* *************************************************************** */ /* *************************************************************** */ /* **** GENMMD ..... MULTIPLE MINIMUM EXTERNAL DEGREE **** */ diff --git a/intern/opennl/superlu/sp_preorder.c b/intern/opennl/superlu/sp_preorder.c index f82da2de1aa..c40ebc9a4f7 100644 --- a/intern/opennl/superlu/sp_preorder.c +++ b/intern/opennl/superlu/sp_preorder.c @@ -1,5 +1,8 @@ #include "ssp_defs.h" +int check_perm(char *, int , int *); + + void sp_preorder(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *etree, SuperMatrix *AC) diff --git a/intern/opennl/superlu/ssp_defs.h b/intern/opennl/superlu/ssp_defs.h index 5b4e86b175b..61b324e74d8 100644 --- a/intern/opennl/superlu/ssp_defs.h +++ b/intern/opennl/superlu/ssp_defs.h @@ -225,7 +225,10 @@ extern void sPrint_SuperNode_Matrix(char *, SuperMatrix *); extern void sPrint_Dense_Matrix(char *, SuperMatrix *); extern void print_lu_col(char *, int, int, int *, GlobalLU_t *); extern void check_tempv(int, float *); +extern int print_int_vec(char *what, int n, int *vec); +extern int sp_symetree(int *acolst, int *acolend, int *arow, int n, int *parent); + #ifdef __cplusplus } #endif diff --git a/intern/opennl/superlu/superlu_timer.c b/intern/opennl/superlu/superlu_timer.c index 798fd59d4ea..4f68f3a7f1a 100644 --- a/intern/opennl/superlu/superlu_timer.c +++ b/intern/opennl/superlu/superlu_timer.c @@ -11,6 +11,8 @@ /* We want this flag, safer than putting in build system */ #define NO_TIMER +double SuperLU_timer_ (); + #ifdef SUN /* * It uses the system call gethrtime(3C), which is accurate to diff --git a/intern/opennl/superlu/sutil.c b/intern/opennl/superlu/sutil.c index 4689f34968a..78f0b8bc5cc 100644 --- a/intern/opennl/superlu/sutil.c +++ b/intern/opennl/superlu/sutil.c @@ -22,6 +22,14 @@ #include #include "ssp_defs.h" +/* prototypes */ +void sprint_lu_col(char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu); +void scheck_tempv(int n, float *tempv); +void sPrintPerf(SuperMatrix *, SuperMatrix *, mem_usage_t *,float , float , + float *, float *, char *, SuperLUStat_t *); +int print_float_vec(char *what, int n, float *vec); +/* ********** */ + void sCreate_CompCol_Matrix(SuperMatrix *A, int m, int n, int nnz, float *nzval, int *rowind, int *colptr, diff --git a/intern/opennl/superlu/util.c b/intern/opennl/superlu/util.c index 3c49d714d1c..824cabacee5 100644 --- a/intern/opennl/superlu/util.c +++ b/intern/opennl/superlu/util.c @@ -22,6 +22,12 @@ #include "ssp_defs.h" #include "util.h" +/* prototypes */ +flops_t LUFactFlops(SuperLUStat_t *stat); +flops_t LUSolveFlops(SuperLUStat_t *stat); +float SpaSize(int n, int np, float sum_npw); +float DenseSize(int n, float sum_nw); + /* * Global statistics variale */ diff --git a/intern/opennl/superlu/xerbla.c b/intern/opennl/superlu/xerbla.c index cb94fa71d95..68cef9d84e4 100644 --- a/intern/opennl/superlu/xerbla.c +++ b/intern/opennl/superlu/xerbla.c @@ -1,5 +1,6 @@ #include +int xerbla_(char *, int *); /* Subroutine */ int xerbla_(char *srname, int *info) { -- cgit v1.2.3