Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
2fb2d55a
Commit
2fb2d55a
authored
Jul 06, 2016
by
Andrew Bauer
Browse files
Fixing signed/unsigned compiler warning messages in WindBladeReader
parent
7b7175dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
IO/Geometry/vtkWindBladeReader.cxx
View file @
2fb2d55a
...
...
@@ -477,7 +477,7 @@ void vtkWindBladeReader::CalculatePressure(int pressure, int prespre,
fseek
(
this
->
Internal
->
FilePtr
,
this
->
VariableOffset
[
tempg
],
SEEK_SET
);
if
(
fread
(
tempgData
,
sizeof
(
float
),
this
->
BlockSize
,
this
->
Internal
->
FilePtr
)
!=
this
->
BlockSize
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading tempgData."
);
...
...
@@ -485,7 +485,7 @@ void vtkWindBladeReader::CalculatePressure(int pressure, int prespre,
fseek
(
this
->
Internal
->
FilePtr
,
this
->
VariableOffset
[
density
],
SEEK_SET
);
if
(
fread
(
densityData
,
sizeof
(
float
),
this
->
BlockSize
,
this
->
Internal
->
FilePtr
)
!=
this
->
BlockSize
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading densityData."
);
...
...
@@ -516,7 +516,7 @@ void vtkWindBladeReader::CalculateVorticity(int vort, int uvw, int density)
fseek
(
this
->
Internal
->
FilePtr
,
this
->
VariableOffset
[
uvw
],
SEEK_SET
);
if
(
fread
(
uData
,
sizeof
(
float
),
this
->
BlockSize
,
this
->
Internal
->
FilePtr
)
!=
this
->
BlockSize
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading uData."
);
...
...
@@ -524,7 +524,7 @@ void vtkWindBladeReader::CalculateVorticity(int vort, int uvw, int density)
fseek
(
this
->
Internal
->
FilePtr
,
(
2
*
sizeof
(
int
)),
SEEK_SET
);
if
(
fread
(
vData
,
sizeof
(
float
),
this
->
BlockSize
,
this
->
Internal
->
FilePtr
)
!=
this
->
BlockSize
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading vData."
);
...
...
@@ -535,7 +535,7 @@ void vtkWindBladeReader::CalculateVorticity(int vort, int uvw, int density)
fseek
(
this
->
Internal
->
FilePtr
,
this
->
VariableOffset
[
density
],
SEEK_SET
);
if
(
fread
(
densityData
,
sizeof
(
float
),
this
->
BlockSize
,
this
->
Internal
->
FilePtr
)
!=
this
->
BlockSize
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading densityData."
);
...
...
@@ -570,9 +570,9 @@ void vtkWindBladeReader::LoadVariableData(int var)
// Read the block of data
size_t
cnt
;
if
((
cnt
=
fread
(
block
,
sizeof
(
float
),
this
->
BlockSize
,
this
->
Internal
->
FilePtr
))
!=
static_cast
<
size_t
>
(
this
->
BlockSize
)
)
this
->
BlockSize
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading block of data."
...
...
@@ -752,13 +752,13 @@ bool vtkWindBladeReader::FindVariableOffsets()
int
byteCount
;
if
(
fread
(
&
byteCount
,
sizeof
(
int
),
1
,
this
->
Internal
->
FilePtr
)
!=
1
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading byteCount."
);
}
this
->
BlockSize
=
byteCount
/
BYTES_PER_DATA
;
this
->
BlockSize
=
static_cast
<
size_t
>
(
byteCount
/
BYTES_PER_DATA
)
;
for
(
int
var
=
0
;
var
<
this
->
NumberOfFileVariables
;
var
++
)
{
...
...
@@ -937,7 +937,7 @@ void vtkWindBladeReader::CreateCoordinates()
this
->
CreateZTopography
(
this
->
ZTopographicValues
);
this
->
ZMinValue
=
this
->
ZTopographicValues
[
0
];
for
(
unsigned
in
t
k
=
0
;
k
<
this
->
BlockSize
;
k
++
)
for
(
size_
t
k
=
0
;
k
<
this
->
BlockSize
;
k
++
)
{
if
(
this
->
ZMinValue
>
this
->
ZTopographicValues
[
k
])
{
...
...
@@ -970,7 +970,7 @@ void vtkWindBladeReader::CreateZTopography(float* zValues)
fseek
(
filePtr
,
BYTES_PER_DATA
,
SEEK_SET
);
// Fortran byte count
if
(
fread
(
topoData
,
sizeof
(
float
),
blockSize
,
filePtr
)
!=
static_cast
<
size_t
>
(
blockSize
)
)
{
// This is really an
d
error, but for the time being we report a
// This is really an error, but for the time being we report a
// warning
vtkWarningMacro
(
"WindBladeReader error reading file: "
<<
this
->
Filename
<<
" Premature EOF while reading topoData."
);
...
...
@@ -1458,7 +1458,7 @@ void vtkWindBladeReader::SetUpVorticityData(float* uData, float* vData,
const
float
*
densityData
,
float
*
vortData
)
{
// Divide U and V components by Density
for
(
unsigned
in
t
i
=
0
;
i
<
this
->
BlockSize
;
i
++
)
for
(
size_
t
i
=
0
;
i
<
this
->
BlockSize
;
i
++
)
{
uData
[
i
]
/=
densityData
[
i
];
vData
[
i
]
/=
densityData
[
i
];
...
...
IO/Geometry/vtkWindBladeReader.h
View file @
2fb2d55a
...
...
@@ -138,8 +138,8 @@ protected:
int
*
VariableBasicType
;
// FLOAT or INTEGER
int
*
VariableByteCount
;
// Number of bytes in basic type
long
int
*
VariableOffset
;
// Offset into data file
unsigned
BlockSize
;
// Size of every data block
unsigned
GBlockSize
;
// Size of every data block
size_t
BlockSize
;
// Size of every data block
size_t
GBlockSize
;
// Size of every data block
vtkFloatArray
**
Data
;
// Actual data arrays
vtkStdString
RootDirectory
;
// Directory where the .wind file is.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment