Commit 81e6b26c authored by Ken Martin's avatar Ken Martin

fix some warnings exposed by newer compiler

warnings on eeloo after OS upgrade
parent 9a3430ac
......@@ -122,7 +122,7 @@ void vtkNIFTIImageHeader::SetHeader(const nifti_1_header *hdr)
if (isnifti)
{
this->IntentCode = hdr->intent_code;
strncpy(this->IntentName, hdr->intent_name, sizeof(hdr->intent_name));
strncpy(this->IntentName, hdr->intent_name, sizeof(this->IntentName));
this->IntentP1 = hdr->intent_p1;
this->IntentP2 = hdr->intent_p2;
this->IntentP3 = hdr->intent_p3;
......@@ -141,8 +141,8 @@ void vtkNIFTIImageHeader::SetHeader(const nifti_1_header *hdr)
}
this->XYZTUnits = hdr->xyzt_units;
this->DimInfo = hdr->dim_info;
strncpy(this->Descrip, hdr->descrip, sizeof(hdr->descrip));
strncpy(this->AuxFile, hdr->aux_file, sizeof(hdr->aux_file));
strncpy(this->Descrip, hdr->descrip, sizeof(this->Descrip));
strncpy(this->AuxFile, hdr->aux_file, sizeof(this->AuxFile));
if (isnifti)
{
this->QFormCode = hdr->qform_code;
......@@ -233,7 +233,7 @@ void vtkNIFTIImageHeader::SetHeader(const nifti_2_header *hdr)
this->PixDim[i] = hdr->pixdim[i];
}
this->IntentCode = hdr->intent_code;
strncpy(this->IntentName, hdr->intent_name, sizeof(hdr->intent_name));
strncpy(this->IntentName, hdr->intent_name, sizeof(this->IntentName));
this->IntentP1 = hdr->intent_p1;
this->IntentP2 = hdr->intent_p2;
this->IntentP3 = hdr->intent_p3;
......@@ -248,8 +248,8 @@ void vtkNIFTIImageHeader::SetHeader(const nifti_2_header *hdr)
this->SliceCode = hdr->slice_code;
this->XYZTUnits = hdr->xyzt_units;
this->DimInfo = hdr->dim_info;
strncpy(this->Descrip, hdr->descrip, sizeof(hdr->descrip));
strncpy(this->AuxFile, hdr->aux_file, sizeof(hdr->aux_file));
strncpy(this->Descrip, hdr->descrip, sizeof(this->Descrip));
strncpy(this->AuxFile, hdr->aux_file, sizeof(this->AuxFile));
this->QFormCode = hdr->qform_code;
this->SFormCode = hdr->sform_code;
this->QuaternB = hdr->quatern_b;
......
......@@ -182,18 +182,10 @@ extern "C"
extern "C"
{
static void vtkPNGWriteWarningFunction(png_structp png_ptr,
static void vtkPNGWriteWarningFunction(png_structp /*png_ptr*/,
png_const_charp warning_msg)
{
PNG_CONST char *name = "UNKNOWN (ERROR!)";
char *test;
test = static_cast<char *>(png_get_error_ptr(png_ptr));
if (test == nullptr)
fprintf(stderr, "%s: libpng warning: %s\n", name, warning_msg);
else
fprintf(stderr, "%s: libpng warning: %s\n", test, warning_msg);
fprintf(stderr, "libpng warning: %s\n", warning_msg);
}
}
......@@ -279,7 +271,7 @@ void vtkPNGWriter::WriteSlice(vtkImageData *data, int* uExtent)
return;
}
png_init_io(png_ptr, this->TempFP);
png_set_error_fn(png_ptr, png_ptr,
png_set_error_fn(png_ptr, nullptr,
vtkPNGWriteErrorFunction, vtkPNGWriteWarningFunction);
if (setjmp(png_jmpbuf((png_ptr))))
{
......
......@@ -216,7 +216,7 @@ int vtkMPIMultiBlockPLOT3DReader::OpenFileForDataRead(void*& vfp, const char* fn
throw MPIPlot3DException();
}
}
catch (MPIPlot3DException)
catch (const MPIPlot3DException &)
{
delete handle;
vfp = nullptr;
......
......@@ -1582,7 +1582,7 @@ int vtkXMLReader::SetFieldDataInfo(vtkXMLDataElement *eDSA,
return 1;
}
char *(attributeName[vtkDataSetAttributes::NUM_ATTRIBUTES]);
char *attributeName[vtkDataSetAttributes::NUM_ATTRIBUTES];
for (int i = 0; i < vtkDataSetAttributes::NUM_ATTRIBUTES; i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment