src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc
changeset 48274 51772bf1fb0c
parent 47216 71c04702a3d5
child 50352 25db2c8f3cf8
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc	Tue Dec 05 11:04:42 2017 -0800
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc	Thu Dec 07 11:55:06 2017 -0800
@@ -30,6 +30,7 @@
 #endif
 
 #include "hb-private.hh"
+#include "hb-debug.hh"
 
 #include "hb-object-private.hh"
 
@@ -44,12 +45,6 @@
 #include <errno.h>
 
 
-
-#ifndef HB_DEBUG_BLOB
-#define HB_DEBUG_BLOB (HB_DEBUG+0)
-#endif
-
-
 struct hb_blob_t {
   hb_object_header_t header;
   ASSERT_POD ();
@@ -72,8 +67,8 @@
 {
   if (blob->destroy) {
     blob->destroy (blob->user_data);
-    blob->user_data = NULL;
-    blob->destroy = NULL;
+    blob->user_data = nullptr;
+    blob->destroy = nullptr;
   }
 }
 
@@ -128,6 +123,12 @@
   return blob;
 }
 
+static void
+_hb_blob_destroy (void *data)
+{
+  hb_blob_destroy ((hb_blob_t *) data);
+}
+
 /**
  * hb_blob_create_sub_blob:
  * @parent: Parent blob.
@@ -164,7 +165,7 @@
                          MIN (length, parent->length - offset),
                          HB_MEMORY_MODE_READONLY,
                          hb_blob_reference (parent),
-                         (hb_destroy_func_t) hb_blob_destroy);
+                         _hb_blob_destroy);
 
   return blob;
 }
@@ -188,12 +189,12 @@
 
     true, /* immutable */
 
-    NULL, /* data */
+    nullptr, /* data */
     0, /* length */
     HB_MEMORY_MODE_READONLY, /* mode */
 
-    NULL, /* user_data */
-    NULL  /* destroy */
+    nullptr, /* user_data */
+    nullptr  /* destroy */
   };
 
   return const_cast<hb_blob_t *> (&_hb_blob_nil);
@@ -247,7 +248,7 @@
  * @destroy: callback to call when @data is not needed anymore.
  * @replace: whether to replace an existing data with the same key.
  *
- * Return value: 
+ * Return value:
  *
  * Since: 0.9.2
  **/
@@ -266,9 +267,9 @@
  * @blob: a blob.
  * @key: key for data to get.
  *
- * 
+ *
  *
- * Return value: (transfer none): 
+ * Return value: (transfer none):
  *
  * Since: 0.9.2
  **/
@@ -284,7 +285,7 @@
  * hb_blob_make_immutable:
  * @blob: a blob.
  *
- * 
+ *
  *
  * Since: 0.9.2
  **/
@@ -301,7 +302,7 @@
  * hb_blob_is_immutable:
  * @blob: a blob.
  *
- * 
+ *
  *
  * Return value: TODO
  *
@@ -318,7 +319,7 @@
  * hb_blob_get_length:
  * @blob: a blob.
  *
- * 
+ *
  *
  * Return value: the length of blob data in bytes.
  *
@@ -335,9 +336,9 @@
  * @blob: a blob.
  * @length: (out):
  *
- * 
+ *
  *
- * Returns: (transfer none) (array length=length): 
+ * Returns: (transfer none) (array length=length):
  *
  * Since: 0.9.2
  **/
@@ -373,7 +374,7 @@
     if (length)
       *length = 0;
 
-    return NULL;
+    return nullptr;
   }
 
   if (length)