Skip to content

Commit 0ec2e87

Browse files
committed
tectonic: tidy up some Synctex-related pieces
Including a function that returned `int` that was exiting without a specified return value (always amazes me that C lets you do that). It *looks* like the Synctex test is now passing in debug as well as release mode now.
1 parent 64dbb30 commit 0ec2e87

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

tectonic/synctex.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ synctex_init_command(void)
152152
synctex_ctxt.flags.output_p = 0;
153153

154154
INTPAR(synctex) = 0; /* \synctex=0 : don't record stuff */
155-
synctex_ctxt.flags.off = 0; /* we're not forcibly disabled though: user code can override */
156155
}
157156

158157

@@ -698,7 +697,6 @@ synctex_current(void)
698697
static inline int
699698
synctex_record_settings(void)
700699
{
701-
CACHE_THE_EQTB;
702700
int len;
703701

704702
if (NULL == synctex_ctxt.file)
@@ -723,7 +721,7 @@ synctex_record_preamble(void)
723721
int len = ttstub_fprintf(synctex_ctxt.file, "SyncTeX Version:%i\n", SYNCTEX_VERSION);
724722

725723
if (len > 0) {
726-
synctex_ctxt.total_length = len;
724+
synctex_ctxt.total_length = len; /* XXX: should this be `+=`? */
727725
return 0;
728726
}
729727

@@ -751,7 +749,7 @@ synctex_record_anchor(void)
751749
int len = ttstub_fprintf(synctex_ctxt.file, "!%i\n", synctex_ctxt.total_length);
752750

753751
if (len > 0) {
754-
synctex_ctxt.total_length = len;
752+
synctex_ctxt.total_length = len; /* XXX: should this be `+=`? */
755753
++synctex_ctxt.count;
756754
return 0;
757755
}
@@ -765,10 +763,13 @@ synctex_record_content(void)
765763
{
766764
int len = ttstub_fprintf(synctex_ctxt.file, "Content:\n");
767765

768-
if (len > 0)
766+
if (len > 0) {
769767
synctex_ctxt.total_length += len;
770-
else
771-
synctexabort();
768+
return 0;
769+
}
770+
771+
synctexabort();
772+
return -1;
772773
}
773774

774775
static inline int

tectonic/xetexd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ scaled base_x_height;
687687
scaled base_width, base_height;
688688
scaled accent_width, accent_height;
689689
scaled delta;
690-
integer synctex_options;
691690

692691
/*:1683*/
693692

tectonic/xetexini.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3687,7 +3687,7 @@ initialize_primitives(void)
36873687
primitive(S(immediate), EXTENSION, IMMEDIATE_CODE);
36883688
primitive(S(setlanguage), EXTENSION, SET_LANGUAGE_CODE);
36893689

3690-
primitive(S(synctex), ASSIGN_INT, INT_BASE + 83);
3690+
primitive(S(synctex), ASSIGN_INT, INT_BASE + INT_PAR__synctex);
36913691

36923692
no_new_control_sequence = true;
36933693
}
@@ -3730,8 +3730,6 @@ tt_run_engine(char *dump_name, char *input_file_name)
37303730

37313731
/* Not sure why these get custom initializations. */
37323732

3733-
synctex_options = INT_MAX;
3734-
37353733
if (file_line_error_style_p < 0)
37363734
file_line_error_style_p = 0;
37373735

0 commit comments

Comments
 (0)