bugpktools - Bugs: bug #57918, superflous abs() prevents...

 
 

bug #57918: superflous abs() prevents compilation on linux/g++-9.2.1

Submitter:  None
Submitted:  Fri 28 Feb 2020 01:53:32 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  * GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 28 Feb 2020 02:07:06 PM UTC, comment #1: 

woops, that patch was reversed.


332,333c332,333
<       ncropcol=abs(static_cast<unsigned int>(ceil((lrx_opt[0]-ulx_opt[0])/dx)));
<       ncroprow=abs(static_cast<unsigned int>(ceil((uly_opt[0]-lry_opt[0])/dy)));
---

>       ncropcol=(static_cast<unsigned int>(ceil((lrx_opt[0]-ulx_opt[0])/dx)));
>       ncroprow=(static_cast<unsigned int>(ceil((uly_opt[0]-lry_opt[0])/dy)));

428,429c428,429
<       ncropcol=abs(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
<       ncroprow=abs(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));
---

>       ncropcol=(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
>       ncroprow=(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));

465,466c465,466
<       ncropcol=abs(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
<       ncroprow=abs(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));
---

>       ncropcol=(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
>       ncroprow=(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));


Anonymous
Fri 28 Feb 2020 01:53:32 PM UTC, original submission:  

in pktools/src/imageclasses/pkcrop_lib.cc
abs(static_cast<unsigned int>(value))
is used on multiple occasions, removing abs() fixes it for me and allows compilation.


patch for pktools/src/imageclasses/pkcrop_lib.cc:


332,333c332,333
<       ncropcol=(static_cast<unsigned int>(ceil((lrx_opt[0]-ulx_opt[0])/dx)));
<       ncroprow=(static_cast<unsigned int>(ceil((uly_opt[0]-lry_opt[0])/dy)));
---

>       ncropcol=abs(static_cast<unsigned int>(ceil((lrx_opt[0]-ulx_opt[0])/dx)));
>       ncroprow=abs(static_cast<unsigned int>(ceil((uly_opt[0]-lry_opt[0])/dy)));

428,429c428,429
<       ncropcol=(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
<       ncroprow=(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));
---

>       ncropcol=abs(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
>       ncroprow=abs(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));

465,466c465,466
<       ncropcol=(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
<       ncroprow=(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));
---

>       ncropcol=abs(static_cast<unsigned int>(ceil((croplrx-cropulx)/dx)));
>       ncroprow=abs(static_cast<unsigned int>(ceil((cropuly-croplry)/dy)));


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.14-f13d.
Corresponding source code