Ticket #2119 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

terragen: overflow in implicit constant conversion

Reported by: rouault Owned by: rayg
Priority: normal Milestone: 1.5.1
Component: default Version: 1.4.4
Severity: normal Keywords: terragen
Cc: warmerdam, mloskot

Description

When compiling GDAL (1.5, and 1.4.X probably), the following warning is emitted :

terragendataset.cpp: In constructor 'TerragenDataset::TerragenDataset()':
terragendataset.cpp:463: warning: overflow in implicit constant conversion

Declaration : GInt16 m_nHeightScale;

Initialization: m_nHeightScale = 65536;

Hence the warning.

Change History

Changed 4 years ago by mloskot

  • cc mloskot added

Changed 4 years ago by mloskot

It should be safe to change the type from 16-bit to 32-bit integer. Or to change from signed 16-bit integer to unsigned that ranges from 0 to 65535 assuming value 65536 is wrong :-)

Changed 4 years ago by rayg

heightscale init'd to zero. Type must be Gint16; is data file field.

Changed 4 years ago by mloskot

rayg,

Is the r13440 changeset related to this bug? Please, may I ask for providing commit message that includes, at least, ticket number that submission refers too? Thanks!

Changed 4 years ago by rayg

Yeah, sorry about that... I realized I'd forgotten to comment just after I checked the file in. I'm used to scc systems that prompt for comments.

Changed 4 years ago by mloskot

No problem, thanks!

Changed 4 years ago by rouault

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 1.5.1
Note: See TracTickets for help on using tickets.