[buffer] Make API take signed int length

Since we already switched to accepting -1 as 'zero-terminated'.
This commit is contained in:
Behdad Esfahbod 2011-08-09 00:23:58 +02:00
parent de1e1cf9bc
commit 944b2ba1ce
4 changed files with 12 additions and 15 deletions

View File

@ -776,9 +776,9 @@ hb_utf8_next (const uint8_t *text,
void void
hb_buffer_add_utf8 (hb_buffer_t *buffer, hb_buffer_add_utf8 (hb_buffer_t *buffer,
const char *text, const char *text,
unsigned int text_length HB_UNUSED, int text_length,
unsigned int item_offset, unsigned int item_offset,
unsigned int item_length) int item_length)
{ {
#define UTF_NEXT(S, E, U) hb_utf8_next (S, E, &(U)) #define UTF_NEXT(S, E, U) hb_utf8_next (S, E, &(U))
ADD_UTF (uint8_t); ADD_UTF (uint8_t);
@ -810,9 +810,9 @@ hb_utf16_next (const uint16_t *text,
void void
hb_buffer_add_utf16 (hb_buffer_t *buffer, hb_buffer_add_utf16 (hb_buffer_t *buffer,
const uint16_t *text, const uint16_t *text,
unsigned int text_length HB_UNUSED, int text_length,
unsigned int item_offset, unsigned int item_offset,
unsigned int item_length) int item_length)
{ {
#define UTF_NEXT(S, E, U) hb_utf16_next (S, E, &(U)) #define UTF_NEXT(S, E, U) hb_utf16_next (S, E, &(U))
ADD_UTF (uint16_t); ADD_UTF (uint16_t);
@ -822,9 +822,9 @@ hb_buffer_add_utf16 (hb_buffer_t *buffer,
void void
hb_buffer_add_utf32 (hb_buffer_t *buffer, hb_buffer_add_utf32 (hb_buffer_t *buffer,
const uint32_t *text, const uint32_t *text,
unsigned int text_length HB_UNUSED, int text_length,
unsigned int item_offset, unsigned int item_offset,
unsigned int item_length) int item_length)
{ {
#define UTF_NEXT(S, E, U) ((U) = *(S), (S)+1) #define UTF_NEXT(S, E, U) ((U) = *(S), (S)+1)
ADD_UTF (uint32_t); ADD_UTF (uint32_t);

View File

@ -147,23 +147,23 @@ hb_buffer_add (hb_buffer_t *buffer,
void void
hb_buffer_add_utf8 (hb_buffer_t *buffer, hb_buffer_add_utf8 (hb_buffer_t *buffer,
const char *text, const char *text,
unsigned int text_length, int text_length,
unsigned int item_offset, unsigned int item_offset,
unsigned int item_length); int item_length);
void void
hb_buffer_add_utf16 (hb_buffer_t *buffer, hb_buffer_add_utf16 (hb_buffer_t *buffer,
const uint16_t *text, const uint16_t *text,
unsigned int text_length, int text_length,
unsigned int item_offset, unsigned int item_offset,
unsigned int item_length); int item_length);
void void
hb_buffer_add_utf32 (hb_buffer_t *buffer, hb_buffer_add_utf32 (hb_buffer_t *buffer,
const uint32_t *text, const uint32_t *text,
unsigned int text_length, int text_length,
unsigned int item_offset, unsigned int item_offset,
unsigned int item_length); int item_length);
/* Clears any new items added at the end */ /* Clears any new items added at the end */

View File

@ -26,8 +26,6 @@
* Red Hat Author(s): Behdad Esfahbod * Red Hat Author(s): Behdad Esfahbod
*/ */
#define HB_OT_LAYOUT_CC
#include "hb-ot-layout-private.hh" #include "hb-ot-layout-private.hh"
#include "hb-ot-layout-gdef-private.hh" #include "hb-ot-layout-gdef-private.hh"

View File

@ -24,7 +24,6 @@
* Red Hat Author(s): Behdad Esfahbod * Red Hat Author(s): Behdad Esfahbod
*/ */
#define HB_OT_LAYOUT_CC
#include "hb-mutex-private.hh" #include "hb-mutex-private.hh"
#include "hb-open-file-private.hh" #include "hb-open-file-private.hh"
#include "hb-ot-layout-gdef-private.hh" #include "hb-ot-layout-gdef-private.hh"