summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-07-06 02:00:27 +0300
committerOleg Oshmyan <chortos@inbox.lv>2020-07-12 20:10:07 +0300
commit684288f32f2ecbb4ae648fc6b6df942603ec8629 (patch)
treec97f9d90cdceb7d8aac8b1d496b3be433f440337
parent9f35fa95ab974c3ca5f0295b8d9094e5dffef285 (diff)
downloadlibass-684288f32f2ecbb4ae648fc6b6df942603ec8629.tar.bz2
libass-684288f32f2ecbb4ae648fc6b6df942603ec8629.tar.xz
shaper: drop prealloc parameter of ass_shaper_new
The only prealloc value actually used is 0, which is not useful and invokes implementation-defined (and potentially obsolescent as per C11 DR400) behavior.
-rw-r--r--libass/ass_render.c2
-rw-r--r--libass/ass_shaper.c7
-rw-r--r--libass/ass_shaper.h2
3 files changed, 4 insertions, 7 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 40ee3d1..7bc9554 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -108,7 +108,7 @@ ASS_Renderer *ass_renderer_init(ASS_Library *library)
priv->settings.font_size_coeff = 1.;
priv->settings.selective_style_overrides = ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;
- if (!(priv->shaper = ass_shaper_new(0)))
+ if (!(priv->shaper = ass_shaper_new()))
goto fail;
ass_shaper_info(library);
diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c
index 80e78aa..171704b 100644
--- a/libass/ass_shaper.c
+++ b/libass/ass_shaper.c
@@ -947,18 +947,15 @@ int ass_shaper_shape(ASS_Shaper *shaper, TextInfo *text_info)
}
/**
- * \brief Create a new shaper instance and preallocate data structures
- * \param prealloc preallocation size
+ * \brief Create a new shaper instance
*/
-ASS_Shaper *ass_shaper_new(size_t prealloc)
+ASS_Shaper *ass_shaper_new(void)
{
ASS_Shaper *shaper = calloc(sizeof(*shaper), 1);
if (!shaper)
return NULL;
shaper->base_direction = FRIBIDI_PAR_ON;
- if (!check_allocations(shaper, prealloc))
- goto error;
#ifdef CONFIG_HARFBUZZ
if (!init_features(shaper))
diff --git a/libass/ass_shaper.h b/libass/ass_shaper.h
index f6404fe..5001fc7 100644
--- a/libass/ass_shaper.h
+++ b/libass/ass_shaper.h
@@ -25,7 +25,7 @@ typedef struct ass_shaper ASS_Shaper;
#include "ass_render.h"
void ass_shaper_info(ASS_Library *lib);
-ASS_Shaper *ass_shaper_new(size_t prealloc);
+ASS_Shaper *ass_shaper_new(void);
void ass_shaper_free(ASS_Shaper *shaper);
void ass_shaper_empty_cache(ASS_Shaper *shaper);
void ass_shaper_set_kerning(ASS_Shaper *shaper, int kern);