>> >> static int compare_int64(const void *a, const void *b) >> { >> - int64_t va = *(int64_t *)a, vb = *(int64_t *)b; >> - return va < vb ? -1 : va > vb ? +1 : 0; >> + return *(const int64_t *)a - *(const int64_t *)b; >> } >> > > What if the result doesn't fit in int? The input is not int.
Even for int this transformation is not valid assuming that the full range of int is possible. For example if *a = INT_MAX and *b = -1 then *a - *b = INT_MAX+1 which is negative when cast to an int. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel