Gui: replace pow() function
The old pow function doesn't work for other power than 2 - replace pow function by a squared one Solve the TeamWin/Team-Win-Recovery-Project#646 issue. Change-Id: Id177300d45a7b49ff983795288434d910eb35c2a
This commit is contained in:
@@ -232,9 +232,12 @@ void GUIPatternPassword::Resize(size_t n) {
|
||||
|
||||
static int pow(int x, int i)
|
||||
{
|
||||
while(i-- > 1)
|
||||
x *= x;
|
||||
return x;
|
||||
int result = 1;
|
||||
if (i<0)
|
||||
return 0;
|
||||
while(i-- > 0)
|
||||
result *= x;
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool IsInCircle(int x, int y, int ox, int oy, int r)
|
||||
|
||||
Reference in New Issue
Block a user