changeset 12495:74a8672ea4f7 draft

Replace bool with int to prevent portability issues
author Pooja Venkatesan <pooja@multicorewareinc.com>
date Wed, 06 Mar 2019 10:36:18 +0530
parents 2abd2a1909a4
children d97a256d46a7
files source/CMakeLists.txt source/encoder/api.cpp source/x265.h
diffstat 3 files changed, 6 insertions(+-), 6 deletions(-) [+]
line wrap: on
line diff
--- a/source/CMakeLists.txt	Tue Mar 05 14:18:21 2019 +0530
+++ b/source/CMakeLists.txt	Wed Mar 06 10:36:18 2019 +0530
@@ -29,7 +29,7 @@ option(NATIVE_BUILD "Target the build CP
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 171)
+set(X265_BUILD 172)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
--- a/source/encoder/api.cpp	Tue Mar 05 14:18:21 2019 +0530
+++ b/source/encoder/api.cpp	Wed Mar 06 10:36:18 2019 +0530
@@ -101,8 +101,8 @@ x265_encoder *x265_encoder_open(x265_par
     if (p->rc.zoneCount || p->rc.zonefileCount)
     {
         int zoneCount = p->rc.zonefileCount ? p->rc.zonefileCount : p->rc.zoneCount;
-        param->rc.zones = x265_zone_alloc(zoneCount, p->rc.zonefileCount ? true : false);
-        latestParam->rc.zones = x265_zone_alloc(zoneCount, p->rc.zonefileCount ? true : false);
+        param->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+        latestParam->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
     }
 
     x265_copy_params(param, p);
@@ -296,7 +296,7 @@ int x265_encoder_reconfig(x265_encoder* 
     if (encoder->m_latestParam->rc.zoneCount || encoder->m_latestParam->rc.zonefileCount)
     {
         int zoneCount = encoder->m_latestParam->rc.zonefileCount ? encoder->m_latestParam->rc.zonefileCount : encoder->m_latestParam->rc.zoneCount;
-        save.rc.zones = x265_zone_alloc(zoneCount, encoder->m_latestParam->rc.zonefileCount ? true : false);
+        save.rc.zones = x265_zone_alloc(zoneCount, !!encoder->m_latestParam->rc.zonefileCount);
     }
     x265_copy_params(&save, encoder->m_latestParam);
     int ret = encoder->reconfigureParam(encoder->m_latestParam, param_in);
@@ -933,7 +933,7 @@ void x265_picture_free(x265_picture *p)
     return x265_free(p);
 }
 
-x265_zone *x265_zone_alloc(int zoneCount, bool isZoneFile)
+x265_zone *x265_zone_alloc(int zoneCount, int isZoneFile)
 {
     x265_zone* zone = (x265_zone*)x265_malloc(sizeof(x265_zone) * zoneCount);
     if (isZoneFile) {
--- a/source/x265.h	Tue Mar 05 14:18:21 2019 +0530
+++ b/source/x265.h	Wed Mar 06 10:36:18 2019 +0530
@@ -1798,7 +1798,7 @@ void x265_param_default(x265_param *para
 #define X265_PARAM_BAD_VALUE (-2)
 int x265_param_parse(x265_param *p, const char *name, const char *value);
 
-x265_zone *x265_zone_alloc(int zoneCount, bool isZoneFile);
+x265_zone *x265_zone_alloc(int zoneCount, int isZoneFile);
 
 void x265_zone_free(x265_param *param);