From 3e21d6bd39038870eaca5db5d6b9528628d2ffcf Mon Sep 17 00:00:00 2001 From: grauser Date: Wed, 14 Jul 2021 10:49:50 +0200 Subject: [PATCH] FitRideFile : Use qbswap --- src/FileIO/FitRideFile.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/FileIO/FitRideFile.cpp b/src/FileIO/FitRideFile.cpp index edd4ce9327..c2cb6a220b 100644 --- a/src/FileIO/FitRideFile.cpp +++ b/src/FileIO/FitRideFile.cpp @@ -308,16 +308,7 @@ struct FitFileReaderState (*count) += 4; if (is_big_endian) { - float f2; - char *floatToConvert = ( char* ) & f; - char *returnFloat = ( char* ) & f2; - - // swap the bytes into a temporary buffer - returnFloat[0] = floatToConvert[3]; - returnFloat[1] = floatToConvert[2]; - returnFloat[2] = floatToConvert[1]; - returnFloat[3] = floatToConvert[0]; - f = f2; + f = qbswap(f); } return f;