diff --git a/synctex_main.c b/synctex_main.c index 2873f32..8e411d7 100644 --- a/synctex_main.c +++ b/synctex_main.c @@ -64,7 +64,7 @@ # define _ISOC99_SOURCE /* to get the fmax() prototype */ # endif -# ifdef SYNCTEX_WORK +# ifdef __SYNCTEX_WORK__ # include /* for inline && HAVE_xxx */ # else diff --git a/synctex_parser.c b/synctex_parser.c index 6d85db9..e1fd421 100644 --- a/synctex_parser.c +++ b/synctex_parser.c @@ -108,9 +108,10 @@ /* Mark unused paramters, so that there will be no compile warnings. */ #ifdef __DARWIN_UNIX03 -#define UNUSED(x) _Pragma(unused(x)) +# define SYNCTEX_UNUSED(x) SYNCTEX_PRAGMA(unused(x)) +# define SYNCTEX_PRAGMA(x) _Pragma ( #x ) #else -#define UNUSED(x) (void)(x); +# define SYNCTEX_UNUSED(x) (void)(x); #endif #include "synctex_parser_advanced.h" @@ -205,7 +206,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) { - UNUSED(node) + SYNCTEX_UNUSED(node) return 0; } static const synctex_tlcpector_s synctex_tlcpector_none = { @@ -239,7 +240,7 @@ typedef struct synctex_vispector_t { synctex_float_getter_f depth; } synctex_vispector_s; static float _synctex_float_none(synctex_node_p node) { - UNUSED(node) + SYNCTEX_UNUSED(node) return 0; } static const synctex_vispector_s synctex_vispector_none = { @@ -488,7 +489,7 @@ DEFINE_SYNCTEX_TREE_GETSETRESET(target) #endif #define SYNCTEX_HAS_CHILDREN(NODE) (NODE && _synctex_tree_child(NODE)) -# ifdef __SYNCTEX_WORK__ +# ifdef _X_SYNCTEX_WORK__ # include "/usr/include/zlib.h" # else # include @@ -7397,7 +7398,7 @@ static synctex_node_p _synctex_display_query_v2(synctex_node_p target, int tag, return first_handle; } synctex_iterator_p synctex_iterator_new_display(synctex_scanner_p scanner,const char * name,int line,int column, int page_hint) { - UNUSED(column) + SYNCTEX_UNUSED(column) if (scanner) { int tag = synctex_scanner_get_tag(scanner,name);/* parse if necessary */ int max_line = 0; @@ -8169,7 +8170,7 @@ SYNCTEX_INLINE static synctex_nd_lr_s __synctex_eq_get_closest_children_in_hbox_ } #endif SYNCTEX_INLINE static synctex_nd_lr_s __synctex_eq_get_closest_children_in_vbox_v2(synctex_point_p hitP, synctex_node_p nodeP) { - UNUSED(nodeP) + SYNCTEX_UNUSED(nodeP) 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))) { diff --git a/synctex_parser_advanced.h b/synctex_parser_advanced.h index 7a95dc6..104ba78 100644 --- a/synctex_parser_advanced.h +++ b/synctex_parser_advanced.h @@ -388,7 +388,7 @@ extern "C" { int synctex_node_hbox_height(synctex_node_p node); int synctex_node_hbox_depth(synctex_node_p node); - synctex_scanner_p synctex_scanner_new(); + synctex_scanner_p synctex_scanner_new(void); synctex_node_p synctex_node_new(synctex_scanner_p scanner,synctex_node_type_t type); /** diff --git a/synctex_parser_readme.md b/synctex_parser_readme.md index 01c4ccc..99d73b5 100644 --- a/synctex_parser_readme.md +++ b/synctex_parser_readme.md @@ -11,6 +11,8 @@ This file is part of the __SyncTeX__ package. * Remove a `\` character from the name ot 2 test files. * Change variable name `class` to `class_` because the former is a reserved keyword in C++. + * Adding a more portable unused variable management. + * Various cosmetic changes in the source code, including explicit declaration of `void` in forward function declaration. * Changes in version `1.20`