* return the greatest common divisor between a and b (fast algorithm) */
| 57 | * return the greatest common divisor between a and b (fast algorithm) |
| 58 | */ |
| 59 | static unsigned get_gcd(unsigned a, unsigned b) |
| 60 | { |
| 61 | unsigned c; |
| 62 | |
| 63 | if (0 == a) |
| 64 | return b; |
| 65 | if (0 == b) |
| 66 | return a; |
| 67 | |
| 68 | if (a < b) { |
| 69 | c = a; |
| 70 | a = b; |
| 71 | b = c; |
| 72 | } |
| 73 | |
| 74 | while (b != 0) { |
| 75 | c = a % b; |
| 76 | a = b; |
| 77 | b = c; |
| 78 | } |
| 79 | |
| 80 | return a; |
| 81 | } |
| 82 | |
| 83 | /* |
| 84 | * Depending on memory configuration on x86 arch, objects addresses are spread |
no outgoing calls
no test coverage detected