You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/11/27 01:03:55 UTC
[lucy-commits] svn commit: r1206644 - in /incubator/lucy/trunk/modules/unicode/utf8proc:
utf8proc.c utf8proc.h
Author: marvin
Date: Sun Nov 27 00:03:51 2011
New Revision: 1206644
URL: http://svn.apache.org/viewvc?rev=1206644&view=rev
Log:
Tweak utf8proc for C++ compilation.
Modified:
incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.c
incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.h
Modified: incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.c?rev=1206644&r1=1206643&r2=1206644&view=diff
==============================================================================
--- incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.c (original)
+++ incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.c Sun Nov 27 00:03:51 2011
@@ -556,7 +556,7 @@ ssize_t utf8proc_map(
*dstptr = NULL;
result = utf8proc_decompose(str, strlen, NULL, 0, options);
if (result < 0) return result;
- buffer = malloc(result * sizeof(int32_t) + 1);
+ buffer = (int32_t*)malloc(result * sizeof(int32_t) + 1);
if (!buffer) return UTF8PROC_ERROR_NOMEM;
result = utf8proc_decompose(str, strlen, buffer, result, options);
if (result < 0) {
@@ -570,7 +570,7 @@ ssize_t utf8proc_map(
}
{
int32_t *newptr;
- newptr = realloc(buffer, (size_t)result+1);
+ newptr = (int32_t*)realloc(buffer, (size_t)result+1);
if (newptr) buffer = newptr;
}
*dstptr = (uint8_t *)buffer;
Modified: incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.h?rev=1206644&r1=1206643&r2=1206644&view=diff
==============================================================================
--- incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.h (original)
+++ incubator/lucy/trunk/modules/unicode/utf8proc/utf8proc.h Sun Nov 27 00:03:51 2011
@@ -65,8 +65,10 @@ typedef int int32_t;
#else
#define ssize_t int
#endif
+#ifndef __cplusplus
typedef unsigned char bool;
enum {false, true};
+#endif
#else
#include <stdbool.h>
#include <inttypes.h>