Skip to content

Commit

Permalink
Unused argument more portable management, and cosmetic changes
Browse files Browse the repository at this point in the history
Change in name and definition.
  • Loading branch information
jlaurens committed Oct 15, 2017
1 parent 19105cd commit 7916f40
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion synctex_main.c
Expand Up @@ -64,7 +64,7 @@
# define _ISOC99_SOURCE /* to get the fmax() prototype */
# endif

# ifdef SYNCTEX_WORK
# ifdef __SYNCTEX_WORK__
# include <synctex_parser_c-auto.h>
/* for inline && HAVE_xxx */
# else
Expand Down
15 changes: 8 additions & 7 deletions synctex_parser.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 <zlib.h>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))) {
Expand Down
2 changes: 1 addition & 1 deletion synctex_parser_advanced.h
Expand Up @@ -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);

/**
Expand Down
2 changes: 2 additions & 0 deletions synctex_parser_readme.md
Expand Up @@ -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`
Expand Down

0 comments on commit 7916f40

Please sign in to comment.