commit b449c241c99e6419a552da53cd0c868920c740cd
parent 2079f1d51595b798024910301b23d5043d6242f8
Author: vaplv <vaplv@free.fr>
Date: Fri, 21 Oct 2016 14:53:08 +0200
Revert "Add and test the sin_cos function"
This reverts commit 2079f1d51595b798024910301b23d5043d6242f8.
Diffstat:
4 files changed, 1 insertion(+), 40 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -45,7 +45,6 @@ set(RSYS_FILES_SRC
image.c
library.c
logger.c
- math.c
mem_allocator.c
quaternion.c
str.c)
@@ -189,7 +188,7 @@ if(NOT NO_TEST)
new_test(test_list rsys)
new_test(test_logger rsys)
new_test(test_mem_allocator rsys)
- new_test(test_math ${MATH_LIB} rsys)
+ new_test(test_math ${MATH_LIB})
new_test(test_quaternion rsys)
new_test(test_ref)
new_test(test_signal rsys)
diff --git a/src/math.c b/src/math.c
@@ -1,30 +0,0 @@
-/* Copyright (C) 2013-2016 Vincent Forest (vaplv@free.fr)
- *
- * The RSys library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The RSys library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with the RSys library. If not, see <http://www.gnu.org/licenses/>. */
-
-#define _GNU_SOURCE
-#include "math.h"
-
-void
-sin_cos(const double d, double* s, double* c)
-{
- ASSERT(s && c);
-#ifdef COMPILER_GCC
- sincos(d, s, c);
-#else
- *s = sin(d);
- *c = cos(d);
-#endif
-}
-
diff --git a/src/math.h b/src/math.h
@@ -104,7 +104,4 @@ cos2sin(const double d)
return sin2cos(d);
}
-RSYS_API void
-sin_cos(const double d, double* s, double* c);
-
#endif /* MATH_H */
diff --git a/src/test_math.c b/src/test_math.c
@@ -24,7 +24,6 @@ int
main(int argc, char** argv)
{
double d;
- double sinus, cosine;
float f, g;
int i;
(void)argc, (void)argv;
@@ -123,10 +122,6 @@ main(int argc, char** argv)
CHECK(eq_eps(s, tmp, 1.0e-8) || eq_eps(s, -tmp, 1.0e-8), 1);
tmp = sin2cos(s);
CHECK(eq_eps(c, tmp, 1.0e-8) || eq_eps(c, -tmp, 1.0e-8), 1);
-
- sin_cos(d, &sinus, &cosine);
- CHECK(eq_eps(sinus, s, 1.e-8), 1);
- CHECK(eq_eps(cosine, c, 1.e-8), 1);
}
CHECK(signf(-3.14159f), -1.f);