提交 5846884f 编写于 作者: B Bruce Mitchener 提交者: Ebrahim Byagowi

test: Use nullptr in C++ code. (#1744)

上级 7c14b901
......@@ -133,7 +133,7 @@ layered_glyph_dump (hb_face_t *face, cairo_font_face_t *cairo_face, unsigned int
unsigned glyph_count = hb_face_get_glyph_count (face);
for (hb_codepoint_t gid = 0; gid < glyph_count; ++gid)
{
unsigned int num_layers = hb_ot_color_glyph_get_layers (face, gid, 0, NULL, NULL);
unsigned int num_layers = hb_ot_color_glyph_get_layers (face, gid, 0, nullptr, nullptr);
if (!num_layers)
continue;
......@@ -169,7 +169,7 @@ layered_glyph_dump (hb_face_t *face, cairo_font_face_t *cairo_face, unsigned int
unsigned int palette_count = hb_ot_color_palette_get_count (face);
for (unsigned int palette = 0; palette < palette_count; palette++)
{
unsigned int num_colors = hb_ot_color_palette_get_colors (face, palette, 0, NULL, NULL);
unsigned int num_colors = hb_ot_color_palette_get_colors (face, palette, 0, nullptr, nullptr);
if (!num_colors)
continue;
......@@ -271,14 +271,14 @@ main (int argc, char **argv)
FILE *font_name_file = fopen ("out/.dumped_font_name", "r");
if (font_name_file != NULL)
if (font_name_file != nullptr)
{
fprintf (stderr, "Purge or move ./out folder in order to run a new dump\n");
exit (1);
}
font_name_file = fopen ("out/.dumped_font_name", "w");
if (font_name_file == NULL)
if (font_name_file == nullptr)
{
fprintf (stderr, "./out is not accessible as a folder, create it please\n");
exit (1);
......
......@@ -10,7 +10,7 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
hb_blob_t *blob = hb_blob_create ((const char *)data, size,
HB_MEMORY_MODE_READONLY, NULL, NULL);
HB_MEMORY_MODE_READONLY, nullptr, nullptr);
hb_face_t *face = hb_face_create (blob, 0);
hb_font_t *font = hb_font_create (face);
hb_ot_font_set_funcs (font);
......@@ -21,7 +21,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
hb_buffer_t *buffer = hb_buffer_create ();
hb_buffer_add_utf8 (buffer, text, -1, 0, -1);
hb_buffer_guess_segment_properties (buffer);
hb_shape (font, buffer, NULL, 0);
hb_shape (font, buffer, nullptr, 0);
hb_buffer_destroy (buffer);
}
......@@ -34,7 +34,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
hb_buffer_t *buffer = hb_buffer_create ();
hb_buffer_add_utf32 (buffer, text32, sizeof (text32) / sizeof (text32[0]), 0, -1);
hb_buffer_guess_segment_properties (buffer);
hb_shape (font, buffer, NULL, 0);
hb_shape (font, buffer, nullptr, 0);
hb_buffer_destroy (buffer);
/* Misc calls on face. */
......
......@@ -53,7 +53,7 @@ trySubset (hb_face_t *face,
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
hb_blob_t *blob = hb_blob_create ((const char *)data, size,
HB_MEMORY_MODE_READONLY, NULL, NULL);
HB_MEMORY_MODE_READONLY, nullptr, nullptr);
hb_face_t *face = hb_face_create (blob, 0);
/* Just test this API here quickly. */
......
......@@ -115,7 +115,7 @@ parse_drop_tables (const char *name,
else
hb_set_del (drop_tables, tag);
s = strtok(NULL, ", ");
s = strtok(nullptr, ", ");
}
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册