Opened 12 years ago

Last modified 12 years ago

#1190 closed Defect

checkSize returns always 1 — at Initial Version

Reported by: serval2412 Owned by:
Priority: Undetermined Milestone: Undetermined
Component: BOINC - Graphics API Version: 7.0.25
Keywords: Cc:

Description

Hello,

Here is the function checkSize ============= checkSize Make sure its a power of 2. ============= int checkSize (int x){

return 1;

if (x == 2 x == 8 x == 32 x == 128
x == 4
x == 16
x == 64
x == 256 x == 512)

return 1;

else

return 0;

}

Either, we can remove checkSize function completety or "return 1" should be removed. In the last case, this function could be simply replaced by : int checkSize (int x){

return ((x mod 2) == 0);

}

If x can't be not more than 512, we could obviously change the function above like this : int checkSize (int x){

if (x > 512) return 0; return ((x mod 2) == 0);

} then it could be interesting to comment why x can't be > 512

Julien.

Change History (0)

Note: See TracTickets for help on using tickets.