[x265] [PATCH] Fix for Issue #373
Aruna Matheswaran
aruna at multicorewareinc.com
Mon Sep 9 15:22:52 CEST 2019
Pushed to Release_3.1 and grafted the fix to default.
On Fri, Aug 2, 2019 at 2:49 AM Nomis101 🐝 <Nomis101 at web.de> wrote:
> This is cherry-picked from "Update json11 to v1.0.0 release" and just
> fixes Issue #373. I checked that it builds on macOS Mojave with hdr10plus
> enabled.
> Find patch attached.
>
>
>
>
>
>
> # HG changeset patch
> # User Nomis101 <Nomis101 at web.de>
> # Date 1564692921 -7200
> # Do Aug 01 22:55:21 2019 +0200
> # Node ID 28e4787b2a438200da0ff38d4d171d14fb6b82fc
> # Parent 459d3822c608948d9c15322b770f7f9b7e2a233e
> fix Issue #373
>
> diff -r 459d3822c608 -r 28e4787b2a43 source/dynamicHDR10/json11/json11.cpp
> --- a/source/dynamicHDR10/json11/json11.cpp Fr Jul 26 10:53:09 2019
> +0530
> +++ b/source/dynamicHDR10/json11/json11.cpp Do Aug 01 22:55:21 2019
> +0200
> @@ -38,21 +38,30 @@ static const int max_depth = 200;
>
> using std::string;
> using std::vector;
> using std::map;
> using std::make_shared;
> using std::initializer_list;
> using std::move;
>
> + /* Helper for representing null - just a do-nothing struct, plus
> comparison
> + * operators so the helpers in JsonValue work. We can't use nullptr_t
> because
> + * it may not be orderable.
> + */
> + struct NullStruct {
> + bool operator==(NullStruct) const { return true; }
> + bool operator<(NullStruct) const { return false; }
> + };
> +
> /* * * * * * * * * * * * * * * * * * * *
> * Serialization
> */
>
> -static void dump(std::nullptr_t, string &out) {
> +static void dump(NullStruct, string &out) {
> out += "null";
> }
>
> static void dump(double value, string &out) {
> if (std::isfinite(value)) {
> char buf[32];
> snprintf(buf, sizeof buf, "%.17g", value);
> out += buf;
> @@ -209,19 +218,19 @@ public:
> class JsonObject final : public Value<Json::OBJECT, Json::object> {
> const Json::object &object_items() const override { return m_value; }
> const Json & operator[](const string &key) const override;
> public:
> explicit JsonObject(const Json::object &value) : Value(value) {}
> explicit JsonObject(Json::object &&value) : Value(move(value)) {}
> };
>
> -class JsonNull final : public Value<Json::NUL, std::nullptr_t> {
> +class JsonNull final : public Value<Json::NUL, NullStruct> {
> public:
> - JsonNull() : Value(nullptr) {}
> + JsonNull() : Value({}) {}
> };
>
> /* * * * * * * * * * * * * * * * * * * *
> * Static globals - static-init-safe
> */
> struct Statics {
> const std::shared_ptr<JsonValue> null = make_shared<JsonNull>();
> const std::shared_ptr<JsonValue> t = make_shared<JsonBoolean>(true);
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
--
Regards,
Aruna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20190909/0b807b66/attachment.html>
More information about the x265-devel
mailing list