From f061212d4b85cf90e04a56af50430899fd2fa8f5 Mon Sep 17 00:00:00 2001 From: simon987 Date: Mon, 6 Sep 2021 21:24:32 -0400 Subject: [PATCH] reformat --- libscan/msdoc/msdoc.c | 18 +++++++++--------- libscan/text/text.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libscan/msdoc/msdoc.c b/libscan/msdoc/msdoc.c index b199cbd..52a0d1f 100644 --- a/libscan/msdoc/msdoc.c +++ b/libscan/msdoc/msdoc.c @@ -6,7 +6,7 @@ #include "../ebook/ebook.h" -void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, void* buf, size_t buf_len) { +void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, void *buf, size_t buf_len) { // Open word doc options_type *opts = direct_vGetOptions(); @@ -20,7 +20,7 @@ void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, voi opts->iPageWidth = 595; opts->eImageLevel = level_ps_3; - int doc_word_version = iGuessVersionNumber(file_in, buf_len); + int doc_word_version = iGuessVersionNumber(file_in, (int) buf_len); if (doc_word_version < 0 || doc_word_version == 3) { free(buf); return; @@ -38,19 +38,19 @@ void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, voi return; } - iInitDocument(file_in, buf_len); - const char* author = szGetAuthor(); + iInitDocument(file_in, (int) buf_len); + const char *author = szGetAuthor(); if (author != NULL) { APPEND_UTF8_META(doc, MetaAuthor, author) } - const char* title = szGetTitle(); + const char *title = szGetTitle(); if (title != NULL) { APPEND_UTF8_META(doc, MetaTitle, title) } vFreeDocument(); - bWordDecryptor(file_in, buf_len, diag); + bWordDecryptor(file_in, (int) buf_len, diag); vDestroyDiagram(diag); fclose(file_out); @@ -71,7 +71,7 @@ void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, voi free(out_buf); } -void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void* buf, size_t buf_len) { +void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void *buf, size_t buf_len) { scan_ebook_ctx_t ebook_ctx = { .content_size = ctx->content_size, @@ -93,7 +93,7 @@ void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void* b opts->iPageWidth = 595; opts->eImageLevel = level_ps_3; - int doc_word_version = iGuessVersionNumber(file, buf_len); + int doc_word_version = iGuessVersionNumber(file, (int) buf_len); if (doc_word_version < 0 || doc_word_version == 3) { free(buf); return; @@ -110,7 +110,7 @@ void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void* b return; } - bWordDecryptor(file, buf_len, diag); + bWordDecryptor(file, (int) buf_len, diag); vDestroyDiagram(diag); fclose(file_out); diff --git a/libscan/text/text.c b/libscan/text/text.c index e674c0c..ba9403e 100644 --- a/libscan/text/text.c +++ b/libscan/text/text.c @@ -35,7 +35,7 @@ scan_code_t parse_text(scan_text_ctx_t *ctx, vfile_t *f, document_t *doc) { return SCAN_OK; } -#define MAX_MARKUP_SIZE 1024 * 1024 +#define MAX_MARKUP_SIZE (1024 * 1024) scan_code_t parse_markup(scan_text_ctx_t *ctx, vfile_t *f, document_t *doc) {