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)
Change History (4)
by , 11 years ago
comment:1 by , 11 years ago
Please reject this suggestions if nMask and the first masking are unrelated.
comment:2 by , 9 years ago
Is there anybody to tell goatbar if nMask and the first masking are unrelated?
comment:3 by , 5 years ago
Milestone: | → closed_because_of_github_migration |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
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.
trivial code cleanup