okular/core/synctex/patches/11-fix-unused-parameters-warnings.diff
Henrik Fehlauer bd20e48c3c Update to synctex 1.19
Summary:
This should prevent crashes when reloading some synctex-enabled pdf
files created with newer versions of TeXLive. We also gain bugfixes,
features and improved accuracy from the last 6 years of synctex
development.

Procedure followed:
- svn co svn://tug.org/texlive/trunk/Build/source/texk/web2c/synctexdir
- Check out revision 45150
- Update files present in core/synctex/*
- Adapt Okular code to changes
- Review and drop or update/apply old patches using quilt
- Create missing patches for local synctex changes
- New patch: Omit warning message when opening non-synctex pdf
- Two new patches to fix more compiler warnings
- New patch: Plug multiple leaks and prevent a segfault

TODO for later:
- Move sync file detection code to Okular to never call into synctex C code for non-synctex files
- Evaluate feasibility of upstreaming all patches for TeXLive 2018 and using synctex as a library

BUG: 383915
FIXED-IN: 17.12.0

Test Plan:
- No crash in synctex on reloading empty.pdf from bugreport anymore.
- Shift-clicking on a word in a simple pdf opens Kate with the corresponding tex line.
- Forward and backward search in Kile seems to work.
- Works with synctex files from both TeXLive 2015 and 2017.
- PartTest::testForwardPDF still passes.
- No additional memory leaks in autotests and with basic synctex and non-synctex usage of Okular.

Reviewers: #okular, sander, #kile, aacid

Reviewed By: #okular, aacid

Subscribers: mludwig, aacid

Tags: #okular

Differential Revision: https://phabricator.kde.org/D7594
2017-09-12 21:56:49 +02:00

50 lines
1.8 KiB
Diff

Fix low hanging unused parameters warnings
Author: Martin T. H. Sandsmark <martin.sandsmark@kde.org>
Original commit: d5bdca6
Index: synctex/synctex_parser.c
===================================================================
--- synctex.orig/synctex_parser.c
+++ synctex/synctex_parser.c
@@ -198,9 +198,7 @@ typedef struct synctex_tlcpector_t {
} synctex_tlcpector_s;
typedef const synctex_tlcpector_s * synctex_tlcpector_p;
static int _synctex_int_none(synctex_node_p node) {
-# ifdef __DARWIN_UNIX03
-# pragma unused(node)
-# endif
+ (void)node; /* unused */
return 0;
}
static const synctex_tlcpector_s synctex_tlcpector_none = {
@@ -234,9 +232,7 @@ typedef struct synctex_vispector_t {
synctex_float_getter_f depth;
} synctex_vispector_s;
static float _synctex_float_none(synctex_node_p node) {
-# ifdef __DARWIN_UNIX03
-# pragma unused(node)
-# endif
+ (void)node; /* unused */
return 0;
}
static const synctex_vispector_s synctex_vispector_none = {
@@ -7206,9 +7202,7 @@ static synctex_node_p _synctex_display_q
return first_handle;
}
synctex_iterator_p synctex_iterator_new_display(synctex_scanner_p scanner,const char * name,int line,int column, int page_hint) {
-# ifdef __DARWIN_UNIX03
-# pragma unused(column)
-# endif
+ (void)column; /* unused */
if (scanner) {
int tag = synctex_scanner_get_tag(scanner,name);/* parse if necessary */
int max_line = 0;
@@ -7977,6 +7971,7 @@ SYNCTEX_INLINE static synctex_nd_lr_s __
}
#endif
SYNCTEX_INLINE static synctex_nd_lr_s __synctex_eq_get_closest_children_in_vbox_v2(synctex_point_p hitP, synctex_node_p nodeP) {
+ (void)nodeP; /* unused */
synctex_nd_lr_s nds = {SYNCTEX_ND_0,SYNCTEX_ND_0};
synctex_nd_s nd = SYNCTEX_ND_0;
if ((nd.node = synctex_node_child(nd.node))) {