{"id":80,"date":"2023-07-17T16:21:48","date_gmt":"2023-07-17T16:21:48","guid":{"rendered":"https:\/\/blogs.scummvm.org\/hax0kartik\/?p=80"},"modified":"2023-07-17T16:29:43","modified_gmt":"2023-07-17T16:29:43","slug":"refactoring-code-and-misc-changes","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/hax0kartik\/2023\/07\/17\/refactoring-code-and-misc-changes\/","title":{"rendered":"Refactoring code and misc. changes"},"content":{"rendered":"<p>Hi all, this week I worked on formatting the code to match the <a href=\"https:\/\/wiki.scummvm.org\/index.php\/Code_Formatting_Conventions\">code formatting conventions<\/a> set by ScummVM. In my opinion, this is a step in the correct direction as it would get the repo in a state where it could potentially be merged into main ScummVM branch.<\/p>\n<p><strong>What needed to be changed?<\/strong><\/p>\n<p>While most of the formatting issues could be fixed by running tooling such as clang-format, others need to be fixed manually. Majority of my commits in the last week have been around converting the function names to camelCase and prefixing member variables with underscore.<\/p>\n<p>Initially, I thought it would be an easy job but once I actually got to it, it turned out to be really taxing and frankly &#8211; boring.<\/p>\n<p>I started out by manually making changes in the class definition,compiling, going through the compilation errors, and then fixing the references and as you can imagine it took a lot of time.I could not shake the feeling that there <em>should<\/em> be some tooling that could help me out and make the process easier. This is where I came across the &#8220;refactoring&#8221; feature in CLion, which could automatically rename\/fix the references. I tried it out and although not perfect, it has definately made the process easier.<\/p>\n<p>As of writing, I have fixed the formatting issues of atleast 5 components &#8211; ai, animation, event, input, and item . Next week, I will be working on fixing the rest of the components. That is all for this week. Thanks for reading!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi all, this week I worked on formatting the code to match the code formatting conventions set by ScummVM. In my opinion, this is a step in the correct direction as it would get the repo in a state where it could potentially be merged into main ScummVM branch. What needed to be changed? While [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":82,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/posts\/80\/revisions\/82"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/hax0kartik\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}