Opened 11 years ago

Closed 5 years ago

#5184 closed defect (wontfix)

Minor nit in hfafield

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: lowest Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

This is not a bug. Just a suggestion for a pretty trivial code cleanup at the nit level.

http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/hfa/hfafield.cpp#L1050

nMask is defined after the value is used.

svn diff Index: hfafield.cpp =================================================================== --- hfafield.cpp (revision 26271) +++ hfafield.cpp (working copy) @@ -1047,9 +1047,9 @@

} else if( nBaseItemType == EPT_u2 ) {

  • int nBitOffset = nIndexValue & 0x3;

+ int nMask = 0x3; + int nBitOffset = nIndexValue & nMask;

int nByteOffset = nIndexValue >> 2;

  • int nMask = 0x3;

if (nByteOffset >= nDataSize) {

@@ -1062,9 +1062,9 @@

} else if( nBaseItemType == EPT_u4 ) {

  • int nBitOffset = nIndexValue & 0x7;

+ int nMask = 0x7; + int nBitOffset = nIndexValue & nMask;

int nByteOffset = nIndexValue >> 3;

  • int nMask = 0x7;

if (nByteOffset >= nDataSize) {

Attachments (1)

patch (908 bytes ) - added by Kurt Schwehr 11 years ago.
trivial code cleanup

Download all attachments as: .zip

Change History (4)

by Kurt Schwehr, 11 years ago

Attachment: patch added

trivial code cleanup

comment:1 by Kurt Schwehr, 11 years ago

Please reject this suggestions if nMask and the first masking are unrelated.

comment:2 by Jukka Rahkonen, 9 years ago

Is there anybody to tell goatbar if nMask and the first masking are unrelated?

comment:3 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.