{"action":"created","issue":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/4878","repository_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2","labels_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/4878/labels{/name}","comments_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/4878/comments","events_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/4878/events","html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/4878","id":195651228,"number":4878,"title":"CppCheck fixes","user":{"login":"Broxzier","id":9705046,"avatar_url":"https://avatars.githubusercontent.com/u/9705046?v=3","gravatar_id":"","url":"https://api.github.com/users/Broxzier","html_url":"https://github.com/Broxzier","followers_url":"https://api.github.com/users/Broxzier/followers","following_url":"https://api.github.com/users/Broxzier/following{/other_user}","gists_url":"https://api.github.com/users/Broxzier/gists{/gist_id}","starred_url":"https://api.github.com/users/Broxzier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Broxzier/subscriptions","organizations_url":"https://api.github.com/users/Broxzier/orgs","repos_url":"https://api.github.com/users/Broxzier/repos","events_url":"https://api.github.com/users/Broxzier/events{/privacy}","received_events_url":"https://api.github.com/users/Broxzier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-14T21:31:19Z","updated_at":"2016-12-23T21:30:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/pulls/4878","html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/4878","diff_url":"https://github.com/OpenRCT2/OpenRCT2/pull/4878.diff","patch_url":"https://github.com/OpenRCT2/OpenRCT2/pull/4878.patch"},"body":"I ran CppCheck on the project to find issues and clean up the code a little bit. It's how I found https://github.com/OpenRCT2/OpenRCT2/commit/1935f795074e54ee298b0972657eba6e8f0c493f, and a few other small issues. I used the tool only for checking the files, all changes have been made by hand. Here's what I did:\r\n\r\n- Reduced variable scopes where possible (not all, but quite some)\r\n- Removed unneccesary operations (e.g. second condition in `while (*source == ' ' && *source != '\\0')`)\r\n- Made single-argument constructors explicit, with a few exceptions (e.g. `Nullable`)\r\n- Newline at the end of all source and header files\r\n- Catching exceptions by const reference instead of copies\r\n- Removed unused variables\r\n- Using C++ casts in C++ files\r\n- Fixed a small issue in mapgen.c (`util_rand() % 3` -> `(util_rand() & 3)` for a random rotation)\r\n- Added parentheses around the conditional part of ternary operator\r\n- Ordered some initialzer lists that were out of order\r\n\r\nI've found [one case of undefined behaviour](https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/interface/Theme.cpp#L597) that I want to fix in a separate PR, because it's different from the small changes in here.\r\n\r\nWhile editing some C++ files, I noticed that some use tabs, and some use 4 spaces. For those with tabs I also used tabs."},"comment":{"url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/comments/269047713","html_url":"https://github.com/OpenRCT2/OpenRCT2/pull/4878#issuecomment-269047713","issue_url":"https://api.github.com/repos/OpenRCT2/OpenRCT2/issues/4878","id":269047713,"user":{"login":"janisozaur","id":550290,"avatar_url":"https://avatars.githubusercontent.com/u/550290?v=3","gravatar_id":"","url":"https://api.github.com/users/janisozaur","html_url":"https://github.com/janisozaur","followers_url":"https://api.github.com/users/janisozaur/followers","following_url":"https://api.github.com/users/janisozaur/following{/other_user}","gists_url":"https://api.github.com/users/janisozaur/gists{/gist_id}","starred_url":"https://api.github.com/users/janisozaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janisozaur/subscriptions","organizations_url":"https://api.github.com/users/janisozaur/orgs","repos_url":"https://api.github.com/users/janisozaur/repos","events_url":"https://api.github.com/users/janisozaur/events{/privacy}","received_events_url":"https://api.github.com/users/janisozaur/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T21:30:45Z","updated_at":"2016-12-23T21:30:45Z","body":"@IntelOrca this is for .6, right?"}}
{"actor":{"display_login":"janisozaur"}}