Merged
Conversation
In this commit I have done the following:
. In lime.h:
. Added macros for the LAMBDA identification integers for collision partners.
. In the function molinit():
. Changed the name 'count' (which must win some sort of an obscurity prize) to
'collPartIDs'.
. Added an 's' to the name 'collpartname'.
. Added a variable sizeI=200, dimensioned 'string' to this size, and read this many
characters into 'string' with each fget.
. Added a test for buffer overflow in reading the comment line of the collision
partner ID, with an orderly exception for such cases.
. Made use of the LAMBDA macros to make the choice for calculating nmol a bit more
clear.
| fgets(string, sizeI, fp); | ||
| fscanf(fp,"%d\n", &collPartIDs[ipart]); | ||
|
|
||
| /* We want to test if the comment after the coll partner ID number is longer than the buffer size. To do this, we write a character - any character, as long as it is not \0 - to the last element of the buffer: |
Contributor
There was a problem hiding this comment.
Is the comment after the collisional partner ID number used elsewhere in the code?
Contributor
Author
There was a problem hiding this comment.
No. The intent of this elaborate check is purely to avoid a cock-up if the comment line exceeds the buffer length. It is essentially an error trap.
Contributor
|
Looks good to me, thanks. Could you please resolve the conflicts so I can merge the PR? |
Contributor
Author
|
It's ready. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this commit I have done the following:
count(which must win some sort of an obscurity prize) tocollPartIDs.sto the namecollpartname.sizeI=200, dimensionedstringto this size, and read this manycharacters into
stringwith each fget.partner ID, with an orderly exception for such cases.
nmola bit moreclear.