Created attachment 80536 [details] Complete cppcheck report Hello, I launched cppcheck git updated today on poppler git updated today. There are false positives but some may interest you, eg: [poppler/UTF.cc:104]: (error) Mismatching allocation and deallocation: utf16 [qt4/src/poppler-private.h:90]: (error) Mismatching allocation and deallocation: fileName [splash/Splash.cc:3802] -> [splash/Splash.cc:3802]: (style) Same expression on both sides of '||' [utils/HtmlOutputDev.cc:1704]: (error) Memory leak: str [poppler/Annot.cc:3161] -> [poppler/Annot.cc:3159]: (style) Found duplicate branches for 'if' and 'else'. [poppler/Annot.cc:3859] -> [poppler/Annot.cc:3857]: (style) Found duplicate branches for 'if' and 'else'. etc. Julien PS : sorry, I selected "utils" for component but I launched cppcheck on the whole project.
Created attachment 80537 [details] [review] Fix Prefer ++ op Here's a patch for "Prefer prefix ++/-- operators for non-primitive types"
Created attachment 80538 [details] [review] Patch for mismatching alloc/dealloc Here's a patch for: [poppler/UTF.cc:104]: (error) Mismatching allocation and deallocation: utf16 [qt4/src/poppler-private.h:90]: (error) Mismatching allocation and deallocation: fileName
Created attachment 80539 [details] [review] patch for a memory leak
I've commited the patches you've attached the other style fixes you mention look "ok" to be honest. Thanks!
Thank you Albert for your quick feedback. However, there are still some like these: [splash/Splash.cc:3802] -> [splash/Splash.cc:3802]: (style) Same expression on both sides of '||' [utils/HtmlOutputDev.cc:1704]: (error) Memory leak: str [poppler/Annot.cc:3161] -> [poppler/Annot.cc:3159]: (style) Found duplicate branches for 'if' and 'else'. [poppler/Annot.cc:3859] -> [poppler/Annot.cc:3857]: (style) Found duplicate branches for 'if' and 'else'. which may not only style problem. (on the contrary of Reduce scope, casting, etc). I'll try to send other patches in the next days for style. (except casts because I never know when to use dynamic cast vs static cast for eg)
splash/Splash.cc:3802 i checked and yes, given the value of yp the second part of the if is not needed, but helps "mentally" utils/HtmlOutputDev.cc:1704 you fixed in "patch for a memory leak" poppler/Annot.cc:3161 looks like a false positive to me poppler/Annot.cc:3859 is an unimplemented feature
Oups, sorry for memleak, I thought about removing this after copy paste but finally forgot :-) Ok for the rest.
Albert: I'm running a new cppcheck scan, just for my information, is "hb-old" sub directory really used or should it be removed?
oups sorry for my last comment
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.