< prev index next >
src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc
Print this page
*** 28,37 ****
--- 28,38 ----
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199309L
#endif
#include "hb-private.hh"
+ #include "hb-debug.hh"
#include "hb-object-private.hh"
#ifdef HAVE_SYS_MMAN_H
#ifdef HAVE_UNISTD_H
*** 42,57 ****
#include <stdio.h>
#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 ();
bool immutable;
--- 43,52 ----
*** 70,81 ****
static void
_hb_blob_destroy_user_data (hb_blob_t *blob)
{
if (blob->destroy) {
blob->destroy (blob->user_data);
! blob->user_data = NULL;
! blob->destroy = NULL;
}
}
/**
* hb_blob_create: (skip)
--- 65,76 ----
static void
_hb_blob_destroy_user_data (hb_blob_t *blob)
{
if (blob->destroy) {
blob->destroy (blob->user_data);
! blob->user_data = nullptr;
! blob->destroy = nullptr;
}
}
/**
* hb_blob_create: (skip)
*** 126,135 ****
--- 121,136 ----
}
return blob;
}
+ static void
+ _hb_blob_destroy (void *data)
+ {
+ hb_blob_destroy ((hb_blob_t *) data);
+ }
+
/**
* hb_blob_create_sub_blob:
* @parent: Parent blob.
* @offset: Start offset of sub-blob within @parent, in bytes.
* @length: Length of sub-blob.
*** 162,172 ****
blob = hb_blob_create (parent->data + offset,
MIN (length, parent->length - offset),
HB_MEMORY_MODE_READONLY,
hb_blob_reference (parent),
! (hb_destroy_func_t) hb_blob_destroy);
return blob;
}
/**
--- 163,173 ----
blob = hb_blob_create (parent->data + offset,
MIN (length, parent->length - offset),
HB_MEMORY_MODE_READONLY,
hb_blob_reference (parent),
! _hb_blob_destroy);
return blob;
}
/**
*** 186,201 ****
static const hb_blob_t _hb_blob_nil = {
HB_OBJECT_HEADER_STATIC,
true, /* immutable */
! NULL, /* data */
0, /* length */
HB_MEMORY_MODE_READONLY, /* mode */
! NULL, /* user_data */
! NULL /* destroy */
};
return const_cast<hb_blob_t *> (&_hb_blob_nil);
}
--- 187,202 ----
static const hb_blob_t _hb_blob_nil = {
HB_OBJECT_HEADER_STATIC,
true, /* immutable */
! nullptr, /* data */
0, /* length */
HB_MEMORY_MODE_READONLY, /* mode */
! nullptr, /* user_data */
! nullptr /* destroy */
};
return const_cast<hb_blob_t *> (&_hb_blob_nil);
}
*** 371,381 ****
{
if (!_try_writable (blob)) {
if (length)
*length = 0;
! return NULL;
}
if (length)
*length = blob->length;
--- 372,382 ----
{
if (!_try_writable (blob)) {
if (length)
*length = 0;
! return nullptr;
}
if (length)
*length = blob->length;
< prev index next >