Skip to content

Conversation

jtanx
Copy link
Contributor

@jtanx jtanx commented Jan 21, 2022

Most of this work was done months ago and a lot of the fixes automated away with some scripting.

This addresses all the warnings at -Wall with my version of gcc. Would also like to tackle Wextra at some point, but this is plenty big as is. Having said that, the changes should all be straightforward, especially if observed commit by commit.

Fixes at least one case of UB.

Type of change

  • Bug fix
  • Non-breaking change

@lgtm-com
Copy link

lgtm-com bot commented Jan 21, 2022

This pull request introduces 1 alert and fixes 3 when merging e8d8980 into 2f86e36 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

fixed alerts:

  • 2 for Missing return statement
  • 1 for Local variable hides global variable

Comment on lines +1565 to +1566
// FIXME Where to set?
// memcpy(ent->u.splines.stroke.dashes,dashes,sizeof(dashes));
Copy link
Member

@ctrlcctrlv ctrlcctrlv Jan 29, 2022

Choose a reason for hiding this comment

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

Note: the bot above (@lgtm-com) is registering a new FIXME…I don't know how to use its website and don't care to learn so I checked out 2f86e36 of jtanx/fontforge cf2 branch and then compared it to HEAD (jtanx/fontforge@e8d8980). It's right here. I thought it was probably a bug but it's not, @jtanx really added a FIXME. Probably does not matter, would be good to fix in ideal world, which we don't live in. But, in case anyone else wants to know what bot is complaining about, this is it.

@jtanx jtanx mentioned this pull request Feb 1, 2022
@jtanx jtanx added this to the 2022 q1 milestone Feb 1, 2022
@skef
Copy link
Contributor

skef commented Feb 3, 2022

@jtanx can you give me a primer or a pointer on BAD_CAST? It doesn't seem to be defined in the repo and I haven't yet turned up a reference to it elsewhere. (std::bad_cast from c++ seems unrelated.)

@jtanx
Copy link
Contributor Author

jtanx commented Feb 3, 2022

It's a thing from libxml2, probably something to do with unicode support and preventing implicit casts of probably ansi byte strings to what should be utf-8

Edit: ref - http://xmlsoft.org/html/libxml-xmlstring.html#BAD_CAST

@skef
Copy link
Contributor

skef commented Feb 3, 2022

Ah, OK.

@skef
Copy link
Contributor

skef commented Feb 3, 2022

If/when you resolve the ggdkdraw.c conflict with the since-merged stuff I'll approve this. I didn't look at every line but I assumed the commit comments were accurate and looked at the commits that seemed more likely to introduce a problem. Looked fine to me.

@frank-trampe
Copy link
Contributor

That seems reasonable to me. I was going to try to do every line, but there are a lot of lines!

@lgtm-com
Copy link

lgtm-com bot commented Feb 5, 2022

This pull request introduces 1 alert and fixes 3 when merging 6ad626c into f7a36cc - view on LGTM.com

new alerts:

  • 1 for FIXME comment

fixed alerts:

  • 2 for Missing return statement
  • 1 for Local variable hides global variable

Copy link
Contributor

@skef skef left a comment

Choose a reason for hiding this comment

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

LGTM

@skef
Copy link
Contributor

skef commented Feb 5, 2022

I approved this, but we may want to think about what order to merge it in compared with @linusromer's changes. Not sure we want to create a lot of merge/cleanup work for him.

@@ -2911,7 +2911,7 @@ void SplineSetAddInflections(SplineChar *sc, SplineSet *ss, int anysel) {
Spline *s, *first;
first = NULL;
for ( s = ss->first->next; s!=NULL && s!=first; s = s->to->next ) {
if ( !anysel || s->from->selected && s->to->selected )
if ( !anysel || (s->from->selected && s->to->selected) )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@linusromer just confirming that this is the intended behaviour?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, either nothing is selected or both endpoints are selected. I thought that a || b && c is equivalent to a || (b && c) but I may be misled by other programming languages.

@lgtm-com
Copy link

lgtm-com bot commented Feb 21, 2022

This pull request introduces 1 alert and fixes 3 when merging 7b7f763 into 6d63889 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

fixed alerts:

  • 2 for Missing return statement
  • 1 for Local variable hides global variable

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.

5 participants