Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrected spelling mistakes in gpssim.c #277

Merged
merged 1 commit into from
Jan 4, 2021
Merged

corrected spelling mistakes in gpssim.c #277

merged 1 commit into from
Jan 4, 2021

Conversation

lenhart
Copy link

@lenhart lenhart commented Jan 4, 2021

some minor spelling fixes in gpssim.c

Plus I discovered 2 things I wanted to ask about before modifying:

  1. while parsing options there is one break in a if conditional. is this deliberate? Line 1823:
case 'T':
			timeoverwrite = TRUE;
			if (strncmp(optarg, "now", 3)==0)
			{
				time_t timer;
				struct tm *gmt;
				
				time(&timer);
				gmt = gmtime(&timer);

				t0.y = gmt->tm_year+1900;
				t0.m = gmt->tm_mon+1;
				t0.d = gmt->tm_mday;
				t0.hh = gmt->tm_hour;
				t0.mm = gmt->tm_min;
				t0.sec = (double)gmt->tm_sec;

				date2gps(&t0, &g0);

				break;  // <------------- this break. should be below } imo
			}

Also I would suggest to mark all deliberate fall-through in switch cases with comments to prevent future errors. I can do that quickly if wanted.

  1. would code simplification be welcomed as PR?
if (azel[1]*R2D > elvMask)
		return (1); // Visible
	// else
	return (0); // Invisible

could be simplified to return (azel[1]*R2D > elvMask); //true if visible, false ow.
that would be a bit simpler but now that I write it, I notice that I thought of returning a bool.. fct is only used once in an if statement though..

Thanks for the good work!

@osqzss osqzss merged commit d361b2c into osqzss:master Jan 4, 2021
@osqzss
Copy link
Owner

osqzss commented Jan 4, 2021

Thanks for the corrections.

@lenhart lenhart deleted the spelling branch January 4, 2021 18:20
@lenhart
Copy link
Author

lenhart commented Jan 4, 2021

Very welcome! Any comments on my question in the initial PR? (especially the break statement). I admit that it isn't the best place to ask unrelated questions in the PR, but I didn't want to open an issue for that question either..

@osqzss
Copy link
Owner

osqzss commented Jan 4, 2021

Thank you for your suggestions. The wrong break location in the parse options is now fixed. For the second suggestion, I'd rather leave it as it is.

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