@@ -91,7 +91,7 @@ UTF8PROC_DLLEXPORT const char *utf8proc_version(void) {
9191 return STRINGIZE (UTF8PROC_VERSION_MAJOR ) "." STRINGIZE (UTF8PROC_VERSION_MINOR ) "." STRINGIZE (UTF8PROC_VERSION_PATCH ) "" ;
9292}
9393
94- UTF8PROC_DLLEXPORT const char * utf8proc_errmsg (ssize_t errcode ) {
94+ UTF8PROC_DLLEXPORT const char * utf8proc_errmsg (utf8proc_ssize_t errcode ) {
9595 switch (errcode ) {
9696 case UTF8PROC_ERROR_NOMEM :
9797 return "Memory for processing UTF-8 data could not be allocated." ;
@@ -108,8 +108,8 @@ UTF8PROC_DLLEXPORT const char *utf8proc_errmsg(ssize_t errcode) {
108108 }
109109}
110110
111- UTF8PROC_DLLEXPORT ssize_t utf8proc_iterate (
112- const uint8_t * str , ssize_t strlen , int32_t * dst
111+ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_iterate (
112+ const uint8_t * str , utf8proc_ssize_t strlen , int32_t * dst
113113) {
114114 int length ;
115115 int i ;
@@ -155,7 +155,7 @@ UTF8PROC_DLLEXPORT bool utf8proc_codepoint_valid(int32_t uc) {
155155 else return true;
156156}
157157
158- UTF8PROC_DLLEXPORT ssize_t utf8proc_encode_char (int32_t uc , uint8_t * dst ) {
158+ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_encode_char (int32_t uc , uint8_t * dst ) {
159159 if (uc < 0x00 ) {
160160 return 0 ;
161161 } else if (uc < 0x80 ) {
@@ -250,7 +250,7 @@ UTF8PROC_DLLEXPORT const char *utf8proc_category_string(int32_t c) {
250250 return utf8proc_decompose_char((replacement_uc), dst, bufsize, \
251251 options & ~UTF8PROC_LUMP, last_boundclass)
252252
253- UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose_char (int32_t uc , int32_t * dst , ssize_t bufsize , utf8proc_option_t options , int * last_boundclass ) {
253+ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char (int32_t uc , int32_t * dst , utf8proc_ssize_t bufsize , utf8proc_option_t options , int * last_boundclass ) {
254254 const utf8proc_property_t * property ;
255255 utf8proc_propval_t category ;
256256 int32_t hangul_sindex ;
@@ -313,7 +313,7 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose_char(int32_t uc, int32_t *dst, ssi
313313 if (options & UTF8PROC_CASEFOLD ) {
314314 if (property -> casefold_mapping ) {
315315 const int32_t * casefold_entry ;
316- ssize_t written = 0 ;
316+ utf8proc_ssize_t written = 0 ;
317317 for (casefold_entry = property -> casefold_mapping ;
318318 * casefold_entry >= 0 ; casefold_entry ++ ) {
319319 written += utf8proc_decompose_char (* casefold_entry , dst + written ,
@@ -328,7 +328,7 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose_char(int32_t uc, int32_t *dst, ssi
328328 if (property -> decomp_mapping &&
329329 (!property -> decomp_type || (options & UTF8PROC_COMPAT ))) {
330330 const int32_t * decomp_entry ;
331- ssize_t written = 0 ;
331+ utf8proc_ssize_t written = 0 ;
332332 for (decomp_entry = property -> decomp_mapping ;
333333 * decomp_entry >= 0 ; decomp_entry ++ ) {
334334 written += utf8proc_decompose_char (* decomp_entry , dst + written ,
@@ -354,21 +354,21 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose_char(int32_t uc, int32_t *dst, ssi
354354 return 1 ;
355355}
356356
357- UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose (
358- const uint8_t * str , ssize_t strlen ,
359- int32_t * buffer , ssize_t bufsize , utf8proc_option_t options
357+ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose (
358+ const uint8_t * str , utf8proc_ssize_t strlen ,
359+ int32_t * buffer , utf8proc_ssize_t bufsize , utf8proc_option_t options
360360) {
361361 /* strlen will be ignored, if UTF8PROC_NULLTERM is set in options */
362- ssize_t wpos = 0 ;
362+ utf8proc_ssize_t wpos = 0 ;
363363 if ((options & UTF8PROC_COMPOSE ) && (options & UTF8PROC_DECOMPOSE ))
364364 return UTF8PROC_ERROR_INVALIDOPTS ;
365365 if ((options & UTF8PROC_STRIPMARK ) &&
366366 !(options & UTF8PROC_COMPOSE ) && !(options & UTF8PROC_DECOMPOSE ))
367367 return UTF8PROC_ERROR_INVALIDOPTS ;
368368 {
369369 int32_t uc ;
370- ssize_t rpos = 0 ;
371- ssize_t decomp_result ;
370+ utf8proc_ssize_t rpos = 0 ;
371+ utf8proc_ssize_t decomp_result ;
372372 int boundclass = UTF8PROC_BOUNDCLASS_START ;
373373 while (1 ) {
374374 if (options & UTF8PROC_NULLTERM ) {
@@ -395,7 +395,7 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose(
395395 }
396396 }
397397 if ((options & (UTF8PROC_COMPOSE |UTF8PROC_DECOMPOSE )) && bufsize >= wpos ) {
398- ssize_t pos = 0 ;
398+ utf8proc_ssize_t pos = 0 ;
399399 while (pos < wpos - 1 ) {
400400 int32_t uc1 , uc2 ;
401401 const utf8proc_property_t * property1 , * property2 ;
@@ -416,12 +416,12 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose(
416416 return wpos ;
417417}
418418
419- UTF8PROC_DLLEXPORT ssize_t utf8proc_reencode (int32_t * buffer , ssize_t length , utf8proc_option_t options ) {
419+ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_reencode (int32_t * buffer , utf8proc_ssize_t length , utf8proc_option_t options ) {
420420 /* UTF8PROC_NULLTERM option will be ignored, 'length' is never ignored
421421 ASSERT: 'buffer' has one spare byte of free space at the end! */
422422 if (options & (UTF8PROC_NLF2LS | UTF8PROC_NLF2PS | UTF8PROC_STRIPCC )) {
423- ssize_t rpos ;
424- ssize_t wpos = 0 ;
423+ utf8proc_ssize_t rpos ;
424+ utf8proc_ssize_t wpos = 0 ;
425425 int32_t uc ;
426426 for (rpos = 0 ; rpos < length ; rpos ++ ) {
427427 uc = buffer [rpos ];
@@ -455,8 +455,8 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, ut
455455 int32_t current_char ;
456456 const utf8proc_property_t * starter_property = NULL , * current_property ;
457457 utf8proc_propval_t max_combining_class = -1 ;
458- ssize_t rpos ;
459- ssize_t wpos = 0 ;
458+ utf8proc_ssize_t rpos ;
459+ utf8proc_ssize_t wpos = 0 ;
460460 int32_t composition ;
461461 for (rpos = 0 ; rpos < length ; rpos ++ ) {
462462 current_char = buffer [rpos ];
@@ -520,7 +520,7 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, ut
520520 length = wpos ;
521521 }
522522 {
523- ssize_t rpos , wpos = 0 ;
523+ utf8proc_ssize_t rpos , wpos = 0 ;
524524 int32_t uc ;
525525 for (rpos = 0 ; rpos < length ; rpos ++ ) {
526526 uc = buffer [rpos ];
@@ -531,11 +531,11 @@ UTF8PROC_DLLEXPORT ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, ut
531531 }
532532}
533533
534- UTF8PROC_DLLEXPORT ssize_t utf8proc_map (
535- const uint8_t * str , ssize_t strlen , uint8_t * * dstptr , utf8proc_option_t options
534+ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map (
535+ const uint8_t * str , utf8proc_ssize_t strlen , uint8_t * * dstptr , utf8proc_option_t options
536536) {
537537 int32_t * buffer ;
538- ssize_t result ;
538+ utf8proc_ssize_t result ;
539539 * dstptr = NULL ;
540540 result = utf8proc_decompose (str , strlen , NULL , 0 , options );
541541 if (result < 0 ) return result ;
0 commit comments