Commit 157d370a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Rémi Denis-Courmont

Re-implement GCD iteratively. Fix unused function warning.

(cherry picked from commit d6271bf0)
parent 9861846a
...@@ -550,10 +550,15 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */ ...@@ -550,10 +550,15 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
# define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) ) # define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
#endif #endif
static int64_t GCD( int64_t a, int64_t b ) static inline int64_t GCD( int64_t a, int64_t b )
{ {
if( b ) return GCD( b, a % b ); while( b )
else return a; {
int64_t c = a % b;
a = b;
b = c;
}
return a;
} }
/* Dynamic array handling: realloc array, move data, increment position */ /* Dynamic array handling: realloc array, move data, increment position */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment