From 6afd5d5a83bd53f95f9c43d627653c03b95bd2ac Mon Sep 17 00:00:00 2001 From: dcnieho 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: https://svn.code.sf.net/p/freeglut/code/trunk@1319 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/CMakeLists.txt | 3 --- freeglut/freeglut/config.h.in | 3 --- freeglut/freeglut/src/fg_geometry.c | 19 ++++--------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/freeglut/freeglut/CMakeLists.txt b/freeglut/freeglut/CMakeLists.txt index 2277d70..f2e2c1e 100644 --- a/freeglut/freeglut/CMakeLists.txt +++ b/freeglut/freeglut/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/freeglut/freeglut/config.h.in b/freeglut/freeglut/config.h.in index 8d7f60d..823ff07 100644 --- a/freeglut/freeglut/config.h.in +++ b/freeglut/freeglut/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/freeglut/freeglut/src/fg_geometry.c b/freeglut/freeglut/src/fg_geometry.c index f4f5056..57301a0 100644 --- a/freeglut/freeglut/src/fg_geometry.c +++ b/freeglut/freeglut/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 ));