diff options
Diffstat (limited to 'app/tools/halibut/charset')
-rw-r--r-- | app/tools/halibut/charset/CMakeLists.txt | 16 | ||||
-rw-r--r-- | app/tools/halibut/charset/fromucs.c | 6 | ||||
-rw-r--r-- | app/tools/halibut/charset/iso2022.c | 6 | ||||
-rw-r--r-- | app/tools/halibut/charset/test.c | 2 | ||||
-rw-r--r-- | app/tools/halibut/charset/toucs.c | 6 |
5 files changed, 20 insertions, 16 deletions
diff --git a/app/tools/halibut/charset/CMakeLists.txt b/app/tools/halibut/charset/CMakeLists.txt index 86521b8..684c70e 100644 --- a/app/tools/halibut/charset/CMakeLists.txt +++ b/app/tools/halibut/charset/CMakeLists.txt @@ -1,4 +1,7 @@ -SET(SOURCES +# +# Character set conversion library as required for halibut + +add_library(xtrkcad-charset big5enc.c big5set.c charset.h @@ -29,10 +32,11 @@ SET(SOURCES utf16.c utf7.c utf8.c - xenc.c - ) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + xenc.c) -ADD_LIBRARY(xtrkcad-charset ${SOURCES}) +set_target_properties( + xtrkcad-charset + PROPERTIES FOLDER HelpDocs + ) + target_include_directories(xtrkcad-charset PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/app/tools/halibut/charset/fromucs.c b/app/tools/halibut/charset/fromucs.c index 8090c19..3faf48e 100644 --- a/app/tools/halibut/charset/fromucs.c +++ b/app/tools/halibut/charset/fromucs.c @@ -16,7 +16,7 @@ static void charset_emit(void *ctx, long int output) struct charset_emit_param *param = (struct charset_emit_param *)ctx; if (param->outlen > 0) { - *param->output++ = output; + *param->output++ = (char)output; param->outlen--; } else { param->stopped = 1; @@ -47,7 +47,7 @@ int charset_from_unicode(const wchar_t **input, int *inlen, *error = FALSE; while (*inlen > 0) { - int lenbefore = param.output - output; + int lenbefore = (int)(param.output - output); int ret; if (input) @@ -78,5 +78,5 @@ int charset_from_unicode(const wchar_t **input, int *inlen, (*input)++; (*inlen)--; } - return param.output - output; + return (int)(param.output - output); } diff --git a/app/tools/halibut/charset/iso2022.c b/app/tools/halibut/charset/iso2022.c index 8cf3c25..b0492d9 100644 --- a/app/tools/halibut/charset/iso2022.c +++ b/app/tools/halibut/charset/iso2022.c @@ -879,7 +879,7 @@ static void docs_char(charset_state *state, emit(emitctx, '/'); emit(emitctx, '0' + ctext_encodings[curr_cset].octets_per_char); len = currlen + datalen + - strlen(ctext_encodings[curr_cset].name); + (int)strlen(ctext_encodings[curr_cset].name); assert(len < (1 << 14)); emit(emitctx, 0x80 | ((len >> 7) & 0x7F)); emit(emitctx, 0x80 | ((len ) & 0x7F)); @@ -964,7 +964,7 @@ static void docs_char(charset_state *state, static void write_to_pointer(void *ctx, long int output) { char **ptr = (char **)ctx; - *(*ptr)++ = output; + *(*ptr)++ = (char)output; } /* @@ -1195,7 +1195,7 @@ static int write_iso2022(charset_spec const *charset, long int input_chr, } if (cs != -2) { - docs_char(state, emit, emitctx, cs, data, p - data); + docs_char(state, emit, emitctx, cs, data, (int)(p - data)); return TRUE; } } diff --git a/app/tools/halibut/charset/test.c b/app/tools/halibut/charset/test.c index fc5128e..54eab56 100644 --- a/app/tools/halibut/charset/test.c +++ b/app/tools/halibut/charset/test.c @@ -39,7 +39,7 @@ int main(int argc, char **argv) while (1) { - rdret = fread(inbuf, 1, sizeof(inbuf), stdin); + rdret = (int)fread(inbuf, 1, sizeof(inbuf), stdin); if (rdret <= 0) break; /* EOF */ diff --git a/app/tools/halibut/charset/toucs.c b/app/tools/halibut/charset/toucs.c index bee98ab..807001b 100644 --- a/app/tools/halibut/charset/toucs.c +++ b/app/tools/halibut/charset/toucs.c @@ -30,7 +30,7 @@ static void unicode_emit(void *ctx, long int output) outlen = 1; } } else { - outval = output; + outval = (wchar_t)output; p = &outval; outlen = 1; } @@ -65,7 +65,7 @@ int charset_to_unicode(const char **input, int *inlen, localstate = *state; /* structure copy */ while (*inlen > 0) { - int lenbefore = param.output - output; + int lenbefore = (int)(param.output - output); spec->read(spec, (unsigned char)**input, &localstate, unicode_emit, ¶m); if (param.stopped) { @@ -83,5 +83,5 @@ int charset_to_unicode(const char **input, int *inlen, (*inlen)--; } - return param.output - output; + return (int)(param.output - output); } |