Commits

Satish Balay committed 31a8bd9

extern-c: more solaris CC fixes. #156997

Comments (0)

Files changed (10)

include/petsc-private/petscimpl.h

       queryfunction()   - Requests a registered function that has been attached to a PETSc object.
 */
 
-typedef struct {
+PETSC_EXTERN_TYPEDEF typedef struct {
    PetscErrorCode (*getcomm)(PetscObject,MPI_Comm *);
    PetscErrorCode (*view)(PetscObject,PetscViewer);
    PetscErrorCode (*destroy)(PetscObject*);

src/dm/impls/plex/plexfem.c

 
 .seealso: DMPlexComputeJacobianActionFEM()
 @*/
-PetscErrorCode DMPlexComputeResidualFEM(DM dm, Vec X, Vec F, void *user)
+PETSC_EXTERN PetscErrorCode DMPlexComputeResidualFEM(DM dm, Vec X, Vec F, void *user)
 {
   DM_Plex         *mesh = (DM_Plex*) dm->data;
   PetscFEM        *fem  = (PetscFEM*) &((DM*) user)[1];
     cellDof       += quad[field].numBasisFuncs*quad[field].numComponents;
     numComponents += quad[field].numComponents;
   }
-  ierr = DMPlexProjectFunctionLocal(dm, numComponents, fem->bcFuncs, INSERT_BC_VALUES, X);CHKERRQ(ierr);
+  ierr = DMPlexProjectFunctionLocal(dm, numComponents, (PetscScalar (**)(const PetscReal []))fem->bcFuncs, INSERT_BC_VALUES, X);CHKERRQ(ierr);
   ierr = VecSet(F, 0.0);CHKERRQ(ierr);
   ierr = PetscMalloc6(numCells*cellDof,PetscScalar,&u,numCells*dim,PetscReal,&v0,numCells*dim*dim,PetscReal,&J,numCells*dim*dim,PetscReal,&invJ,numCells,PetscReal,&detJ,numCells*cellDof,PetscScalar,&elemVec);CHKERRQ(ierr);
   for (c = cStart; c < cEnd; ++c) {
 
 .seealso: FormFunctionLocal()
 @*/
-PetscErrorCode DMPlexComputeJacobianFEM(DM dm, Vec X, Mat Jac, Mat JacP, MatStructure *str,void *user)
+PETSC_EXTERN PetscErrorCode DMPlexComputeJacobianFEM(DM dm, Vec X, Mat Jac, Mat JacP, MatStructure *str,void *user)
 {
   DM_Plex         *mesh = (DM_Plex*) dm->data;
   PetscFEM        *fem  = (PetscFEM*) &((DM*) user)[1];
     cellDof       += quad[field].numBasisFuncs*quad[field].numComponents;
     numComponents += quad[field].numComponents;
   }
-  ierr = DMPlexProjectFunctionLocal(dm, numComponents, fem->bcFuncs, INSERT_BC_VALUES, X);CHKERRQ(ierr);
+  ierr = DMPlexProjectFunctionLocal(dm, numComponents, (PetscScalar (**)(const PetscReal []))fem->bcFuncs, INSERT_BC_VALUES, X);CHKERRQ(ierr);
   ierr = MatZeroEntries(JacP);CHKERRQ(ierr);
   ierr = PetscMalloc6(numCells*cellDof,PetscScalar,&u,numCells*dim,PetscReal,&v0,numCells*dim*dim,PetscReal,&J,numCells*dim*dim,PetscReal,&invJ,numCells,PetscReal,&detJ,numCells*cellDof*cellDof,PetscScalar,&elemMat);CHKERRQ(ierr);
   for (c = cStart; c < cEnd; ++c) {

src/snes/impls/fas/fas.c

 
 const char *const SNESFASTypes[] = {"MULTIPLICATIVE","ADDITIVE","SNESFASType","SNES_FAS",0};
 
+PETSC_EXTERN extern PetscErrorCode SNESSetUp_FAS(SNES snes);
 extern PetscErrorCode SNESDestroy_FAS(SNES snes);
-extern PetscErrorCode SNESSetUp_FAS(SNES snes);
 extern PetscErrorCode SNESSetFromOptions_FAS(SNES snes);
 extern PetscErrorCode SNESView_FAS(SNES snes, PetscViewer viewer);
 extern PetscErrorCode SNESSolve_FAS(SNES snes);
 
 #undef __FUNCT__
 #define __FUNCT__ "SNESSetUp_FAS"
-PetscErrorCode SNESSetUp_FAS(SNES snes)
+PETSC_EXTERN PetscErrorCode SNESSetUp_FAS(SNES snes)
 {
   SNES_FAS       *fas = (SNES_FAS*) snes->data;
   PetscErrorCode ierr;

src/snes/impls/test/snestest.c

 
 #undef __FUNCT__
 #define __FUNCT__ "SNESSolve_Test"
-PetscErrorCode SNESSolve_Test(SNES snes)
+PETSC_INTERN PetscErrorCode SNESSolve_Test(SNES snes)
 {
   Mat            A = snes->jacobian,B;
   Vec            x = snes->vec_sol,f = snes->vec_func,f1 = snes->vec_sol_update;
 .seealso:  SNESCreate(), SNES, SNESSetType(), SNESNEWTONLS, SNESNEWTONTR, SNESSolve()
 
 @*/
-PetscErrorCode SNESUpdateCheckJacobian(SNES snes,PetscInt it)
+PETSC_EXTERN PetscErrorCode SNESUpdateCheckJacobian(SNES snes,PetscInt it)
 {
   Mat            A = snes->jacobian,B;
   Vec            x = snes->vec_sol,f = snes->vec_func,f1 = snes->vec_sol_update;

src/snes/interface/snes.c

 #define __FUNCT__ "KSPComputeOperators_SNES"
 /* This may be called to rediscretize the operator on levels of linear multigrid. The DM shuffle is so the user can
  * safely call SNESGetDM() in their residual evaluation routine. */
-static PetscErrorCode KSPComputeOperators_SNES(KSP ksp,Mat A,Mat B,MatStructure *mstruct,void *ctx)
+PETSC_INTERN PetscErrorCode KSPComputeOperators_SNES(KSP ksp,Mat A,Mat B,MatStructure *mstruct,void *ctx)
 {
   SNES           snes = (SNES)ctx;
   PetscErrorCode ierr;
 
 .seealso:  SNESSetJacobian(), KSPSetOperators(), MatStructure, SNESSetLagPreconditioner(), SNESSetLagJacobian()
 @*/
-PetscErrorCode  SNESComputeJacobian(SNES snes,Vec X,Mat *A,Mat *B,MatStructure *flg)
+PETSC_EXTERN PetscErrorCode  SNESComputeJacobian(SNES snes,Vec X,Mat *A,Mat *B,MatStructure *flg)
 {
   PetscErrorCode ierr;
   PetscBool      flag;
 
 .seealso: SNESCreate(), SNESSolve(), SNESDestroy()
 @*/
-PetscErrorCode  SNESSetUp(SNES snes)
+PETSC_EXTERN PetscErrorCode  SNESSetUp(SNES snes)
 {
   PetscErrorCode ierr;
   DM             dm;

src/snes/interface/snesj2.c

 
 @*/
 
-PetscErrorCode  SNESComputeJacobianDefaultColor(SNES snes,Vec x1,Mat *J,Mat *B,MatStructure *flag,void *ctx)
+PETSC_EXTERN PetscErrorCode  SNESComputeJacobianDefaultColor(SNES snes,Vec x1,Mat *J,Mat *B,MatStructure *flag,void *ctx)
 {
   MatFDColoring  color = NULL;
   PetscErrorCode ierr;

src/snes/interface/snesut.c

 
 #undef __FUNCT__
 #define __FUNCT__ "SNESMonitorJacUpdateSpectrum"
-PetscErrorCode SNESMonitorJacUpdateSpectrum(SNES snes,PetscInt it,PetscReal fnorm,void *ctx)
+PETSC_EXTERN PetscErrorCode SNESMonitorJacUpdateSpectrum(SNES snes,PetscInt it,PetscReal fnorm,void *ctx)
 {
 #if defined(PETSC_MISSING_LAPACK_GEEV)
   SETERRQ(PetscObjectComm((PetscObject)snes),PETSC_ERR_SUP,"GEEV - Lapack routine is unavailable\nNot able to provide eigen values.");

src/snes/linesearch/impls/bt/linesearchbt.c

 
 #undef __FUNCT__
 #define __FUNCT__ "SNESLineSearchApply_BT"
-static PetscErrorCode  SNESLineSearchApply_BT(SNESLineSearch linesearch)
+PETSC_INTERN PetscErrorCode  SNESLineSearchApply_BT(SNESLineSearch linesearch)
 {
   PetscBool         changed_y,changed_w;
   PetscErrorCode    ierr;

src/snes/linesearch/impls/l2/linesearchl2.c

 
 #undef __FUNCT__
 #define __FUNCT__ "SNESLineSearchApply_L2"
-static PetscErrorCode  SNESLineSearchApply_L2(SNESLineSearch linesearch)
+PETSC_INTERN PetscErrorCode  SNESLineSearchApply_L2(SNESLineSearch linesearch)
 {
 
   PetscBool      changed_y, changed_w;

src/ts/interface/ts.c

 
 .seealso: TSSetSolutionFunction(), TSSetRHSFunction(), TSComputeIFunction()
 @*/
-PetscErrorCode TSComputeForcingFunction(TS ts,PetscReal t,Vec U)
+PETSC_EXTERN PetscErrorCode TSComputeForcingFunction(TS ts,PetscReal t,Vec U)
 {
   PetscErrorCode     ierr, (*forcing)(TS,PetscReal,Vec,void*);
   void               *ctx;
 
 .seealso: TSCreate(), TSStep(), TSDestroy()
 @*/
-PetscErrorCode  TSSetUp(TS ts)
+PETSC_EXTERN PetscErrorCode  TSSetUp(TS ts)
 {
   PetscErrorCode ierr;
   DM             dm;
 
 .keywords: timestep, set, SNES
 @*/
-PetscErrorCode TSSetSNES(TS ts,SNES snes)
+PETSC_EXTERN PetscErrorCode TSSetSNES(TS ts,SNES snes)
 {
   PetscErrorCode ierr;
   PetscErrorCode (*func)(SNES,Vec,Mat*,Mat*,MatStructure*,void*);