diff options
Diffstat (limited to 'app/tools/halibut')
-rw-r--r-- | app/tools/halibut/CMakeLists.txt | 15 | ||||
-rw-r--r-- | app/tools/halibut/bk_paper.c | 12 | ||||
-rw-r--r-- | app/tools/halibut/charset/CMakeLists.txt | 16 | ||||
-rw-r--r-- | app/tools/halibut/deflate.c | 8 | ||||
-rw-r--r-- | app/tools/halibut/in_afm.c | 4 | ||||
-rw-r--r-- | app/tools/halibut/input.c | 2 | ||||
-rw-r--r-- | app/tools/halibut/tree234.c | 2 | ||||
-rw-r--r-- | app/tools/halibut/ustring.c | 4 | ||||
-rw-r--r-- | app/tools/halibut/wcwidth.c | 5 |
9 files changed, 39 insertions, 29 deletions
diff --git a/app/tools/halibut/CMakeLists.txt b/app/tools/halibut/CMakeLists.txt index ec7d74b..a4ddc75 100644 --- a/app/tools/halibut/CMakeLists.txt +++ b/app/tools/halibut/CMakeLists.txt @@ -1,4 +1,5 @@ -SET(SOURCES + +add_executable(halibut biblio.c bk_html.c contents.c @@ -22,11 +23,13 @@ SET(SOURCES ustring.c version.c wcwidth.c - ) +) -INCLUDE_DIRECTORIES(charset) -ADD_EXECUTABLE(halibut ${SOURCES}) -TARGET_LINK_LIBRARIES(halibut xtrkcad-charset) +set_target_properties( + halibut + PROPERTIES FOLDER HelpDocs +) +target_link_libraries(halibut xtrkcad-charset) -ADD_SUBDIRECTORY(charset) +add_subdirectory(charset) diff --git a/app/tools/halibut/bk_paper.c b/app/tools/halibut/bk_paper.c index 97f88b4..8c244b8 100644 --- a/app/tools/halibut/bk_paper.c +++ b/app/tools/halibut/bk_paper.c @@ -514,7 +514,7 @@ void *paper_pre_backend(paragraph *sourceform, keywordlist *keywords, int has_index; int pagenum; paragraph index_placeholder_para; - page_data *first_index_page; + page_data *first_index_page = NULL; init_std_fonts(); fontlist = snew(font_list); @@ -1707,7 +1707,7 @@ static void wrap_paragraph(para_data *pdata, word *words, for (p = wrapping; p; p = p->next) { line_data *ldata; - word *wd; +// word *wd; int len, wid, spaces; ldata = snew(line_data); @@ -1732,7 +1732,7 @@ static void wrap_paragraph(para_data *pdata, word *words, spaces = 0; len = paper_width_list(&ctx, ldata->first, ldata->end, &spaces); wid = (p == wrapping ? w - i1 : w - i2); - wd = ldata->first; +// wd = ldata->first; ldata->hshortfall = wid - len; ldata->nspaces = spaces; @@ -2296,7 +2296,7 @@ static int render_line(line_data *ldata, int left_x, int top_y, xr = NULL; { - int extra_indent, shortfall, spaces; + int extra_indent = 0, shortfall = 0, spaces = 0; int just = ldata->pdata->justification; /* @@ -2344,7 +2344,7 @@ static void render_para(para_data *pdata, paper_conf *conf, keywordlist *keywords, indexdata *idx, paragraph *index_placeholder, page_data *index_page) { - int last_x; + int last_x = 0; xref *cxref; page_data *cxref_page; xref_dest dest; @@ -2741,7 +2741,7 @@ static word *fake_end_ref(void) static word *prepare_contents_title(word *first, wchar_t *separator, word *second) { - word *ret; + word *ret = NULL; word **wptr, *w; wptr = &ret; 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/deflate.c b/app/tools/halibut/deflate.c index 6e4cc67..6366708 100644 --- a/app/tools/halibut/deflate.c +++ b/app/tools/halibut/deflate.c @@ -266,6 +266,7 @@ static void lz77_compress(struct LZ77Context *ctx, st->npending -= i; defermatch.len = 0; + defermatch.distance = 0; deferchr = '\0'; while (len > 0) { @@ -1203,7 +1204,7 @@ static void outblock(deflate_compress_ctx *out, */ for (i = 0; i < 19; i++) codelen[i] = len3[lenlenmap[i]]; - for (hclen = 19; hclen > 4 && codelen[hclen-1] == 0; hclen--); + for (hclen = 19; hclen > 4 && codelen[hclen-1] == 0; hclen--){}; /* * Now work out the exact size of both the dynamic and the @@ -2042,7 +2043,8 @@ int deflate_decompress_data(deflate_decompress_ctx *dctx, { const coderecord *rec; const unsigned char *block = (const unsigned char *)vblock; - int code, bfinal, btype, rep, dist, nlen, header, cksum; + int code, bfinal, btype, rep, dist, header, cksum; +// int nlen; int error = 0; if (len == 0) { @@ -2441,7 +2443,7 @@ int deflate_decompress_data(deflate_decompress_ctx *dctx, */ if (dctx->nbits < 16) goto finished; - nlen = dctx->bits & 0xFFFF; +// nlen = dctx->bits & 0xFFFF; EATBITS(16); if (dctx->uncomplen == 0) dctx->state = OUTSIDEBLK; /* block is empty */ diff --git a/app/tools/halibut/in_afm.c b/app/tools/halibut/in_afm.c index 724bae7..cb2b39c 100644 --- a/app/tools/halibut/in_afm.c +++ b/app/tools/halibut/in_afm.c @@ -229,14 +229,14 @@ void read_afm_file(input *in) { } else if (strcmp(key, "StartKernPairs") == 0 || strcmp(key, "StartKernPairs0") == 0) { int nkerns, i; - kern_pair *kerns; +// kern_pair *kerns; if (!(val = strtok(NULL, " \t"))) { error(err_afmval, &in->pos, key, 1); goto giveup; } nkerns = atoi(val); sfree(line); - kerns = snewn(nkerns, kern_pair); +// kerns = snewn(nkerns, kern_pair); for (i = 0; i < nkerns; i++) { line = afm_read_line(in); if (line == NULL) diff --git a/app/tools/halibut/input.c b/app/tools/halibut/input.c index 256d9c6..0f38569 100644 --- a/app/tools/halibut/input.c +++ b/app/tools/halibut/input.c @@ -831,7 +831,7 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx, */ par.type = para_Normal; if (t.type == tok_cmd) { - int needkw; + int needkw = -1; int is_macro = FALSE; par.fpos = t.pos; diff --git a/app/tools/halibut/tree234.c b/app/tools/halibut/tree234.c index 26d188e..e971453 100644 --- a/app/tools/halibut/tree234.c +++ b/app/tools/halibut/tree234.c @@ -1162,7 +1162,7 @@ tree234 *join234r(tree234 *t1, tree234 *t2) { static node234 *split234_internal(tree234 *t, int index) { node234 *halves[2], *n, *sib, *sub; node234 *lparent, *rparent; - int ki, pki, i, half, lcount, rcount; + int ki, pki = 0, i, half, lcount, rcount; n = t->root; LOG(("splitting tree %p at point %d\n", t, index)); diff --git a/app/tools/halibut/ustring.c b/app/tools/halibut/ustring.c index a5d1103..99303ef 100644 --- a/app/tools/halibut/ustring.c +++ b/app/tools/halibut/ustring.c @@ -323,12 +323,12 @@ wchar_t *ustrlow(wchar_t *s) { } int utoi(wchar_t const *s) { - int sign = +1; +// int sign = +1; int n; if (*s == L'-') { s++; - sign = -1; +// sign = -1; } n = 0; diff --git a/app/tools/halibut/wcwidth.c b/app/tools/halibut/wcwidth.c index f4abe23..0ffe9dd 100644 --- a/app/tools/halibut/wcwidth.c +++ b/app/tools/halibut/wcwidth.c @@ -144,12 +144,13 @@ int ustrwid(wchar_t const *s, int charset) wid = 0; while (len > 0) { - int err, ret; + int err; +// int ret; wchar_t const *s_orig; err = 0; s_orig = s; - ret = charset_from_unicode(&s, &len, buf, lenof(buf), + /*ret =*/ charset_from_unicode(&s, &len, buf, lenof(buf), charset, &state, &err); wid += wcswidth(s_orig, s - s_orig); if (err) { |