Commit e3004a65 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

Remove a whole bunch of warnings on Visual Studio .NET

parent 433d4a4d
......@@ -291,12 +291,12 @@ char* vtkRegressionTester::IncrementFileName(const char* fname,
char counts[256];
sprintf(counts, "%d", count);
int orgLen = strlen(fname);
int orgLen = static_cast<int>(strlen(fname));
if (orgLen < 5)
{
return 0;
}
int extLen = strlen(counts);
int extLen = static_cast<int>(strlen(counts));
char* newFileName = new char[orgLen+extLen+2];
strcpy(newFileName, fname);
......
......@@ -142,7 +142,7 @@ char* vtkTestUtilities::ExpandFileNameWithArgOrEnvOrDefault(const char* arg,
fullName = new char[strlen(value) + strlen(fname) + 2 + (slash ? 1 : 0)];
fullName[0] = 0;
strcat(fullName, value);
int len = strlen(fullName);
int len = static_cast<int>(strlen(fullName));
fullName[len] = '/';
fullName[len+1] = 0;
strcat(fullName, fname);
......
......@@ -23,7 +23,7 @@
#include "vtkRectilinearGrid.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkMergeFilter, "1.64");
vtkCxxRevisionMacro(vtkMergeFilter, "1.65");
vtkStandardNewMacro(vtkMergeFilter);
class vtkFieldNode
......@@ -31,7 +31,7 @@ class vtkFieldNode
public:
vtkFieldNode(const char* name, vtkDataSet* ptr=0)
{
int length = strlen(name);
int length = static_cast<int>(strlen(name));
if (length > 0)
{
this->Name = new char[length+1];
......
......@@ -22,7 +22,7 @@
#include "vtkStripper.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtk3DSImporter, "1.26");
vtkCxxRevisionMacro(vtk3DSImporter, "1.27");
vtkStandardNewMacro(vtk3DSImporter);
static Colour Black = {0.0, 0.0, 0.0};
......@@ -1135,7 +1135,7 @@ static void cleanup_name (char *name)
strcpy (tmp, &name[i]);
/* Remove any trailing blanks or quotes */
for (i = strlen(tmp)-1; i >= 0; i--)
for (i = static_cast<int>(strlen(tmp))-1; i >= 0; i--)
{
if (isprint(tmp[i]) && !isspace(tmp[i]) && tmp[i] != '"')
{
......
......@@ -25,7 +25,7 @@
#include "vtkTransform.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkLegendBoxActor, "1.18");
vtkCxxRevisionMacro(vtkLegendBoxActor, "1.19");
vtkStandardNewMacro(vtkLegendBoxActor);
vtkLegendBoxActor::vtkLegendBoxActor()
......@@ -405,7 +405,7 @@ int vtkLegendBoxActor::RenderOpaqueGeometry(vtkViewport *viewport)
str = this->TextMapper[i]->GetInput();
if ( str ) //if there is a string
{
length = strlen(str);
length = static_cast<int>(strlen(str));
if ( length > maxLength )
{
maxLength = length;
......
......@@ -4228,7 +4228,7 @@ YY_MALLOC_DECL
#define YY_BREAK break;
#endif
vtkCxxRevisionMacro(vtkVRMLImporter, "1.48");
vtkCxxRevisionMacro(vtkVRMLImporter, "1.49");
vtkStandardNewMacro(vtkVRMLImporter);
vtkPoints* vtkVRMLImporter::PointsNew()
......@@ -6268,8 +6268,10 @@ vtkVRMLImporter::GetVRMLDEFObject(const char *name)
static void memyyInput(char *buf, int &result, int max_size) {
result = strlen(strncpy(buf, standardNodes[memyyInput_i], max_size));
memyyInput_j = result - strlen(standardNodes[memyyInput_i]);
result = static_cast<int>(
strlen(strncpy(buf, standardNodes[memyyInput_i], max_size)));
memyyInput_j = result - static_cast<int>(
strlen(standardNodes[memyyInput_i]));
if ( memyyInput_j == 0 )
{
memyyInput_i++;
......@@ -6284,7 +6286,7 @@ static void defyyInput(char *buf, int &result, int max_size) {
result = c == EOF ? 0 : 1;
buf[0] = (char) c;
}
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0)
else if( ((result = static_cast<int>(fread( buf, 1, max_size, yyin ))) == 0)
&& ferror( yyin ) )
{
YY_FATAL_ERROR( "input in flex scanner failed" );
......
......@@ -24,7 +24,7 @@
#include <sys/types.h>
#include <sys/stat.h>
vtkCxxRevisionMacro(vtkMCubesReader, "1.57");
vtkCxxRevisionMacro(vtkMCubesReader, "1.58");
vtkStandardNewMacro(vtkMCubesReader);
// Construct object with FlipNormals turned off and Normals set to true.
......@@ -188,7 +188,8 @@ void vtkMCubesReader::Execute()
for (j=0; j<3; j++)
{
int val;
val = fread (&point, static_cast<int>(sizeof(pointType)), 1, fp);
val = static_cast<int>(
fread (&point, static_cast<int>(sizeof(pointType)), 1, fp));
if (val != 1)
{
vtkErrorMacro(<<"Error reading triange " << i
......
......@@ -29,7 +29,7 @@
#include "vtkDoubleArray.h"
#include "vtkIdTypeArray.h"
vtkCxxRevisionMacro(vtkCommunicator, "1.11");
vtkCxxRevisionMacro(vtkCommunicator, "1.12");
template <class T>
static int SendDataArray(T* data, int length, int handle, int tag, vtkCommunicator *self)
......@@ -149,7 +149,7 @@ int vtkCommunicator::Send(vtkDataArray* data, int remoteHandle, int tag)
int len = 0;
if (name)
{
len = strlen(name) + 1;
len = static_cast<int>(strlen(name)) + 1;
}
// send length of name
......
......@@ -176,7 +176,8 @@ public:
// Description:
// Convenience method when the arg is a string.
void TriggerRMI(int remoteProcessId, char *arg, int tag)
{ this->TriggerRMI(remoteProcessId, (void*)arg, strlen(arg)+1, tag); }
{ this->TriggerRMI(remoteProcessId, (void*)arg,
static_cast<int>(strlen(arg))+1, tag); }
// Description:
// Convenience method when there is no argument.
......
......@@ -21,7 +21,7 @@
#include "vtkObjectFactory.h"
#include "vtkSource.h"
vtkCxxRevisionMacro(vtkPDataSetWriter, "1.5");
vtkCxxRevisionMacro(vtkPDataSetWriter, "1.6");
vtkStandardNewMacro(vtkPDataSetWriter);
//----------------------------------------------------------------------------
......@@ -96,7 +96,7 @@ void vtkPDataSetWriter::Write()
// Lets compute the file root from the file name supplied by the user.
length = strlen(this->FileName);
length = static_cast<int>(strlen(this->FileName));
fileRoot = new char [length+1];
fileName = new char [length+strlen(this->FilePattern)+20];
strncpy(fileRoot, this->FileName, length);
......
......@@ -24,7 +24,7 @@
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
vtkCxxRevisionMacro(vtkPVGeometryFilter, "1.9");
vtkCxxRevisionMacro(vtkPVGeometryFilter, "1.10");
vtkStandardNewMacro(vtkPVGeometryFilter);
//----------------------------------------------------------------------------
......@@ -229,7 +229,8 @@ void vtkPVGeometryFilter::RectilinearGridExecute(vtkRectilinearGrid *input)
//----------------------------------------------------------------------------
void vtkPVGeometryFilter::UnstructuredGridExecute(vtkUnstructuredGrid *input)
void vtkPVGeometryFilter::UnstructuredGridExecute(
vtkUnstructuredGrid* vtkNotUsed(input))
{
this->OutlineFlag = 0;
this->vtkDataSetSurfaceFilter::Execute();
......
......@@ -18,7 +18,7 @@
#include "vtkWin32TextMapper.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkWin32TextMapper, "1.27");
vtkCxxRevisionMacro(vtkWin32TextMapper, "1.28");
//--------------------------------------------------------------------------
vtkWin32TextMapper* vtkWin32TextMapper::New()
......@@ -163,8 +163,10 @@ void vtkWin32TextMapper::GetSize(vtkViewport* viewport, int *size)
DT_CALCRECT|DT_LEFT|DT_NOPREFIX);
delete [] wtxt;
#else
size[1] = DrawText(hdc, this->Input, strlen(this->Input), &rect,
DT_CALCRECT|DT_LEFT|DT_NOPREFIX);
size[1] = static_cast<int>(DrawText(hdc, this->Input,
static_cast<int>(strlen(this->Input)),
&rect,
DT_CALCRECT|DT_LEFT|DT_NOPREFIX));
#endif
size[0] = rect.right - rect.left + 1;
this->LastSize[0] = size[0];
......
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