From 6cd76dec9aece2a8daa90f17ab77fbf773157a1d Mon Sep 17 00:00:00 2001 From: Andreas Politz Date: Fri, 11 Aug 2017 06:27:34 +0200 Subject: Fix trailing whitespace --- .travis.yml | 2 +- COPYING.SYNCTEX | 6 ++-- Makefile | 4 +-- NEWS | 2 +- README.org | 28 ++++++++-------- TODO | 2 +- server/epdfinfo.c | 69 ++++++++++++++++++++-------------------- server/epdfinfo.h | 2 +- server/poppler-hack.cc | 10 +++--- server/synctex_parser.c | 48 ++++++++++++++-------------- server/synctex_parser.h | 8 ++--- server/synctex_parser_local.h | 8 ++--- server/synctex_parser_readme.txt | 3 +- server/synctex_parser_utils.c | 12 +++---- server/synctex_parser_utils.h | 14 ++++---- test/pdf-info.ert | 11 +++---- test/pdf-util.ert | 3 +- test/pdf-virtual.ert | 2 +- test/run-tests.el | 1 - 19 files changed, 115 insertions(+), 120 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c474c7..803dac0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ install: sudo apt-get install -qq emacs-snapshot; fi - sudo apt-get install -qq make automake autoconf libpng-dev libz-dev - - sudo apt-get install libcairo2-dev libglib2.0-dev + - sudo apt-get install libcairo2-dev libglib2.0-dev - POPPLER=poppler-0.28.1 - wget http://poppler.freedesktop.org/$POPPLER.tar.xz - unxz $POPPLER.tar.xz diff --git a/COPYING.SYNCTEX b/COPYING.SYNCTEX index 116157b..bfa2746 100644 --- a/COPYING.SYNCTEX +++ b/COPYING.SYNCTEX @@ -21,7 +21,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written +Except as contained in this notice, the name of the copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization from the copyright holder. diff --git a/Makefile b/Makefile index 8b43263..a4f2ac7 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ PACKAGE_DIR = $(PACKAGE_NAME) all: package -clean: +clean: rm -rf -- $(PACKAGE_DIR) rm -f -- $(PACKAGE_NAME).tar rm -f -- lisp/*.elc @@ -43,7 +43,7 @@ $(PACKAGE_NAME).tar: server/epdfinfo lisp/*.el echo '$(PKGFILE_CONTENT)' > '$(PACKAGE_DIR)/pdf-tools-pkg.el' tar cf '$(PACKAGE_NAME).tar' '$(PACKAGE_DIR)' -melpa-package: +melpa-package: $(MAKE) distclean mkdir -p '$(PACKAGE_DIR)/build' cp lisp/*.el README '$(PACKAGE_DIR)' diff --git a/NEWS b/NEWS index f62f2b9..64220c2 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,7 @@ A virtual PDF is a collection of pages (or parts thereof) of arbitrary documents, which appear to the rest of pdf-tools as one big PDF, though they are always read-only. - + * Version 0.60 ** Regexp support You may now search for perl-compatible regular expressions (PCRE) diff --git a/README.org b/README.org index 0e6f265..e8769e3 100644 --- a/README.org +++ b/README.org @@ -30,7 +30,7 @@ buffer, either for a string or a PCRE. + Occur :: List lines matching a string or regexp in one or more PDF documents. - + Follow :: + + Follow :: Click on highlighted links, moving to some part of a different page, some external file, a website or any other URI. Links may also be followed by keyboard commands. @@ -45,7 +45,7 @@ the PDF's outline. + SyncTeX :: Jump from a position on a page directly to the TeX source and vice versa. - + Virtual :: + + Virtual :: Use a collection of documents as if it where one, big single PDF. + Misc :: @@ -76,7 +76,7 @@ Next we need to install a few libraries PDF Tools depends on, some of which are probably already on your system. #+begin_src sh - $ sudo aptitude install libpng-dev zlib1g-dev + $ sudo aptitude install libpng-dev zlib1g-dev $ sudo aptitude install libpoppler-glib-dev $ sudo aptitude install libpoppler-private-dev #+end_src @@ -165,13 +165,13 @@ must first be installed by copying the appropriate dlls into emacs' ~bin/~ directory. Most third-party binaries come with this already done. - + First, install [[http://www.msys2.org/][install MSYS2]] and update the package database and core packages using the instructions provided. Then, to compile PDF tools itself: 1. Open msys2 shell - + 2. Update and install dependencies, skipping any you already have #+BEGIN_SRC sh pacman -Syu @@ -189,28 +189,28 @@ #+BEGIN_SRC sh git clone https://github.com/politza/pdf-tools #+END_SRC - + 4. Open mingw64 shell - + 5. Compile pdf-tools #+BEGIN_SRC sh cd pdf-tools/build make -s #+END_SRC - + 6. This should produce a file ~server/epdfinfo.exe~. Copy this file into the ~pdf-tools/~ installation directory in your Emacs. - + 7. Start Emacs and activate the package. - #+BEGIN_SRC + #+BEGIN_SRC M-x pdf-tools-install RET #+END_SRC - - 8. Test. - #+BEGIN_SRC + + 8. Test. + #+BEGIN_SRC M-x pdf-info-check-epdfinfo RET #+END_SRC - + If this is successful, ~(pdf-tools-install)~ can be added to Emacs' config. Note that libraries from other GNU utilities, such as Git for Windows, may interfere with those needed by PDF Tools. diff --git a/TODO b/TODO index bb4fd39..68f1e0b 100644 --- a/TODO +++ b/TODO @@ -15,7 +15,7 @@ * epdfinfo ** Maybe split the code up in several files. * pdf-view -** Provide some kind of multi-page view +** Provide some kind of multi-page view ** Make persistent scrolling relative Currently the scrolling is kept when changing the image's size (in pdf-view-display-image), which is actually not so desirable, since diff --git a/server/epdfinfo.c b/server/epdfinfo.c index 698c2f7..949c4ca 100644 --- a/server/epdfinfo.c +++ b/server/epdfinfo.c @@ -503,7 +503,7 @@ image_render_page(PopplerDocument *pdf, PopplerPage *page, if (options && options->usecolors) image_recolor (surface, &options->fg, &options->bg); - + cairo_destroy (cr); return surface; @@ -559,7 +559,7 @@ image_write (cairo_surface_t *surface, const char *filename, enum image_type typ { unsigned char *buffer = g_malloc (width * height * 3); unsigned char *buffer_p = buffer; - + fprintf (file, "P6\n%d %d\n255\n", width, height); for (i = 0; i < width * height; ++i, data += 4, buffer_p += 3) ARGB_TO_RGB (buffer_p, data); @@ -1318,7 +1318,7 @@ annotation_translate_quadrilateral (PopplerPage *page, PopplerQuadrilateral *q, poppler_page_get_crop_box (page, &cbox); xs = MIN (cbox.x1, cbox.x2); ys = MIN (cbox.y1, cbox.y2); - + if (inverse) { xs = -xs; ys = -ys; @@ -1905,7 +1905,7 @@ cmd_search_regexp(const epdfinfo_t *ctx, const command_arg_t *args) re = g_regex_new (regexp, cflags, mflags, &gerror); perror_if_not (NULL == gerror, "Invalid regexp: %s", gerror->message); - + OK_BEGIN (); for (pn = first; pn <= last; ++pn) { @@ -1922,7 +1922,7 @@ cmd_search_regexp(const epdfinfo_t *ctx, const command_arg_t *args) poppler_page_get_text_layout (page, &rectangles, &nrectangles); poppler_page_get_size (page, &width, &height); g_regex_match (re, text, 0, &match); - + while (g_match_info_matches (match)) { const double scale = 100.0; @@ -1934,7 +1934,7 @@ cmd_search_regexp(const epdfinfo_t *ctx, const command_arg_t *args) /* Does this ever happen ? */ if (! g_match_info_fetch_pos (match, 0, &start, &end)) continue; - + string = g_match_info_fetch (match, 0); ustart = g_utf8_strlen (text, start); ulen = g_utf8_strlen (string, -1); @@ -1954,11 +1954,11 @@ cmd_search_regexp(const epdfinfo_t *ctx, const command_arg_t *args) PopplerRectangle *r = rectangles + i; cairo_rectangle_int_t c; - c.x = (int) (scale * r->x1 + 0.5); - c.y = (int) (scale * r->y1 + 0.5); - c.width = (int) (scale * (r->x2 - r->x1) + 0.5); - c.height = (int) (scale * (r->y2 - r->y1) + 0.5); - + c.x = (int) (scale * r->x1 + 0.5); + c.y = (int) (scale * r->y1 + 0.5); + c.width = (int) (scale * (r->x2 - r->x1) + 0.5); + c.height = (int) (scale * (r->y2 - r->y1) + 0.5); + cairo_region_union_rectangle (region, &c); } @@ -1994,11 +1994,11 @@ static void cmd_regexp_flags (const epdfinfo_t *ctx, const command_arg_t *args) { OK_BEGIN (); - printf ("caseless:%d\n", G_REGEX_CASELESS); - printf ("multiline:%d\n", G_REGEX_MULTILINE); - printf ("dotall:%d\n", G_REGEX_DOTALL); - printf ("extended:%d\n", G_REGEX_EXTENDED); - printf ("anchored:%d\n", G_REGEX_ANCHORED); + printf ("caseless:%d\n", G_REGEX_CASELESS); + printf ("multiline:%d\n", G_REGEX_MULTILINE); + printf ("dotall:%d\n", G_REGEX_DOTALL); + printf ("extended:%d\n", G_REGEX_EXTENDED); + printf ("anchored:%d\n", G_REGEX_ANCHORED); printf ("dollar-endonly:%d\n", G_REGEX_DOLLAR_ENDONLY); printf ("ungreedy:%d\n", G_REGEX_UNGREEDY); printf ("raw:%d\n", G_REGEX_RAW); @@ -3103,14 +3103,14 @@ cmd_renderpage (const epdfinfo_t *ctx, const command_arg_t *args) if (! nrest_args) goto theend; - + cr = cairo_create (surface); cairo_scale (cr, width / pt_width, width / pt_width); while (i < nrest_args) { const char* keyword; - + perror_if_not (command_arg_parse_arg (ctx, rest_args[i], &rest_arg, ARG_STRING, &error_msg), "%s", error_msg); @@ -3142,7 +3142,7 @@ cmd_renderpage (const epdfinfo_t *ctx, const command_arg_t *args) alpha = rest_arg.value.edge; } else if (! strcmp (keyword, ":crop-to") - || ! strcmp (keyword, ":highlight-region") + || ! strcmp (keyword, ":highlight-region") || ! strcmp (keyword, ":highlight-text") || ! strcmp (keyword, ":highlight-line")) { @@ -3153,14 +3153,14 @@ cmd_renderpage (const epdfinfo_t *ctx, const command_arg_t *args) ++i; r = &rest_arg.value.rectangle; - + if (! strcmp (keyword, ":crop-to")) { gdouble w = (cb.x2 - cb.x1); gdouble h = (cb.y2 - cb.y1); gdouble x1 = cb.x1; gdouble y1 = cb.y1; - + cb.x1 = r->x1 * w + x1; cb.x2 = r->x2 * w + x1; cb.y1 = r->y1 * h + y1; @@ -3173,7 +3173,7 @@ cmd_renderpage (const epdfinfo_t *ctx, const command_arg_t *args) r->x2 = pt_width * r->x2 * (cb.x2 - cb.x1) + pt_width * cb.x1; r->y1 = pt_height * r->y1 * (cb.y2 - cb.y1) + pt_height * cb.y1; r->y2 = pt_height * r->y2 * (cb.y2 - cb.y1) + pt_height * cb.y1; - + if (! strcmp (keyword, ":highlight-region")) { const double deg = M_PI / 180.0; @@ -3205,10 +3205,10 @@ cmd_renderpage (const epdfinfo_t *ctx, const command_arg_t *args) cairo_set_line_width (cr, line_width); cairo_stroke (cr); } - else + else { gboolean is_single_line = ! strcmp (keyword, ":highlight-line"); - + if (is_single_line) { gdouble m = r->y1 + (r->y2 - r->y1) / 2; @@ -3245,9 +3245,9 @@ cmd_renderpage (const epdfinfo_t *ctx, const command_arg_t *args) cairo_set_source_surface (cr, surface, -r.x, -r.y); cairo_paint (cr); cairo_surface_destroy (surface); - surface = nsurface; + surface = nsurface; } - + theend: image_write_print_response (surface, PNG); @@ -3386,9 +3386,9 @@ cmd_charlayout(const epdfinfo_t *ctx, const command_arg_t *args) guint nrectangles; int i; gboolean have_position = region.y2 < 0; - + perror_if_not (page, "No such page %d", pn); - + text = poppler_page_get_text (page); text_p = text; poppler_page_get_text_layout (page, &rectangles, &nrectangles); @@ -3396,14 +3396,14 @@ cmd_charlayout(const epdfinfo_t *ctx, const command_arg_t *args) region.x1 *= width; region.x2 *= width; region.y1 *= height; - region.y2 *= height; + region.y2 *= height; OK_BEGIN (); for (i = 0; i < nrectangles && *text_p; ++i) { PopplerRectangle *r = &rectangles[i]; char *nextc = g_utf8_offset_to_pointer (text_p, 1); - + if ((have_position && region.x1 >= r->x1 && region.x1 <= r->x2 @@ -3458,7 +3458,7 @@ cmd_getoptions(const epdfinfo_t *ctx, const command_arg_t *args) for (i = 0; i < G_N_ELEMENTS (document_options); ++i) { command_arg_t arg; - + arg.type = document_options[i].type; memcpy (&arg.value, ((char*) &doc->options) + document_options[i].offset, @@ -3486,9 +3486,9 @@ cmd_setoptions(const epdfinfo_t *ctx, const command_arg_t *args) gchar *error_msg = NULL; document_options_t opts = doc->options; const size_t nopts = G_N_ELEMENTS (document_options); - + perror_if_not (nrest % 2 == 0, "Even number of key/value pairs expected"); - + while (i < nrest) { int j; @@ -3603,7 +3603,7 @@ static const command_t commands [] = DEC_CMD (boundingbox), DEC_CMD (charlayout), DEC_CMD (pagelabels), - + /* Annotations */ DEC_CMD (getannots), DEC_CMD (getannot), @@ -3716,4 +3716,3 @@ int main(int argc, char **argv) err (2, NULL); exit (EXIT_SUCCESS); } - diff --git a/server/epdfinfo.h b/server/epdfinfo.h index d602742..41fcf02 100644 --- a/server/epdfinfo.h +++ b/server/epdfinfo.h @@ -178,7 +178,7 @@ typedef enum typedef struct { - const char *name; + const char *name; command_arg_type_t type; size_t offset; } document_option_t; diff --git a/server/poppler-hack.cc b/server/poppler-hack.cc index 763e61b..0c62f73 100644 --- a/server/poppler-hack.cc +++ b/server/poppler-hack.cc @@ -21,7 +21,7 @@ extern "C" { - + GType poppler_annot_get_type (void) G_GNUC_CONST; GType poppler_annot_markup_get_type (void) G_GNUC_CONST; @@ -57,7 +57,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; if (! s) return NULL; - + if (s->hasUnicodeMarker()) { result = g_convert (s->getCString () + 2, s->getLength () - 2, @@ -66,7 +66,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; int len; gunichar *ucs4_temp; int i; - + len = s->getLength (); ucs4_temp = g_new (gunichar, len + 1); for (i = 0; i < len; ++i) { @@ -87,13 +87,13 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; { GooString *state = a->annot->getAppearState (); char *ustate = _xpoppler_goo_string_to_utf8 (state); - + a->annot->setRect (rectangle->x1, rectangle->y1, rectangle->x2, rectangle->y2); a->annot->setAppearanceState (ustate); g_free (ustate); } -#endif +#endif // This function is in the library, but the enforced date parsing is // incomplete (at least in some versions), because it ignores the // timezone. diff --git a/server/synctex_parser.c b/server/synctex_parser.c index e9c7345..b0bc81d 100644 --- a/server/synctex_parser.c +++ b/server/synctex_parser.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr This file is part of the SyncTeX package. @@ -32,9 +32,9 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written +Except as contained in this notice, the name of the copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization from the copyright holder. Acknowledgments: @@ -64,7 +64,7 @@ Thu Jun 19 09:39:21 UTC 2008 # else # define HAVE_LOCALE_H 1 # define HAVE_SETLOCALE 1 -# if defined(_MSC_VER) +# if defined(_MSC_VER) # define SYNCTEX_INLINE __inline # else # define SYNCTEX_INLINE inline @@ -568,9 +568,9 @@ typedef struct { || (NODE->class->type == synctex_node_type_void_vbox)\ || (NODE->class->type == synctex_node_type_hbox)\ || (NODE->class->type == synctex_node_type_void_hbox)) - + #define SYNCTEX_HAS_CHILDREN(NODE) (NODE && SYNCTEX_CHILD(NODE)) - + void _synctex_log_medium_node(synctex_node_t node); /* math node creator */ @@ -1357,7 +1357,7 @@ synctex_status_t _synctex_decode_int(synctex_scanner_t scanner, int* value_ref) * value_ref = result; } return SYNCTEX_STATUS_OK;/* Successfully scanned an int */ - } + } return SYNCTEX_STATUS_NOT_OK;/* Could not scan an int */ } @@ -1916,7 +1916,7 @@ scan_next_line: } else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_SHEET) { ++SYNCTEX_CUR; goto deeper; - + } else if (_synctex_next_line(scanner)left = bestDistancesRef->right = 0; bestNodesRef->left = node; bestNodesRef->right = NULL; @@ -3990,19 +3990,19 @@ SYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_hbox(synctex_poin /* the left node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } } if (result & SYNCTEX_MASK_RIGHT) { /* the right node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } } } return result; @@ -4057,19 +4057,19 @@ SYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_vbox(synctex_poin /* the left node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->left,visible))) { bestNodesRef->left = node; - } + } } if (result & SYNCTEX_MASK_RIGHT) { /* the right node is new, try to narrow the result */ if ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } if ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->right,visible))) { bestNodesRef->right = node; - } + } } } return result; diff --git a/server/synctex_parser.h b/server/synctex_parser.h index 4aca415..2f22c30 100644 --- a/server/synctex_parser.h +++ b/server/synctex_parser.h @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr This file is part of the SyncTeX package. @@ -32,9 +32,9 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written +Except as contained in this notice, the name of the copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization from the copyright holder. Acknowledgments: diff --git a/server/synctex_parser_local.h b/server/synctex_parser_local.h index 6573b26..611f86d 100644 --- a/server/synctex_parser_local.h +++ b/server/synctex_parser_local.h @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr This file is part of the SyncTeX package. @@ -32,9 +32,9 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written +Except as contained in this notice, the name of the copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization from the copyright holder. */ diff --git a/server/synctex_parser_readme.txt b/server/synctex_parser_readme.txt index ebc06bb..c7a695e 100644 --- a/server/synctex_parser_readme.txt +++ b/server/synctex_parser_readme.txt @@ -99,7 +99,7 @@ Note that version 1.7 was delivered privately. - Various typo fixed - OutputDebugString replaced by OutputDebugStringA to deliberately disable unicode preprocessing - New conditional created because OutputDebugStringA is only available since Windows 2K professional -1.10: Sun Jan 10 10:12:32 UTC 2010 +1.10: Sun Jan 10 10:12:32 UTC 2010 - Bug fix in synctex_parser.c to solve a synchronization problem with amsmath's gather environment. Concerns the synctex tool. 1.11: Sun Jan 17 09:12:31 UTC 2010 @@ -138,4 +138,3 @@ If you include or use a significant part of the synctex package into a software, I would appreciate to be listed as contributor and see "SyncTeX" highlighted. Copyright (c) 2008-2011 jerome DOT laurens AT u-bourgogne DOT fr - diff --git a/server/synctex_parser_utils.c b/server/synctex_parser_utils.c index 569f7e9..d5107ec 100644 --- a/server/synctex_parser_utils.c +++ b/server/synctex_parser_utils.c @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr This file is part of the SyncTeX package. @@ -32,9 +32,9 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written +Except as contained in this notice, the name of the copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization from the copyright holder. */ @@ -302,7 +302,7 @@ char * _synctex_merge_strings(const char * first,...) { _synctex_error("! _synctex_merge_strings: Memory problem"); return NULL; } - return NULL; + return NULL; } /* The purpose of _synctex_get_name is to find the name of the synctex file. @@ -473,7 +473,7 @@ int _synctex_get_name(const char * output, const char * build_directory, char ** } const char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode) { - static const char * synctex_io_modes[4] = {"r","rb","a","ab"}; + static const char * synctex_io_modes[4] = {"r","rb","a","ab"}; unsigned index = ((io_mode & synctex_io_gz_mask)?1:0) + ((io_mode & synctex_io_append_mask)?2:0);// bug pointed out by Jose Alliste return synctex_io_modes[index]; } diff --git a/server/synctex_parser_utils.h b/server/synctex_parser_utils.h index e67f8f5..b41e66e 100644 --- a/server/synctex_parser_utils.h +++ b/server/synctex_parser_utils.h @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2008, 2009, 2010, 2011 jerome DOT laurens AT u-bourgogne DOT fr This file is part of the SyncTeX package. @@ -32,9 +32,9 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -Except as contained in this notice, the name of the copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in this Software without prior written +Except as contained in this notice, the name of the copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in this Software without prior written authorization from the copyright holder. */ @@ -66,13 +66,13 @@ extern "C" { # else # define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c) # endif - + # if _WIN32 # define SYNCTEX_IS_DOT(c) ('.' == c) # else # define SYNCTEX_IS_DOT(c) ('.' == c) # endif - + /* This custom malloc functions initializes to 0 the newly allocated memory. * There is no bzero function on windows. */ void *_synctex_malloc(size_t size); @@ -133,7 +133,7 @@ int _synctex_get_name(const char * output, const char * build_directory, char ** const char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode); const char * synctex_ignore_leading_dot_slash(const char * name); - + #ifdef __cplusplus } #endif diff --git a/test/pdf-info.ert b/test/pdf-info.ert index 161133f..0412479 100644 --- a/test/pdf-info.ert +++ b/test/pdf-info.ert @@ -8,7 +8,7 @@ (pdf-test-with-test-pdf (should-not (pdf-info-open)) (should (pdf-info-close))) - (pdf-test-with-encrypted-pdf + (pdf-test-with-encrypted-pdf (should-error (pdf-info-open nil "Invalid Password")) (should-not (pdf-info-open nil "pdftool")))) @@ -21,7 +21,7 @@ (ert-deftest pdf-info-search-string () (pdf-test-with-test-pdf - (let (matches) + (let (matches) (should (setq matches (pdf-info-search-string "PDF Tools"))) (should (= 2 (length matches))) (should (cl-every (lambda (m) @@ -30,11 +30,11 @@ (cl-every 'pdf-test-relative-edges-p .edges) (= 1 .page)))) matches))))) - + (ert-deftest pdf-info-search-regexp () (pdf-test-with-test-pdf - (let (case-fold-search matches) + (let (case-fold-search matches) (should (setq matches (pdf-info-search-regexp "PDF Tools"))) (should (= 2 (length matches))) (should (cl-every (lambda (m) @@ -177,7 +177,7 @@ (should (= nannots (length (pdf-info-getannots))))))) (ert-deftest pdf-info-mvannot () - (skip-unless (pdf-info-writable-annotations-p)) + (skip-unless (pdf-info-writable-annotations-p)) (pdf-test-with-test-pdf (let ((edges '(0.25 0.25 1.0 1.0)) (id (cdr (assq 'id (car (pdf-info-getannots)))))) @@ -256,4 +256,3 @@ ;; (ert-deftest pdf-info-boundingbox () ;; (pdf-test-with-test-pdf ;; )) - diff --git a/test/pdf-util.ert b/test/pdf-util.ert index 2136e45..1f468d3 100644 --- a/test/pdf-util.ert +++ b/test/pdf-util.ert @@ -27,7 +27,7 @@ (should (equal '(1 . ((nil . ?a) (?b . ?b) (nil . ?c))) (pdf-util-seq-alignment s6 s1 nil 'infix))) - + (should (equal '(-3 . ((?a . ?e) (?b . ?f) (?c . ?g))) (pdf-util-seq-alignment s1 s4 nil))) @@ -41,4 +41,3 @@ (downcase b)) 1 -1))))))) - diff --git a/test/pdf-virtual.ert b/test/pdf-virtual.ert index 4cd3f32..fc20981 100644 --- a/test/pdf-virtual.ert +++ b/test/pdf-virtual.ert @@ -120,7 +120,7 @@ (ert-deftest pdf-virtual-gettext () (with-pdf-virtual-test-buffer (let ((text (pdf-info-gettext 2 '(0 0 1 1)))) - (should + (should (= 2 (with-temp-buffer (insert text) (count-matches "PDF" 1 (point)))))))) diff --git a/test/run-tests.el b/test/run-tests.el index 7a49421..50f5599 100644 --- a/test/run-tests.el +++ b/test/run-tests.el @@ -87,4 +87,3 @@ (dolist (file (directory-files "." t "\\.ert\\'")) (load-file file)) (ert-run-tests-batch-and-exit t) - -- cgit v1.0