From 7605ccf68ac8c8004cb9fd01ea8436d369db26f2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 5 Jan 2016 02:29:16 -0500 Subject: [PATCH] Use SDL's stdinc functions instead of C runtime calls. --- src/haptic/linux/SDL_syshaptic.c | 2 +- src/video/x11/SDL_x11modes.c | 2 +- src/video/x11/edid-parse.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index e8d785535..4918d1266 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -690,7 +690,7 @@ SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection * src) else if (!src->dir[0]) *dest = (src->dir[1] >= 0 ? 0x8000 : 0); else { - float f = atan2(src->dir[1], src->dir[0]); /* Ideally we'd use fixed point math instead of floats... */ + float f = SDL_atan2(src->dir[1], src->dir[0]); /* Ideally we'd use fixed point math instead of floats... */ /* atan2 takes the parameters: Y-axis-value and X-axis-value (in that order) - Y-axis-value is the second coordinate (from center to SOUTH) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 59225ab7a..ec282fade 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -342,7 +342,7 @@ SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen, X11_XFree(props); } - inches = (int)((SDL_sqrt(widthmm * widthmm + heightmm * heightmm) / 25.4f) + 0.5f); + inches = (int)((SDL_sqrtf(widthmm * widthmm + heightmm * heightmm) / 25.4f) + 0.5f); if (*name && inches) { const size_t len = SDL_strlen(name); SDL_snprintf(&name[len], namelen-len, " %d\"", inches); diff --git a/src/video/x11/edid-parse.c b/src/video/x11/edid-parse.c index 2c145e23c..57f225b85 100644 --- a/src/video/x11/edid-parse.c +++ b/src/video/x11/edid-parse.c @@ -21,6 +21,8 @@ */ /* Author: Soren Sandmann */ +#include "../../SDL_internal.h" +#include "SDL_stdinc.h" #include "edid.h" #include @@ -247,7 +249,7 @@ decode_fraction (int high, int low) high = (high << 2) | low; for (i = 0; i < 10; ++i) - result += get_bit (high, i) * pow (2, i - 10); + result += get_bit (high, i) * SDL_pow (2, i - 10); return result; }