Skip to content

Commit

Permalink
remove a bunch of compiler warnings (#41)
Browse files Browse the repository at this point in the history
* "modernization" and removing compiler warnings

* more warning cleanup

---------

Co-authored-by: Greg Landrum <[email protected]>
  • Loading branch information
greglandrum and Greg Landrum authored Apr 8, 2024
1 parent 719975c commit 7a49197
Show file tree
Hide file tree
Showing 33 changed files with 210 additions and 613 deletions.
41 changes: 9 additions & 32 deletions tightbind/COOP_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Action: This evaluates and returns the actual COOP.
*
****************************************************************************/
real eval_COOP(COOP,details,cell,num_orbs,prop_info,R_overlaps,orbital_ordering,
orbital_lookup_table)
COOP_type *COOP;
detail_type *details;
cell_type *cell;
int num_orbs;
avg_prop_info_type *prop_info;
hermetian_matrix_type R_overlaps;
K_orb_ptr_type *orbital_ordering;
int *orbital_lookup_table;
real eval_COOP(COOP_type *COOP,detail_type *details,cell_type *cell,int num_orbs,avg_prop_info_type *prop_info,hermetian_matrix_type R_overlaps,
K_orb_ptr_type *orbital_ordering,
int *orbital_lookup_table)
{
static point_type *cell_dim=0;
static real *overlap_store=0;
Expand Down Expand Up @@ -673,15 +666,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* present in the expression for P_uv.
*
****************************************************************************/
void gen_COOP(details,cell,num_orbs,avg_prop_info,R_overlaps,orbital_ordering,
orbital_lookup_table)
detail_type *details;
cell_type *cell;
int num_orbs;
avg_prop_info_type *avg_prop_info;
hermetian_matrix_type R_overlaps;
K_orb_ptr_type *orbital_ordering;
int *orbital_lookup_table;
void gen_COOP(detail_type *details,cell_type *cell,int num_orbs,avg_prop_info_type *avg_prop_info,hermetian_matrix_type R_overlaps,
K_orb_ptr_type *orbital_ordering,
int *orbital_lookup_table)
{
int i,j;
int tot_num_orbs,num_COOPS;
Expand Down Expand Up @@ -849,15 +836,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Everything here is done the same way as in gen_COOP
*
****************************************************************************/
void gen_avg_COOPs(details,cell,num_orbs,avg_prop_info,R_overlaps,orbital_ordering,
orbital_lookup_table)
detail_type *details;
cell_type *cell;
int num_orbs;
avg_prop_info_type *avg_prop_info;
hermetian_matrix_type R_overlaps;
K_orb_ptr_type *orbital_ordering;
int *orbital_lookup_table;
void gen_avg_COOPs(detail_type *details,cell_type *cell,int num_orbs,avg_prop_info_type *avg_prop_info,hermetian_matrix_type R_overlaps,K_orb_ptr_type *orbital_ordering,
int *orbital_lookup_table)
{
int i,j;
int tot_num_orbs,num_COOPS;
Expand Down Expand Up @@ -979,9 +959,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
***********************************************/

void intercell_COOP_check(COOP)

COOP_type *COOP;
void intercell_COOP_check(COOP_type *COOP)
{
int temp;

Expand All @@ -1008,4 +986,3 @@ COOP_type *COOP;
COOP->cell.z *= -1.0;
}
}

35 changes: 8 additions & 27 deletions tightbind/DOS_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
****************************************************************************/
void gen_total_DOS(details,cell,num_orbs,avg_prop_info,orbital_ordering)
detail_type *details;
cell_type *cell;
int num_orbs;
avg_prop_info_type *avg_prop_info;
K_orb_ptr_type *orbital_ordering;
void gen_total_DOS(detail_type *details,cell_type *cell,int num_orbs,avg_prop_info_type *avg_prop_info,K_orb_ptr_type *orbital_ordering)
{
int i,j;
int tot_num_orbs;
Expand Down Expand Up @@ -217,10 +212,7 @@ void gen_total_DOS(details,cell,num_orbs,avg_prop_info,orbital_ordering)
* This is just the charge matrix element for 'which_AO.
*
****************************************************************************/
real orb_contribution(num_orbs,kpoint,MO,avg_prop_info,which_AO)
int num_orbs,kpoint,MO;
avg_prop_info_type *avg_prop_info;
int which_AO;
real orb_contribution(int num_orbs,int kpoint,int MO,avg_prop_info_type *avg_prop_info,int which_AO)
{
real contrib;

Expand All @@ -247,10 +239,7 @@ real orb_contribution(num_orbs,kpoint,MO,avg_prop_info,which_AO)
* This is just the charge matrix element for 'which_FMO.
*
****************************************************************************/
real FMO_contribution(num_orbs,kpoint,MO,avg_prop_info,which_FMO)
int num_orbs,kpoint,MO;
avg_prop_info_type *avg_prop_info;
int which_FMO;
real FMO_contribution(int num_orbs,int kpoint,int MO,avg_prop_info_type *avg_prop_info,int which_FMO)
{
real contrib;

Expand Down Expand Up @@ -279,11 +268,8 @@ real FMO_contribution(num_orbs,kpoint,MO,avg_prop_info,which_FMO)
* 'which_atom to this MO.
*
****************************************************************************/
real atom_contribution(num_orbs,num_atoms,kpoint,MO,avg_prop_info,which_atom,
orbital_lookup_table)
int num_orbs,num_atoms,kpoint,MO;
avg_prop_info_type *avg_prop_info;
int which_atom,*orbital_lookup_table;
real atom_contribution(int num_orbs,int num_atoms,int kpoint,int MO,avg_prop_info_type *avg_prop_info,int which_atom,
int *orbital_lookup_table)
{
int i,atom_begin,atom_end;
float *chg_mat_ptr;
Expand Down Expand Up @@ -324,14 +310,9 @@ real atom_contribution(num_orbs,num_atoms,kpoint,MO,avg_prop_info,which_atom,
* Action: Generates all of the projected DOS curves.
*
****************************************************************************/
void gen_projected_DOS(details,cell,num_orbs,avg_prop_info,orbital_ordering,
orbital_lookup_table)
detail_type *details;
cell_type *cell;
int num_orbs;
avg_prop_info_type *avg_prop_info;
K_orb_ptr_type *orbital_ordering;
int *orbital_lookup_table;
void gen_projected_DOS(detail_type *details,cell_type *cell,int num_orbs,avg_prop_info_type *avg_prop_info,
K_orb_ptr_type *orbital_ordering,
int *orbital_lookup_table)
{
int i,j,k,l;
int tot_num_orbs,num_states,begin,end;
Expand Down
55 changes: 10 additions & 45 deletions tightbind/FMO_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Action: writes the header to the FMO output file.
*
****************************************************************************/
void init_FMO_file(details,num_orbs,num_electrons)
detail_type *details;
int num_orbs;
real num_electrons;
void init_FMO_file(detail_type *details,int num_orbs,real num_electrons)
{
int i;

Expand Down Expand Up @@ -93,12 +90,7 @@ void init_FMO_file(details,num_orbs,num_electrons)
* 'details.
*
****************************************************************************/
void build_FMO_overlap(details,num_orbs,num_atoms,overlap,orbital_lookup_table)
detail_type *details;
int num_orbs;
int num_atoms;
hermetian_matrix_type overlap;
int *orbital_lookup_table;
void build_FMO_overlap(detail_type *details,int num_orbs,int num_atoms,hermetian_matrix_type overlap,int *orbital_lookup_table)
{
FMO_frag_type *FMO_frag;
int i,j;
Expand Down Expand Up @@ -179,12 +171,7 @@ void build_FMO_overlap(details,num_orbs,num_atoms,overlap,orbital_lookup_table)
* 'details.
*
****************************************************************************/
void build_FMO_hamil(details,num_orbs,num_atoms,hamil,orbital_lookup_table)
detail_type *details;
int num_orbs;
int num_atoms;
hermetian_matrix_type hamil;
int *orbital_lookup_table;
void build_FMO_hamil(detail_type *details,int num_orbs,int num_atoms,hermetian_matrix_type hamil,int *orbital_lookup_table)
{
FMO_frag_type *FMO_frag;
int i,j;
Expand Down Expand Up @@ -282,10 +269,7 @@ void build_FMO_hamil(details,num_orbs,num_atoms,hamil,orbital_lookup_table)
* returns (they will not).
*
****************************************************************************/
void diagonalize_FMO(details,work1,work2,work3,cmplx_hamil,cmplx_overlap,cmplx_work)
detail_type *details;
real *work1,*work2,*work3;
complex *cmplx_hamil,*cmplx_overlap,*cmplx_work;
void diagonalize_FMO(detail_type *details,real *work1,real *work2,real *work3,complex *cmplx_hamil,complex *cmplx_overlap,complex *cmplx_work)
{
FMO_frag_type *FMO_frag;
int i,j,k,itab,jtab,ktab;
Expand Down Expand Up @@ -526,8 +510,7 @@ INCREASE to the right)\n");
* orbitals from the AO to the FMO basis.
*
****************************************************************************/
void gen_FMO_tform_matrices(details)
detail_type *details;
void gen_FMO_tform_matrices(detail_type *details)
{
FMO_frag_type *FMO_frag;
real *matR, *matI;
Expand Down Expand Up @@ -636,12 +619,7 @@ fprintf(output_file,"\n\n\n");
* below.
*
****************************************************************************/
void tform_wavefuncs_to_FMO_basis(details,num_orbs,num_atoms,eigenset,orbital_lookup_table)
detail_type *details;
int num_orbs;
int num_atoms;
eigenset_type eigenset;
int *orbital_lookup_table;
void tform_wavefuncs_to_FMO_basis(detail_type *details,int num_orbs,int num_atoms,eigenset_type eigenset,int *orbital_lookup_table)
{
FMO_frag_type *FMO_frag;

Expand Down Expand Up @@ -773,14 +751,8 @@ fprintf(output_file,"\n\n\n");
* The results are placed in 'cmplx_mat.
*
****************************************************************************/
void tform_matrix_to_FMO_basis(details,num_orbs,num_atoms,AO_matR,AO_matI,
temp_matR,temp_matI,cmplx_mat,orbital_lookup_table)
detail_type *details;
int num_orbs;
int num_atoms;
real *AO_matR,*AO_matI,*temp_matR,*temp_matI;
complex_matrix_type cmplx_mat;
int *orbital_lookup_table;
void tform_matrix_to_FMO_basis(detail_type *details,int num_orbs,int num_atoms,real *AO_matR,real *AO_matI,
real *temp_matR,real *temp_matI,complex_matrix_type cmplx_mat,int *orbital_lookup_table)
{
FMO_frag_type *FMO_frag;

Expand Down Expand Up @@ -968,15 +940,8 @@ fprintf(output_file,"\n\n\n");
* The results of the multiplication are put into the matrix 'results
*
****************************************************************************/
void tform_hermetian_matrix_to_FMO_basis(details,num_orbs,num_atoms,herm_mat,
temp_matR,temp_matI,results,orbital_lookup_table)
detail_type *details;
int num_orbs;
int num_atoms;
hermetian_matrix_type herm_mat;
real *temp_matR,*temp_matI;
hermetian_matrix_type results;
int *orbital_lookup_table;
void tform_hermetian_matrix_to_FMO_basis(detail_type *details,int num_orbs,int num_atoms,hermetian_matrix_type herm_mat,
real *temp_matR,real *temp_matI,hermetian_matrix_type results,int *orbital_lookup_table)
{
FMO_frag_type *FMO_frag;

Expand Down
14 changes: 4 additions & 10 deletions tightbind/K_hamil.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
****************************************************************************/
void build_k_hamil_FAT(cell,hamilR,hamilK,overlapK,num_orbs)
cell_type *cell;
hermetian_matrix_type hamilR,hamilK;
hermetian_matrix_type overlapK;
int num_orbs;
void build_k_hamil_FAT(cell_type *cell,hermetian_matrix_type hamilR,hermetian_matrix_type hamilK,
hermetian_matrix_type overlapK,int num_orbs)
{
int i,j;
int itab,jtab;
Expand Down Expand Up @@ -114,11 +111,8 @@ printmat(hamilK.mat,num_orbs,num_orbs,output_file,1e-6,details->line_width);
* insignificant in terms of the diagonalization and building S(K).
*
****************************************************************************/
void build_k_hamil_THIN(cell,hamilR,hamilK,overlapK,num_orbs)
cell_type *cell;
hermetian_matrix_type hamilR,hamilK;
hermetian_matrix_type overlapK;
int num_orbs;
void build_k_hamil_THIN(cell_type *cell,hermetian_matrix_type hamilR,hermetian_matrix_type hamilK,
hermetian_matrix_type overlapK,int num_orbs)
{
int i,j;
int itab,jtab;
Expand Down
24 changes: 6 additions & 18 deletions tightbind/K_overlap_mat.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* k-point.
*
****************************************************************************/
void build_k_overlap_FAT(cell,kpoint,overlapR,overlapK,num_orbs)
cell_type *cell;
k_point_type *kpoint;
hermetian_matrix_type overlapR,overlapK;
int num_orbs;
void build_k_overlap_FAT(cell_type *cell,k_point_type *kpoint,hermetian_matrix_type overlapR,hermetian_matrix_type overlapK,int num_orbs)
{
int i,j,k,l,m;
int itab,jtab,ktab;
Expand Down Expand Up @@ -207,12 +203,8 @@ printmat(overlapK.mat,num_orbs,num_orbs,output_file,1e-6,details->line_width);
* Action: This generates the overlap matrix for a given k-point
*
****************************************************************************/
void build_k_overlap_THIN(cell,details,kpoint,overlapR,overlapK,num_orbs)
cell_type *cell;
detail_type *details;
k_point_type *kpoint;
hermetian_matrix_type overlapR,overlapK;
int num_orbs;
void build_k_overlap_THIN(cell_type *cell,detail_type *details,k_point_type *kpoint,
hermetian_matrix_type overlapR,hermetian_matrix_type overlapK,int num_orbs)
{
int i,j,k,l,m;
int itab,jtab,ktab;
Expand Down Expand Up @@ -410,13 +402,9 @@ printmat(overlapK.mat,num_orbs,num_orbs,output_file,1e-6,details->line_width);
* memory
*
****************************************************************************/
void build_all_K_overlaps(cell,details,overlapR,overlapK,num_orbs,
tot_overlaps,orbital_lookup_table)
cell_type *cell;
detail_type *details;
hermetian_matrix_type overlapR,overlapK;
int num_orbs,tot_overlaps;
int *orbital_lookup_table;
void build_all_K_overlaps(cell_type *cell,detail_type *details,
hermetian_matrix_type overlapR,hermetian_matrix_type overlapK,int num_orbs,
int tot_overlaps,int *orbital_lookup_table)
{
k_point_type *kpoint;
int which_k;
Expand Down
7 changes: 1 addition & 6 deletions tightbind/R_hamil.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* K space hamiltonian (the important one) is built.
*
****************************************************************************/
void R_space_Hamiltonian(cell,details,overlap,hamil,num_orbs,orbital_lookup_table)
cell_type *cell;
detail_type *details;
hermetian_matrix_type overlap,hamil;
int num_orbs;
int *orbital_lookup_table;
void R_space_Hamiltonian(cell_type *cell,detail_type *details,hermetian_matrix_type overlap,hermetian_matrix_type hamil,int num_orbs,int *orbital_lookup_table)
{
int i,j;
int orb_tab1;
Expand Down
11 changes: 3 additions & 8 deletions tightbind/R_overlap_mat.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,14 +893,9 @@ printmat(overlap,num_orbs,num_orbs,status_file,1e-6,0,details->line_width);
*
*
*****************************************************************************/
void R_space_overlap_matrix(cell,details,overlap,num_orbs,tot_overlaps,
orbital_lookup_table,which_one)
cell_type *cell;
detail_type *details;
hermetian_matrix_type overlap;
int num_orbs,tot_overlaps;
int *orbital_lookup_table;
int which_one;
void R_space_overlap_matrix(cell_type *cell,detail_type *details,hermetian_matrix_type overlap,
int num_orbs,int tot_overlaps,
int *orbital_lookup_table,int which_one)
{
char err_string[240];
int overlaps_so_far;
Expand Down
5 changes: 2 additions & 3 deletions tightbind/Zmat.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


/* helper function to find a particular numbered atom in an array of atoms */
int find_atom(atoms,num_atoms,which)
atom_type *atoms;
int num_atoms,which;
int find_atom(atom_type *atoms,int num_atoms,int which)
{
static char err_string[120];
int i;
Expand All @@ -60,6 +58,7 @@ int find_atom(atoms,num_atoms,which)
sprintf(err_string,"Can't find atom %d (of %d) in find_atom.\n",
which,num_atoms);
FATAL_BUG(err_string);
return(0);
}


Expand Down
Loading

0 comments on commit 7a49197

Please sign in to comment.