Skip to content

Commit

Permalink
Silenced various compiler warnings (some are real bugs!)
Browse files Browse the repository at this point in the history
  • Loading branch information
biochem-fan committed Aug 17, 2022
1 parent 398696f commit f08e6e0
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/gui_jobwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* author citations must be preserved.
***************************************************************************/
#include "src/gui_jobwindow.h"
JobWindow::JobWindow(int _x, int _y, int _w, int _h, const char* title ) : Fl_Box(x,y,w,h,title)
JobWindow::JobWindow(int _x, int _y, int _w, int _h, const char* title ) : Fl_Box(_x,_y,_w,_h,title)
{
clear();
x = _x; y = _y; w = _w; h = _h;
Expand Down
4 changes: 3 additions & 1 deletion src/jaz/gravis/StringFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ namespace gravis
s << start.string();
};

const char* c_str() const
// Takanori removed this because this is broken and not used.
/* const char* c_str() const
{
return s.str().c_str();
}
*/
std::string string() const
{
return s.str();
Expand Down
3 changes: 3 additions & 0 deletions src/jaz/image_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ void ImageLog::write(

switch (center)
{
case NoCenter:
break;

case CenterXY:
{
Image<T> img2(w,h,d);
Expand Down
2 changes: 0 additions & 2 deletions src/jaz/micrograph_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ void MicrographHandler::init(
std::string& metaFn)
{
this->nr_omp_threads = nr_omp_threads;
this->firstFrame = firstFrame;
this->lastFrame = lastFrame;

if (corrMicFn != "")
{
Expand Down
2 changes: 1 addition & 1 deletion src/jaz/obs_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ int ObservationModel::getOpticsGroup(const MetaDataTable &particlesMdt, long int
{
int opticsGroup = -1;
if (!particlesMdt.getValue(EMDL_IMAGE_OPTICS_GROUP, opticsGroup, particle))
REPORT_ERROR("ObservationModel::getOpticsGroup: Failed to get optics group for particle #" + particle);
REPORT_ERROR("ObservationModel::getOpticsGroup: Failed to get optics group for particle #" + std::to_string(particle));
opticsGroup--;

return opticsGroup;
Expand Down
7 changes: 0 additions & 7 deletions src/pipeline_jobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,6 @@ float JobOption::getNumber(std::string &errmsg)
}
else
{

if (&value == NULL)
{
errmsg = "Error in textToFloat of " + value;
return 0.;
}

float retval;
int ok = sscanf(value.c_str(), "%f", &retval);

Expand Down
2 changes: 1 addition & 1 deletion src/pipeliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@ void PipeLine::read(bool do_lock, std::string lock_message)
#ifdef DEBUG_LOCK
std::cerr << " A status= " << status << std::endl;
#endif
while (!status == 0)
while (status != 0)
{
if (errno == EACCES) // interestingly, not EACCESS!
REPORT_ERROR("ERROR: PipeLine::read cannot create a lock directory " + dir_lock + ". You don't have write permission to this project. If you want to look at other's project directory (but run nothing there), please start RELION with --readonly.");
Expand Down
2 changes: 1 addition & 1 deletion src/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void Schedule::read(bool do_lock, FileName fn)
#ifdef DEBUG_LOCK
std::cerr << " A status= " << status << std::endl;
#endif
while (!status == 0)
while (status != 0)
{
if (errno == EACCES) // interestingly, not EACCESS!
REPORT_ERROR("ERROR: Schedule::read cannot create a lock directory " + dir_lock + ". You don't have write permission to this project. If you want to look at other's project directory (but run nothing there), please start RELION with --readonly.");
Expand Down
2 changes: 1 addition & 1 deletion src/tiff_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void TIFFConverter::estimate(FileName fn_movie)
stable++;
}

printf(" %s Frame %03d #Changed %10d #Mismatch %10d, #Negative %10d, #Unreliable %10d / %10d\n",
printf(" %s Frame %03d #Changed %10d #Mismatch %10d, #Negative %10d, #Unreliable %10ld / %10ld\n",
fn_movie.c_str(), iframe + 1, changed, error, negative, YXSIZE(defects()) - stable, YXSIZE(defects()));
}
}
Expand Down

0 comments on commit f08e6e0

Please sign in to comment.