From bd6ea30351da7505f3ffd923402774c51c1fdb3f Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Mon, 21 May 2012 09:36:23 +0000 Subject: [PATCH] no longer using sinf/cosfsqrtf in fg_geometry, no need for all this extra boilerplate git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1319 7f0cb862-5218-0410-a997-914c9d46530a --- CMakeLists.txt | 3 --- config.h.in | 3 --- src/fg_geometry.c | 19 ++++--------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2277d70..f2e2c1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,9 +245,6 @@ CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H) CHECK_INCLUDE_FILES(errno.h HAVE_ERRNO_H) CHECK_INCLUDE_FILES(usbhid.h HAVE_USBHID_H) -CHECK_FUNCTION_EXISTS(sinf HAVE_SINF) -CHECK_FUNCTION_EXISTS(cosf HAVE_COSF) -CHECK_FUNCTION_EXISTS(sqrtf HAVE_SQRTF) CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) CHECK_FUNCTION_EXISTS(vfprintf HAVE_VFPRINTF) CHECK_FUNCTION_EXISTS(_doprnt HAVE_DOPRNT) diff --git a/config.h.in b/config.h.in index 8d7f60d..823ff07 100644 --- a/config.h.in +++ b/config.h.in @@ -13,9 +13,6 @@ #cmakedefine HAVE_GETTIMEOFDAY #cmakedefine HAVE_VFPRINTF #cmakedefine HAVE_DOPRNT -#cmakedefine HAVE_SINF -#cmakedefine HAVE_COSF -#cmakedefine HAVE_SQRTF #cmakedefine NEED_XPARSEGEOMETRY_IMPL #cmakedefine HAVE_STDINT_H #cmakedefine HAVE_INTTYPES_H diff --git a/src/fg_geometry.c b/src/fg_geometry.c index f4f5056..57301a0 100644 --- a/src/fg_geometry.c +++ b/src/fg_geometry.c @@ -30,17 +30,6 @@ #include "fg_gl2.h" #include -/* VC++6 in C mode doesn't have C99's sinf/cos/sqrtf */ -#ifndef HAVE_SINF -#define sinf(x) (float)sin((double)(x)) -#endif -#ifndef HAVE_COSF -#define cosf(x) (float)cos((double)(x)) -#endif -#ifndef HAVE_SQRTF -#define sqrtf(x) (float)sqrt((double)(x)) -#endif - /* declare for drawing using the different OpenGL versions here so we can have a nice code order below */ #ifndef GL_ES_VERSION_2_0 @@ -987,8 +976,8 @@ static void fghCircleTable(GLfloat **sint, GLfloat **cost, const int n, const GL for (i=1; i 0 ) ? stacks : 1 ); /* Scaling factors for vertex normals */ - const GLfloat cosn = ( (GLfloat)height / sqrtf( height * height + base * base )); - const GLfloat sinn = ( (GLfloat)base / sqrtf( height * height + base * base )); + const GLfloat cosn = (GLfloat) (height / sqrt( height * height + base * base )); + const GLfloat sinn = (GLfloat) (base / sqrt( height * height + base * base )); -- 1.7.10.4