Skip to content

More warning fixes and some cleanups - #83

Merged
pkgw merged 9 commits into
tectonic-typesetting:masterfrom
ronnychevalier:rc/warnings-fixes-cleanups
Jun 9, 2017
Merged

More warning fixes and some cleanups#83
pkgw merged 9 commits into
tectonic-typesetting:masterfrom
ronnychevalier:rc/warnings-fixes-cleanups

Conversation

@ronnychevalier

Copy link
Copy Markdown
Contributor

No description provided.

-Wunused-variable -Wunused-but-set-variable
No need to use argc & argv[] and its parsing, use explicit arguments
instead. Thus, we do not call do_early_args and do_args anymore and we
can remove do_early_args.

The for loop about the `verbose` variable is left and some bool
variables are left in case it used later. It could also be removed
easily if needed.

@pkgw pkgw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for doing more of this cleanup! A few small comments below.

Comment thread tectonic/dpx-pdfparse.c Outdated
}

dpx_warning("Not a boolean object.");
dpx_warning("Not a bool object.");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit, but I think this one should be kept as-is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment thread tectonic/dpx-spc_tpic.c Outdated
/* state */
double pen_size;
int fill_shape; /* boolean */
int fill_shape; /* bool */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too ... or turn it into an actual bool if convenient?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I added an additional commit to change two variables (including this one) from int to bool in this file.

Comment thread tectonic/dpx-dvipdfmx.c

/* End config file fakery. */

do_args (argc, argv, NULL, 0);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the do_args function now be removed? I'm not seeing it show up in the diff.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a the moment unfortunately.read_config_special calls do_args. This function is used in dpx-dvi.c, it seems like it is possible to put additional command arguments in the dvi itself, which is then processed and it calls the do_args eventually again.

I am not sure if such feature is really used, so I took the safe choice to keep it. But we could investigate a bit more to know whether or not we could remove all of this.

The bool type already exists in stdbool.h, so let's use it.
stdbool.h already defines true and false so no need to use TRUE & FALSE
macro in the first place.
Such macro, however, were never used in the source code so let's remove
them.
Introduced in 014a411

r < 0 is always false otherwise...
@ronnychevalier
ronnychevalier force-pushed the rc/warnings-fixes-cleanups branch from 66389fe to 1a6ab65 Compare June 9, 2017 16:16
@ronnychevalier

Copy link
Copy Markdown
Contributor Author

Fixed. I also added 2 additional fixes.

@pkgw

pkgw commented Jun 9, 2017

Copy link
Copy Markdown
Collaborator

Looks good!

@pkgw
pkgw merged commit f046d49 into tectonic-typesetting:master Jun 9, 2017
Mrmaxmeier pushed a commit to Mrmaxmeier/tectonic that referenced this pull request Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants