summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven G. Johnson <stevenj@mit.edu>2015-10-29 17:30:56 (GMT)
committer Steven G. Johnson <stevenj@mit.edu>2015-10-29 17:30:56 (GMT)
commite52c8c4c8f0f10aa71c8dbd633a359895157c871 (patch)
treef4b75a196aa210bf3606dd134d6f8183e45e0975
parent24515cbbe306568fa0a3646f1723b22373b91393 (diff)
parentf314738f718d27c777d7ae97c47664c716efd0f7 (diff)
downloadlibutf8proc-e52c8c4c8f0f10aa71c8dbd633a359895157c871.tar.gz
libutf8proc-e52c8c4c8f0f10aa71c8dbd633a359895157c871.tar.bz2
Merge pull request #55 from petercolberg/master
Do not export internal unsafe_encode_char()
-rw-r--r--Makefile3
-rw-r--r--test/tests.h3
-rw-r--r--utf8proc.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 29a3261..61e723a 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,8 @@ INSTALL=install
CFLAGS ?= -O2
PICFLAG = -fPIC
C99FLAG = -std=c99
-UCFLAGS = $(CFLAGS) $(PICFLAG) $(C99FLAG) -DUTF8PROC_EXPORTS
+WCFLAGS = -Wall -Wmissing-prototypes -pedantic
+UCFLAGS = $(CFLAGS) $(PICFLAG) $(C99FLAG) $(WCFLAGS) -DUTF8PROC_EXPORTS
# shared-library version MAJOR.MINOR.PATCH ... this may be *different*
# from the utf8proc version number because it indicates ABI compatibility,
diff --git a/test/tests.h b/test/tests.h
index 6eb5457..43df51f 100644
--- a/test/tests.h
+++ b/test/tests.h
@@ -33,7 +33,6 @@ size_t skipspaces(const char *buf, size_t i)
separated by whitespace, and terminated by any character not in
[0-9a-fA-F] or whitespace, then stores the corresponding utf8 string
in dest, returning the number of bytes read from buf */
-utf8proc_ssize_t unsafe_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst);
size_t encode(char *dest, const char *buf)
{
size_t i = 0, j, d = 0;
@@ -48,7 +47,7 @@ size_t encode(char *dest, const char *buf)
}
check(sscanf(buf + i, "%x", (unsigned int *)&c) == 1, "invalid hex input %s", buf+i);
i = j; /* skip to char after hex input */
- d += unsafe_encode_char(c, (utf8proc_uint8_t *) (dest + d));
+ d += utf8proc_encode_char(c, (utf8proc_uint8_t *) (dest + d));
}
}
diff --git a/utf8proc.c b/utf8proc.c
index 80f5ba8..c302b79 100644
--- a/utf8proc.c
+++ b/utf8proc.c
@@ -188,7 +188,7 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_encode_char(utf8proc_int32_t uc, ut
}
/* internal "unsafe" version that does not check whether uc is in range */
-utf8proc_ssize_t unsafe_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst) {
+static utf8proc_ssize_t unsafe_encode_char(utf8proc_int32_t uc, utf8proc_uint8_t *dst) {
if (uc < 0x00) {
return 0;
} else if (uc < 0x80) {