summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2023-02-23 14:01:33 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2023-02-23 14:01:33 +0000
commitec5021eda6af416ef10dde31ffa2e8eb0e9f1730 (patch)
tree6ebd24255c0365c34b7fce8ac3ff6fcf7c13ea98
parentf5f18bfa51ba09f88ac048ac19681ea5e6003498 (diff)
synctexdir: update from GH
git-svn-id: svn://tug.org/texlive/trunk@66080 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/synctexdir/ChangeLog14
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser.c14
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_utils.c6
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_utils.h6
4 files changed, 30 insertions, 10 deletions
diff --git a/Build/source/texk/web2c/synctexdir/ChangeLog b/Build/source/texk/web2c/synctexdir/ChangeLog
index 3867a486e71..43312b4bb36 100644
--- a/Build/source/texk/web2c/synctexdir/ChangeLog
+++ b/Build/source/texk/web2c/synctexdir/ChangeLog
@@ -1,3 +1,17 @@
+2023-02-23 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ Sync with GH 2020 branch.
+
+ * Changed files (on https://github.com/jlaurens/synctex):
+ synctex_parser.c
+ synctex_parser_utils.c
+ synctex_parser_utils.h
+
+ - Fix compilation on MSVC.
+ https://github.com/jlaurens/synctex/pull/59
+ - Fix some GCC warnings.
+ https://github.com/jlaurens/synctex/pull/57
+
2023-01-19 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
Comparing TL r55094 (by JL) and GH 2020 branch.
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser.c b/Build/source/texk/web2c/synctexdir/synctex_parser.c
index 60988288b85..deb02c8fce5 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser.c
@@ -773,7 +773,6 @@ static synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p re
(char *)_synctex_malloc(reader->size+1); /* one more character for null termination */
if (NULL == reader->start) {
_synctex_error("! malloc error in synctex_reader_init_with_output_file.");
- bailey:
#ifdef SYNCTEX_DEBUG
return reader;
#else
@@ -918,6 +917,7 @@ static void _synctex_free_node(synctex_node_p node) {
* It is not owned by its parent, unless it is its first child.
* This destructor is for all handles.
*/
+/*
static void _synctex_free_handle_old(synctex_node_p handle) {
if (handle) {
_synctex_free_handle_old(__synctex_tree_sibling(handle));
@@ -926,6 +926,7 @@ static void _synctex_free_handle_old(synctex_node_p handle) {
}
return;
}
+*/
static void _synctex_free_handle(synctex_node_p handle) {
if (handle) {
synctex_node_p n = handle;
@@ -3658,7 +3659,7 @@ static char * _synctex_abstract_proxy(synctex_node_p node) {
synctex_node_line(node),
_synctex_data_h(node),
_synctex_data_v(node),
- node,
+ (void*)node, // Fix GCC warning: %p expects a void* according to POSIX
_synctex_node_abstract(N));
}
return abstract;
@@ -3742,7 +3743,7 @@ static char * _synctex_abstract_proxy_hbox(synctex_node_p node) {
synctex_node_width(node),
synctex_node_height(node),
synctex_node_depth(node),
- node
+ (void*)node // Fix GCC warning: %p expects a void* according to POSIX
SYNCTEX_PRINT_CHARINDEX_WHAT);
}
return abstract;
@@ -5490,7 +5491,6 @@ content_loop:
# pragma mark + SCAN KERN
# endif
ns = _synctex_parse_new_kern(scanner);
- continue_scan:
if (ns.status == SYNCTEX_STATUS_OK) {
if (child) {
_synctex_node_set_sibling(child,ns.node);
@@ -7252,7 +7252,7 @@ SYNCTEX_INLINE static synctex_iterator_p _synctex_iterator_new(synctex_node_p re
iterator->count0 = iterator->count = count;
}
return iterator;
-};
+}
void synctex_iterator_free(synctex_iterator_p iterator) {
if (iterator) {
@@ -8434,7 +8434,7 @@ struct synctex_updater_t {
int length; /* the number of chars appended */
};
-__attribute__((__format__ (__printf__, 2, 3)))
+SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(2, 3)
static int _synctex_updater_print(synctex_updater_p updater, const char * format, ...) {
int result = 0;
if (updater) {
@@ -8471,7 +8471,7 @@ static int vasprintf(char **ret,
/**
* gzvprintf is not available until OSX 10.10
*/
-__attribute__((__format__ (__printf__, 2, 3)))
+SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(2, 3)
static int _synctex_updater_print_gz(synctex_updater_p updater, const char * format, ...) {
int result = 0;
if (updater) {
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
index bda378165f4..f1c255eb68f 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
@@ -86,7 +86,7 @@ void _synctex_free(void * ptr) {
# include <syslog.h>
#endif
-__attribute__((__format__ (__printf__, 3, 0)))
+SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(3, 0)
static int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
int result;
# ifdef SYNCTEX_RECENT_WINDOWS
@@ -133,7 +133,7 @@ static int _synctex_log(int level, const char * prompt, const char * reason,va_l
return result;
}
-__attribute__((__format__ (__printf__, 1, 2)))
+SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(1, 2)
int _synctex_error(const char * reason,...) {
va_list arg;
int result;
@@ -147,7 +147,7 @@ int _synctex_error(const char * reason,...) {
return result;
}
-__attribute__((__format__ (__printf__, 1, 2)))
+SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(1, 2)
int _synctex_debug(const char * reason,...) {
va_list arg;
int result;
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h
index 4dd4e17e649..19ab779db0e 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.h
@@ -85,6 +85,12 @@ extern "C" {
# else
# define SYNCTEX_ARE_PATH_CHARACTERS_EQUAL(left,right) (toupper(left) != toupper(right))
# endif
+
+# if defined(_MSC_VER)
+# define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK)
+# else
+# define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) __attribute__((__format__ (__printf__, (STRING_INDEX), (FIRST_TO_CHECK))))
+# endif
/* This custom malloc functions initializes to 0 the newly allocated memory.
* There is no bzero function on windows. */