Ticket #2119 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

terragen: overflow in implicit constant conversion

Reported by: rouault Assigned to: 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

12/21/07 12:09:33 changed by mloskot

  • cc changed from warmerdam to warmerdam, mloskot.

12/21/07 12:15:48 changed 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 :-)

12/21/07 17:15:38 changed by rayg

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

12/21/07 17:17:22 changed 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!

12/21/07 18:09:33 changed 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.

12/21/07 18:19:04 changed by mloskot

No problem, thanks!

12/22/07 07:04:38 changed by rouault

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 1.5.1.