1
1

Change the public variables back to instances -- not pointers

This commit was SVN r1058.
Этот коммит содержится в:
Jeff Squyres 2004-04-20 22:17:20 +00:00
родитель f1fa051d5c
Коммит 22cd1bc116
2 изменённых файлов: 20 добавлений и 26 удалений

Просмотреть файл

@ -25,18 +25,17 @@ static void lam_errhandler_construct(lam_errhandler_t *eh);
static void lam_errhandler_destruct(lam_errhandler_t *eh); static void lam_errhandler_destruct(lam_errhandler_t *eh);
static lam_class_t lam_errhandler_t_class = { /*
"lam_errhandler_t", * Class instance
OBJ_CLASS(lam_object_t), */
(lam_construct_t) lam_errhandler_construct, OBJ_CLASS_INSTANCE(lam_errhandler_t, lam_object_t, lam_errhandler_construct,
(lam_destruct_t) lam_errhandler_destruct lam_errhandler_destruct);
};
/* /*
* MPI_ERRHANDLER_NULL * MPI_ERRHANDLER_NULL
*/ */
static lam_errhandler_t errhandler_null = { lam_errhandler_t lam_mpi_errhandler_null = {
{ NULL, 0 }, { NULL, 0 },
"MPI_ERRHANDLER_NULL", "MPI_ERRHANDLER_NULL",
@ -45,13 +44,12 @@ static lam_errhandler_t errhandler_null = {
LAM_ERRHANDLER_TYPE_COMM, LAM_ERRHANDLER_TYPE_COMM,
{ NULL } { NULL }
}; };
lam_errhandler_t *lam_mpi_errhandler_null = &errhandler_null;
/* /*
* MPI_ERRORS_ARE_FATAL * MPI_ERRORS_ARE_FATAL
*/ */
static lam_errhandler_t errors_are_fatal = { lam_errhandler_t lam_mpi_errors_are_fatal = {
{ NULL, 0 }, { NULL, 0 },
"MPI_ERRORS_ARE_FATAL", "MPI_ERRORS_ARE_FATAL",
@ -61,13 +59,12 @@ static lam_errhandler_t errors_are_fatal = {
{ lam_mpi_errors_are_fatal_handler }, { lam_mpi_errors_are_fatal_handler },
-1 -1
}; };
lam_errhandler_t *lam_mpi_errors_are_fatal = &errors_are_fatal;
/* /*
* MPI_ERRORS_RETURN * MPI_ERRORS_RETURN
*/ */
static lam_errhandler_t errors_return = { lam_errhandler_t errors_return = {
{ NULL, 0 }, { NULL, 0 },
"MPI_ERRORS_ARE_RETURN", "MPI_ERRORS_ARE_RETURN",
@ -77,7 +74,6 @@ static lam_errhandler_t errors_return = {
{ lam_mpi_errors_return_handler }, { lam_mpi_errors_return_handler },
-1 -1
}; };
lam_errhandler_t *lam_mpi_errors_return = &errors_return;
/* /*
@ -97,7 +93,7 @@ int lam_errhandler_init(void)
/* Add MPI_ERRHANDLER_NULL to table */ /* Add MPI_ERRHANDLER_NULL to table */
ret_val = lam_pointer_array_add(lam_errhandler_f_to_c_table, ret_val = lam_pointer_array_add(lam_errhandler_f_to_c_table,
&errhandler_null); &lam_mpi_errhandler_null);
if (-1 == ret_val){ if (-1 == ret_val){
return LAM_ERROR; return LAM_ERROR;
} }
@ -107,12 +103,12 @@ int lam_errhandler_init(void)
if (LAM_ERRHANDLER_NULL_FORTRAN != ret_val) { if (LAM_ERRHANDLER_NULL_FORTRAN != ret_val) {
return LAM_ERROR; return LAM_ERROR;
}; };
errhandler_null.eh_f_to_c_index = ret_val; lam_mpi_errhandler_null.eh_f_to_c_index = ret_val;
/* Add MPI_ERRORS_ARE_FATAL to table */ /* Add MPI_ERRORS_ARE_FATAL to table */
ret_val = lam_pointer_array_add(lam_errhandler_f_to_c_table, ret_val = lam_pointer_array_add(lam_errhandler_f_to_c_table,
&errors_are_fatal); &lam_mpi_errors_are_fatal);
if (-1 == ret_val){ if (-1 == ret_val){
return LAM_ERROR; return LAM_ERROR;
} }
@ -123,12 +119,12 @@ int lam_errhandler_init(void)
if (LAM_ERRORS_ARE_FATAL_FORTRAN != ret_val) { if (LAM_ERRORS_ARE_FATAL_FORTRAN != ret_val) {
return LAM_ERROR; return LAM_ERROR;
}; };
errors_are_fatal.eh_f_to_c_index = ret_val; lam_mpi_errors_are_fatal.eh_f_to_c_index = ret_val;
/* Add MPI_ERRORS_RETURN to table */ /* Add MPI_ERRORS_RETURN to table */
ret_val = lam_pointer_array_add(lam_errhandler_f_to_c_table, ret_val = lam_pointer_array_add(lam_errhandler_f_to_c_table,
&errors_return); &lam_mpi_errors_return);
if (-1 == ret_val){ if (-1 == ret_val){
return LAM_ERROR; return LAM_ERROR;
} }
@ -138,7 +134,7 @@ int lam_errhandler_init(void)
if (LAM_ERRORS_RETURN_FORTRAN != ret_val) { if (LAM_ERRORS_RETURN_FORTRAN != ret_val) {
return LAM_ERROR; return LAM_ERROR;
}; };
errors_return.eh_f_to_c_index = ret_val; lam_mpi_errors_return.eh_f_to_c_index = ret_val;
/* All done */ /* All done */

Просмотреть файл

@ -12,13 +12,11 @@
#include "lfc/lam_object.h" #include "lfc/lam_object.h"
#include "lfc/lam_pointer_array.h" #include "lfc/lam_pointer_array.h"
/* This must correspond to the fortran MPI_ERRHANDLER_NULL index */ /*
* These must correspond to the fortran handle indices
*/
#define LAM_ERRHANDLER_NULL_FORTRAN 0 #define LAM_ERRHANDLER_NULL_FORTRAN 0
/* This must correspond to the fortran MPI_ERRORS_ARE_FATAL index */
#define LAM_ERRORS_ARE_FATAL_FORTRAN 1 #define LAM_ERRORS_ARE_FATAL_FORTRAN 1
/* This must correspond to the fortran MPI_ERRORS_RETURN index */
#define LAM_ERRORS_RETURN_FORTRAN 2 #define LAM_ERRORS_RETURN_FORTRAN 2
@ -76,17 +74,17 @@ typedef struct lam_errhandler_t lam_errhandler_t;
/** /**
* Global variable for MPI_ERRHANDLER_NULL * Global variable for MPI_ERRHANDLER_NULL
*/ */
extern lam_errhandler_t *lam_mpi_errhandler_null; extern lam_errhandler_t lam_mpi_errhandler_null;
/** /**
* Global variable for MPI_ERRORS_ARE_FATAL * Global variable for MPI_ERRORS_ARE_FATAL
*/ */
extern lam_errhandler_t *lam_mpi_errors_are_fatal; extern lam_errhandler_t lam_mpi_errors_are_fatal;
/** /**
* Global variable for MPI_ERRORS_RETURN * Global variable for MPI_ERRORS_RETURN
*/ */
extern lam_errhandler_t *lam_mpi_errors_return; extern lam_errhandler_t lam_mpi_errors_return;
/** /**
* Table for Fortran <-> C errhandler handle conversion * Table for Fortran <-> C errhandler handle conversion