Skip to content

Commit

Permalink
More warning corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnoel committed Feb 13, 2024
1 parent 4316b8d commit 91be4ad
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/linad99/derch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void derch(const double& _f, const independent_variables & _x,
double& f=(double&) _f;
int& ireturn = (int&) _ireturn;
independent_variables& x= (independent_variables&) _x;
static int i, n1 ,n2,ii;
[[maybe_unused]] static int i;
static int n1 ,n2,ii;
static double fsave;
static int order_flag;
static double s, f1, f2, g2, xsave;
Expand Down
2 changes: 1 addition & 1 deletion src/linad99/df_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ DF_FILE::DF_FILE(const size_t nbytes, [[maybe_unused]] const unsigned int id)
{
buff = new char[buff_size];
}
catch (const std::bad_alloc& e)
catch ([[maybe_unused]] const std::bad_alloc& e)
{
size_t gb = nbytes / 1073741824;
cerr << "Error: Unable to construct DF_FILE memory buffer\n"
Expand Down
2 changes: 1 addition & 1 deletion src/linad99/dmat34.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ dvector solve(const dmatrix& aa,const dvector& z,
double* pvvj = &vv(lb);
for (int j=lb;j<=ub;j++)
{
dvector* pbbi = &bb(lb);
pbbi = &bb(lb);
for (int i=lb;i<j;i++)
{
sum = *(pbbi->get_v() + j);
Expand Down
2 changes: 0 additions & 2 deletions src/linad99/dvect9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ dvector::dvector(const char* s)
for (int i = 1; i <= count; ++i)
{
int index = 0;
char c;
infile.get(c);
while (!infile.eof())
{
Expand Down Expand Up @@ -479,7 +478,6 @@ void dvector::allocate(const char* s)
for (int i = 1; i <= count; ++i)
{
int index = 0;
char c;
infile.get(c);
while (!infile.eof())
{
Expand Down
1 change: 0 additions & 1 deletion src/linad99/fvar_io2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ dvar_vector::dvar_vector(const char * s)
for (i=1;i<=count;i++)
{
int index = 0;
char c;
infile.get(c);
while (!infile.eof())
{
Expand Down
2 changes: 1 addition & 1 deletion src/linad99/gst_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int grad_stack::read_grad_stack_buffer(OFF_T& lpos)
#if defined(DEBUG)
assert(sizeof(grad_stack_entry) * length <= UINT_MAX);
#endif
ssize_t nread = read(_GRADFILE_PTR, ptr_first, sizeof(grad_stack_entry)*length);
ssize_t nread = read(_GRADFILE_PTR, ptr_first, static_cast<unsigned int>(sizeof(grad_stack_entry)*length));
ptr = ptr_first + length-1;

if (nread == -1 )
Expand Down
4 changes: 2 additions & 2 deletions src/linad99/jacob2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ void gradient_structure::jacobcalc(int nvar, const ofstream& _ofs)

double_and_int* tmp = (double_and_int*)ARR_LIST1->ARRAY_MEMBLOCK_BASE;

unsigned long int max_last_offset = ARR_LIST1->get_max_last_offset();
unsigned long int local_max_last_offset = ARR_LIST1->get_max_last_offset();

size_t size = sizeof(double_and_int );

for (unsigned int i = 0; i < (max_last_offset/size); i++)
for (unsigned int i = 0; i < (local_max_last_offset/size); i++)
{
tmp->x = 0;
#if defined (__ZTC__)
Expand Down
4 changes: 2 additions & 2 deletions src/linad99/jacob3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ void gradient_structure::jacobcalc(int nvar, const uostream& ofs)

double_and_int* tmp = (double_and_int*)ARR_LIST1->ARRAY_MEMBLOCK_BASE;

unsigned long int max_last_offset = ARR_LIST1->get_max_last_offset();
unsigned long int local_max_last_offset = ARR_LIST1->get_max_last_offset();

size_t size = sizeof(double_and_int);

for (unsigned int i = 0; i < (max_last_offset/size); i++)
for (unsigned int i = 0; i < (local_max_last_offset/size); i++)
{
tmp->x = 0;
#if defined (__ZTC__)
Expand Down
4 changes: 2 additions & 2 deletions src/linad99/jacobclc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ void gradient_structure::jacobcalc(int nvar, const dmatrix& _jac)

double_and_int* tmp = (double_and_int*)ARR_LIST1->ARRAY_MEMBLOCK_BASE;

unsigned long int max_last_offset = ARR_LIST1->get_max_last_offset();
unsigned long int local_max_last_offset = ARR_LIST1->get_max_last_offset();

size_t size = sizeof(double_and_int);

for (unsigned int i = 0; i < (max_last_offset/size); i++)
for (unsigned int i = 0; i < (local_max_last_offset/size); i++)
{
tmp->x = 0;
#if defined (__ZTC__)
Expand Down
2 changes: 1 addition & 1 deletion src/linad99/minim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ double fmm::minimize(const independent_variables & x,
g.initialize();
#endif
{
gradient_structure gs;
gradient_structure local_gs;
while (ireturn >= 0)
{
fmin(f,x,g);
Expand Down
4 changes: 2 additions & 2 deletions src/linad99/sgradclc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void gradient_structure::save_arrays()
LSEEK(GRAD_STACK1->_VARSSAV_PTR,0L,SEEK_SET);

#if defined(DOS386)
#if (__cplusplus >= 201703L)
#ifndef DEBUG
[[maybe_unused]]
#endif
ssize_t ret = write(GRAD_STACK1->_VARSSAV_PTR, (char*)src, bytes_needed);
Expand Down Expand Up @@ -326,7 +326,7 @@ void gradient_structure::restore_arrays()
LSEEK(GRAD_STACK1->_VARSSAV_PTR,0L,SEEK_SET);

#if defined(DOS386)
#if (__cplusplus >= 201703L)
#ifndef DEBUG
[[maybe_unused]]
#endif
ssize_t ret = read(GRAD_STACK1->_VARSSAV_PTR, (char*)dest,bytes_needed);
Expand Down

0 comments on commit 91be4ad

Please sign in to comment.