Removed SDL_round() because the license wasn't compatible with zlib
authorSam Lantinga <slouken@libsdl.org>
Sun, 17 Aug 2014 13:11:55 -0700
changeset 90802e4e71ec140f
parent 9079 373df87521e5
child 9081 39eb61ccbc82
Removed SDL_round() because the license wasn't compatible with zlib
CMakeLists.txt
configure
configure.in
include/SDL_config.h.cmake
include/SDL_config.h.in
include/SDL_config_android.h
include/SDL_config_iphoneos.h
include/SDL_config_macosx.h
include/SDL_config_pandora.h
include/SDL_config_psp.h
include/SDL_config_windows.h
include/SDL_config_winrt.h
include/SDL_config_wiz.h
include/SDL_stdinc.h
src/dynapi/SDL_dynapi_overrides.h
src/dynapi/SDL_dynapi_procs.h
src/libm/math_libm.h
src/libm/math_private.h
src/stdlib/SDL_stdlib.c
src/video/SDL_surface.c
     1.1 --- a/CMakeLists.txt	Sun Aug 17 10:10:41 2014 -0700
     1.2 +++ b/CMakeLists.txt	Sun Aug 17 13:11:55 2014 -0700
     1.3 @@ -496,7 +496,7 @@
     1.4              strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
     1.5              _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
     1.6              _stricmp _strnicmp sscanf atan atan2 acos asin ceil copysign cos
     1.7 -            cosf fabs floor log pow round scalbn sin sinf sqrt sqrtf tan tanf)
     1.8 +            cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf)
     1.9        string(TOUPPER ${_FN} _UPPER)
    1.10        set(HAVE_${_UPPER} 1)
    1.11      endforeach()
    1.12 @@ -542,7 +542,7 @@
    1.13      if(HAVE_LIBM)
    1.14        set(CMAKE_REQUIRED_LIBRARIES m)
    1.15        foreach(_FN
    1.16 -              atan atan2 ceil copysign cos cosf fabs floor log pow round scalbn sin
    1.17 +              atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin
    1.18                sinf sqrt sqrtf tan tanf)
    1.19          string(TOUPPER ${_FN} _UPPER)
    1.20          set(_HAVEVAR "HAVE_${_UPPER}")
     2.1 --- a/configure	Sun Aug 17 10:10:41 2014 -0700
     2.2 +++ b/configure	Sun Aug 17 13:11:55 2014 -0700
     2.3 @@ -16641,7 +16641,7 @@
     2.4    LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"
     2.5  fi
     2.6  
     2.7 -    for ac_func in atan atan2 acos asin ceil copysign cos cosf fabs floor log pow round scalbn sin sinf sqrt sqrtf tan tanf
     2.8 +    for ac_func in atan atan2 acos asin ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf
     2.9  do :
    2.10    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
    2.11  ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
     3.1 --- a/configure.in	Sun Aug 17 10:10:41 2014 -0700
     3.2 +++ b/configure.in	Sun Aug 17 13:11:55 2014 -0700
     3.3 @@ -271,7 +271,7 @@
     3.4      AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname)
     3.5  
     3.6      AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
     3.7 -    AC_CHECK_FUNCS(atan atan2 acos asin ceil copysign cos cosf fabs floor log pow round scalbn sin sinf sqrt sqrtf tan tanf)
     3.8 +    AC_CHECK_FUNCS(atan atan2 acos asin ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf)
     3.9  
    3.10      AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
    3.11      AC_CHECK_FUNCS(iconv)
     4.1 --- a/include/SDL_config.h.cmake	Sun Aug 17 10:10:41 2014 -0700
     4.2 +++ b/include/SDL_config.h.cmake	Sun Aug 17 13:11:55 2014 -0700
     4.3 @@ -140,7 +140,6 @@
     4.4  #cmakedefine HAVE_FLOOR 1
     4.5  #cmakedefine HAVE_LOG 1
     4.6  #cmakedefine HAVE_POW 1
     4.7 -#cmakedefine HAVE_ROUND 1
     4.8  #cmakedefine HAVE_SCALBN 1
     4.9  #cmakedefine HAVE_SIN 1
    4.10  #cmakedefine HAVE_SINF 1
     5.1 --- a/include/SDL_config.h.in	Sun Aug 17 10:10:41 2014 -0700
     5.2 +++ b/include/SDL_config.h.in	Sun Aug 17 13:11:55 2014 -0700
     5.3 @@ -150,7 +150,6 @@
     5.4  #undef HAVE_FLOOR
     5.5  #undef HAVE_LOG
     5.6  #undef HAVE_POW
     5.7 -#undef HAVE_ROUND
     5.8  #undef HAVE_SCALBN
     5.9  #undef HAVE_SIN
    5.10  #undef HAVE_SINF
     6.1 --- a/include/SDL_config_android.h	Sun Aug 17 10:10:41 2014 -0700
     6.2 +++ b/include/SDL_config_android.h	Sun Aug 17 13:11:55 2014 -0700
     6.3 @@ -96,7 +96,6 @@
     6.4  #define HAVE_FLOOR  1
     6.5  #define HAVE_LOG    1
     6.6  #define HAVE_POW    1
     6.7 -#define HAVE_ROUND  1
     6.8  #define HAVE_SCALBN 1
     6.9  #define HAVE_SIN    1
    6.10  #define HAVE_SINF   1
     7.1 --- a/include/SDL_config_iphoneos.h	Sun Aug 17 10:10:41 2014 -0700
     7.2 +++ b/include/SDL_config_iphoneos.h	Sun Aug 17 13:11:55 2014 -0700
     7.3 @@ -94,7 +94,6 @@
     7.4  #define HAVE_FLOOR  1
     7.5  #define HAVE_LOG    1
     7.6  #define HAVE_POW    1
     7.7 -#define HAVE_ROUND  1
     7.8  #define HAVE_SCALBN 1
     7.9  #define HAVE_SIN    1
    7.10  #define HAVE_SINF   1
     8.1 --- a/include/SDL_config_macosx.h	Sun Aug 17 10:10:41 2014 -0700
     8.2 +++ b/include/SDL_config_macosx.h	Sun Aug 17 13:11:55 2014 -0700
     8.3 @@ -92,7 +92,6 @@
     8.4  #define HAVE_FLOOR  1
     8.5  #define HAVE_LOG    1
     8.6  #define HAVE_POW    1
     8.7 -#define HAVE_ROUND  1
     8.8  #define HAVE_SCALBN 1
     8.9  #define HAVE_SIN    1
    8.10  #define HAVE_SINF   1
     9.1 --- a/include/SDL_config_pandora.h	Sun Aug 17 10:10:41 2014 -0700
     9.2 +++ b/include/SDL_config_pandora.h	Sun Aug 17 13:11:55 2014 -0700
     9.3 @@ -91,7 +91,6 @@
     9.4  #define HAVE_FABS 1
     9.5  #define HAVE_FLOOR 1
     9.6  #define HAVE_LOG 1
     9.7 -#define HAVE_ROUND  1
     9.8  #define HAVE_SCALBN 1
     9.9  #define HAVE_SIN 1
    9.10  #define HAVE_SINF 1
    10.1 --- a/include/SDL_config_psp.h	Sun Aug 17 10:10:41 2014 -0700
    10.2 +++ b/include/SDL_config_psp.h	Sun Aug 17 13:11:55 2014 -0700
    10.3 @@ -94,7 +94,6 @@
    10.4  #define HAVE_FLOOR  1
    10.5  #define HAVE_LOG    1
    10.6  #define HAVE_POW    1
    10.7 -#define HAVE_ROUND  1
    10.8  #define HAVE_SCALBN 1
    10.9  #define HAVE_SIN    1
   10.10  #define HAVE_SINF   1
    11.1 --- a/include/SDL_config_windows.h	Sun Aug 17 10:10:41 2014 -0700
    11.2 +++ b/include/SDL_config_windows.h	Sun Aug 17 13:11:55 2014 -0700
    11.3 @@ -133,7 +133,6 @@
    11.4  #define HAVE_FLOOR 1
    11.5  #define HAVE_LOG 1
    11.6  #define HAVE_POW 1
    11.7 -#define HAVE_ROUND  1
    11.8  #define HAVE_SIN 1
    11.9  #define HAVE_SINF 1
   11.10  #define HAVE_SQRT 1
    12.1 --- a/include/SDL_config_winrt.h	Sun Aug 17 10:10:41 2014 -0700
    12.2 +++ b/include/SDL_config_winrt.h	Sun Aug 17 13:11:55 2014 -0700
    12.3 @@ -135,7 +135,6 @@
    12.4  #define HAVE_FLOOR 1
    12.5  #define HAVE_LOG 1
    12.6  #define HAVE_POW 1
    12.7 -#define HAVE_ROUND 1
    12.8  //#define HAVE_SCALBN 1
    12.9  #define HAVE__SCALB 1
   12.10  #define HAVE_SIN 1
    13.1 --- a/include/SDL_config_wiz.h	Sun Aug 17 10:10:41 2014 -0700
    13.2 +++ b/include/SDL_config_wiz.h	Sun Aug 17 13:11:55 2014 -0700
    13.3 @@ -85,7 +85,6 @@
    13.4  #define HAVE_FABS 1
    13.5  #define HAVE_FLOOR 1
    13.6  #define HAVE_LOG 1
    13.7 -#define HAVE_ROUND 1
    13.8  #define HAVE_SCALBN 1
    13.9  #define HAVE_SIN 1
   13.10  #define HAVE_SINF 1
    14.1 --- a/include/SDL_stdinc.h	Sun Aug 17 10:10:41 2014 -0700
    14.2 +++ b/include/SDL_stdinc.h	Sun Aug 17 13:11:55 2014 -0700
    14.3 @@ -428,7 +428,6 @@
    14.4  extern DECLSPEC double SDLCALL SDL_floor(double x);
    14.5  extern DECLSPEC double SDLCALL SDL_log(double x);
    14.6  extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
    14.7 -extern DECLSPEC double SDLCALL SDL_round(double x);
    14.8  extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
    14.9  extern DECLSPEC double SDLCALL SDL_sin(double x);
   14.10  extern DECLSPEC float SDLCALL SDL_sinf(float x);
    15.1 --- a/src/dynapi/SDL_dynapi_overrides.h	Sun Aug 17 10:10:41 2014 -0700
    15.2 +++ b/src/dynapi/SDL_dynapi_overrides.h	Sun Aug 17 13:11:55 2014 -0700
    15.3 @@ -591,4 +591,3 @@
    15.4  #define SDL_QueueAudio SDL_QueueAudio_REAL
    15.5  #define SDL_GetQueuedAudioSize SDL_GetQueuedAudioSize_REAL
    15.6  #define SDL_ClearQueuedAudio SDL_ClearQueuedAudio_REAL
    15.7 -#define SDL_round SDL_round_REAL
    16.1 --- a/src/dynapi/SDL_dynapi_procs.h	Sun Aug 17 10:10:41 2014 -0700
    16.2 +++ b/src/dynapi/SDL_dynapi_procs.h	Sun Aug 17 13:11:55 2014 -0700
    16.3 @@ -623,4 +623,3 @@
    16.4  SDL_DYNAPI_PROC(int,SDL_QueueAudio,(SDL_AudioDeviceID a, const void *b, Uint32 c),(a,b,c),return)
    16.5  SDL_DYNAPI_PROC(Uint32,SDL_GetQueuedAudioSize,(SDL_AudioDeviceID a),(a),return)
    16.6  SDL_DYNAPI_PROC(void,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),)
    16.7 -SDL_DYNAPI_PROC(double,SDL_round,(double a),(a),return)
    17.1 --- a/src/libm/math_libm.h	Sun Aug 17 10:10:41 2014 -0700
    17.2 +++ b/src/libm/math_libm.h	Sun Aug 17 13:11:55 2014 -0700
    17.3 @@ -30,7 +30,6 @@
    17.4  double SDL_uclibc_floor(double x);
    17.5  double SDL_uclibc_log(double x);
    17.6  double SDL_uclibc_pow(double x, double y);    
    17.7 -double SDL_uclibc_round(double x);
    17.8  double SDL_uclibc_scalbn(double x, int n);
    17.9  double SDL_uclibc_sin(double x);
   17.10  double SDL_uclibc_sqrt(double x);
    18.1 --- a/src/libm/math_private.h	Sun Aug 17 10:10:41 2014 -0700
    18.2 +++ b/src/libm/math_private.h	Sun Aug 17 13:11:55 2014 -0700
    18.3 @@ -37,7 +37,6 @@
    18.4  #define floor           SDL_uclibc_floor
    18.5  #define __ieee754_log   SDL_uclibc_log
    18.6  #define __ieee754_pow   SDL_uclibc_pow
    18.7 -#define round           SDL_uclibc_round
    18.8  #define scalbn          SDL_uclibc_scalbn
    18.9  #define sin             SDL_uclibc_sin
   18.10  #define __ieee754_sqrt  SDL_uclibc_sqrt
    19.1 --- a/src/stdlib/SDL_stdlib.c	Sun Aug 17 10:10:41 2014 -0700
    19.2 +++ b/src/stdlib/SDL_stdlib.c	Sun Aug 17 13:11:55 2014 -0700
    19.3 @@ -170,16 +170,6 @@
    19.4  }
    19.5  
    19.6  double
    19.7 -SDL_round(double x)
    19.8 -{
    19.9 -#if defined(HAVE_ROUND)
   19.10 -    return round(x);
   19.11 -#else
   19.12 -    return SDL_uclibc_round(x);
   19.13 -#endif /* HAVE_ROUND */
   19.14 -}
   19.15 -
   19.16 -double
   19.17  SDL_scalbn(double x, int n)
   19.18  {
   19.19  #if defined(HAVE_SCALBN)
    20.1 --- a/src/video/SDL_surface.c	Sun Aug 17 10:10:41 2014 -0700
    20.2 +++ b/src/video/SDL_surface.c	Sun Aug 17 13:11:55 2014 -0700
    20.3 @@ -741,15 +741,15 @@
    20.4      dst_y0 += dst->clip_rect.y;
    20.5      dst_y1 += dst->clip_rect.y;
    20.6  
    20.7 -    final_src.x = SDL_round(src_x0);
    20.8 -    final_src.y = SDL_round(src_y0);
    20.9 -    final_src.w = SDL_round(src_x1 - src_x0 + 1);
   20.10 -    final_src.h = SDL_round(src_y1 - src_y0 + 1);
   20.11 +    final_src.x = SDL_floor(src_x0 + 0.5);
   20.12 +    final_src.y = SDL_floor(src_y0 + 0.5);
   20.13 +    final_src.w = SDL_floor(src_x1 - src_x0 + 1.5);
   20.14 +    final_src.h = SDL_floor(src_y1 - src_y0 + 1.5);
   20.15  
   20.16 -    final_dst.x = SDL_round(dst_x0);
   20.17 -    final_dst.y = SDL_round(dst_y0);
   20.18 -    final_dst.w = SDL_round(dst_x1 - dst_x0 + 1);
   20.19 -    final_dst.h = SDL_round(dst_y1 - dst_y0 + 1);
   20.20 +    final_dst.x = SDL_floor(dst_x0 + 0.5);
   20.21 +    final_dst.y = SDL_floor(dst_y0 + 0.5);
   20.22 +    final_dst.w = SDL_floor(dst_x1 - dst_x0 + 1.5);
   20.23 +    final_dst.h = SDL_floor(dst_y1 - dst_y0 + 1.5);
   20.24  
   20.25      if (final_dst.w < 0)
   20.26          final_dst.w = 0;