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

Remove mutable keyword by removing const declaration from unused functio... #1415

Merged
merged 1 commit into from
Nov 12, 2013

Conversation

wmtan
Copy link
Contributor

@wmtan wmtan commented Nov 12, 2013

Eliminate static analyzer warning about thread safety by removing the mutable keyword from a data member of
GenHIEvent and removing the const qualifier from the declaration of the function that modifies it.
The function in question was added three years ago and is never called anywhere in CMSSW, so this is clearly harmless.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @wmtan for CMSSW_7_0_X.

Remove mutable keyword by removing const declaration from unused functio...

It involves the following packages:

SimDataFormats/HiGenData

@cmsbuild, @civanch, @nclopezo, @mdhildreth, @giamman can you please review it and eventually sign? Thanks.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@ktf you are the release manager for this.

@civanch
Copy link
Contributor

civanch commented Nov 12, 2013

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next IBs unless changes or unless it breaks tests. @ktf can you please take care of it?

const std::vector<reco::GenParticleRef> getSubEvent(unsigned int sub_id) const;

int getNsubs() const {return subevents_.size();}

private:

mutable SubEventCollection subevents_;
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not change the checksum of the class, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, that variable is stored. However, I'm pretty sure ROOT has no idea about 'mutable' so this won't change the checksum. If it did, scram would complain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the mutable keyword does not change the check sum of the class. This was tested experimentally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking…;) Merging this.

ktf added a commit that referenced this pull request Nov 12, 2013
Multithreading fixes -- Remove mutable keyword by removing const declaration from unused function
@ktf ktf merged commit f4b04d8 into cms-sw:CMSSW_7_0_X Nov 12, 2013
@wmtan wmtan deleted the RemoveMutableKeywordFromHiGenData branch November 12, 2013 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants