{"action":"created","comment":{"url":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/comments/81355424","pull_request_review_id":2342172,"id":81355424,"diff_hunk":"@@ -44,6 +44,9 @@ uint32_t Segments::area()\n void Segments::reset()\n {\n     memset(segment, -1, sizeof(uint32_t) * _area);\n+    for (int i = 0; i<seg_data.size(); i++) {","path":"src/segments.cpp","position":4,"original_position":4,"commit_id":"c39dbbeac534d4562fa289eeac4f1614cb7ba40c","original_commit_id":"c39dbbeac534d4562fa289eeac4f1614cb7ba40c","user":{"login":"ftomassetti","id":439078,"avatar_url":"https://avatars.githubusercontent.com/u/439078?v=3","gravatar_id":"","url":"https://api.github.com/users/ftomassetti","html_url":"https://github.com/ftomassetti","followers_url":"https://api.github.com/users/ftomassetti/followers","following_url":"https://api.github.com/users/ftomassetti/following{/other_user}","gists_url":"https://api.github.com/users/ftomassetti/gists{/gist_id}","starred_url":"https://api.github.com/users/ftomassetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftomassetti/subscriptions","organizations_url":"https://api.github.com/users/ftomassetti/orgs","repos_url":"https://api.github.com/users/ftomassetti/repos","events_url":"https://api.github.com/users/ftomassetti/events{/privacy}","received_events_url":"https://api.github.com/users/ftomassetti/received_events","type":"User","site_admin":false},"body":"Linthub is suggesting to put spaces around the < operator","created_at":"2016-09-30T14:59:17Z","updated_at":"2016-09-30T14:59:18Z","html_url":"https://github.com/Mindwerks/plate-tectonics/pull/35#discussion_r81355424","pull_request_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/comments/81355424"},"html":{"href":"https://github.com/Mindwerks/plate-tectonics/pull/35#discussion_r81355424"},"pull_request":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35","id":83717791,"html_url":"https://github.com/Mindwerks/plate-tectonics/pull/35","diff_url":"https://github.com/Mindwerks/plate-tectonics/pull/35.diff","patch_url":"https://github.com/Mindwerks/plate-tectonics/pull/35.patch","issue_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/issues/35","number":35,"state":"open","locked":false,"title":"Fix simulation consistency on MSVC","user":{"login":"pkdawson","id":132955,"avatar_url":"https://avatars.githubusercontent.com/u/132955?v=3","gravatar_id":"","url":"https://api.github.com/users/pkdawson","html_url":"https://github.com/pkdawson","followers_url":"https://api.github.com/users/pkdawson/followers","following_url":"https://api.github.com/users/pkdawson/following{/other_user}","gists_url":"https://api.github.com/users/pkdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/pkdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkdawson/subscriptions","organizations_url":"https://api.github.com/users/pkdawson/orgs","repos_url":"https://api.github.com/users/pkdawson/repos","events_url":"https://api.github.com/users/pkdawson/events{/privacy}","received_events_url":"https://api.github.com/users/pkdawson/received_events","type":"User","site_admin":false},"body":"I was getting wildly different simulation results with Visual C++, using the same seed/parameters that I was using on Linux or OS X. Most of that was caused by the fact that `sizeof(long)` is 4, as opposed to 8 on Clang, GCC, etc.\r\n\r\n`float kc = (seed*seed) % 256;`\r\n\r\nOn this line in particular, the signed 32-bit integer would often overflow into the negatives. Making it explicitly 64-bit keeps behavior consistent across platforms.\r\n\r\nThat mostly fixes it, but I was still seeing subtle inconsistencies. This is harder to explain. For some reason, `sinf` yields different results when MSVC (2013 or 2015) produces a 64-bit binary. For example, with floats expressed as their raw bytes:\r\n\r\n`sinf(5.516943f)` = `0xbf3184cd` on GCC, Clang, and MSVC x86\r\n`sinf(5.516943f)` = `0xbf3184ce` on MSVC x86-64\r\n\r\nTried adjusting some flags, but it didn't help. Using the double version of `sin` and then casting back to float gets the correct results. This solution is a little ugly, but it's the only thing that worked.","created_at":"2016-09-01T22:27:33Z","updated_at":"2016-09-30T14:59:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99efb3a1eae1aa5ad28d4e8e96d8560198b8b4bc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35/commits","review_comments_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35/comments","review_comment_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/issues/35/comments","statuses_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/statuses/c39dbbeac534d4562fa289eeac4f1614cb7ba40c","head":{"label":"pkdawson:master","ref":"master","sha":"c39dbbeac534d4562fa289eeac4f1614cb7ba40c","user":{"login":"pkdawson","id":132955,"avatar_url":"https://avatars.githubusercontent.com/u/132955?v=3","gravatar_id":"","url":"https://api.github.com/users/pkdawson","html_url":"https://github.com/pkdawson","followers_url":"https://api.github.com/users/pkdawson/followers","following_url":"https://api.github.com/users/pkdawson/following{/other_user}","gists_url":"https://api.github.com/users/pkdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/pkdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkdawson/subscriptions","organizations_url":"https://api.github.com/users/pkdawson/orgs","repos_url":"https://api.github.com/users/pkdawson/repos","events_url":"https://api.github.com/users/pkdawson/events{/privacy}","received_events_url":"https://api.github.com/users/pkdawson/received_events","type":"User","site_admin":false},"repo":{"id":67153300,"name":"plate-tectonics","full_name":"pkdawson/plate-tectonics","owner":{"login":"pkdawson","id":132955,"avatar_url":"https://avatars.githubusercontent.com/u/132955?v=3","gravatar_id":"","url":"https://api.github.com/users/pkdawson","html_url":"https://github.com/pkdawson","followers_url":"https://api.github.com/users/pkdawson/followers","following_url":"https://api.github.com/users/pkdawson/following{/other_user}","gists_url":"https://api.github.com/users/pkdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/pkdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkdawson/subscriptions","organizations_url":"https://api.github.com/users/pkdawson/orgs","repos_url":"https://api.github.com/users/pkdawson/repos","events_url":"https://api.github.com/users/pkdawson/events{/privacy}","received_events_url":"https://api.github.com/users/pkdawson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pkdawson/plate-tectonics","description":"A fork of platec http://sourceforge.net/projects/platec/ ","fork":true,"url":"https://api.github.com/repos/pkdawson/plate-tectonics","forks_url":"https://api.github.com/repos/pkdawson/plate-tectonics/forks","keys_url":"https://api.github.com/repos/pkdawson/plate-tectonics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pkdawson/plate-tectonics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pkdawson/plate-tectonics/teams","hooks_url":"https://api.github.com/repos/pkdawson/plate-tectonics/hooks","issue_events_url":"https://api.github.com/repos/pkdawson/plate-tectonics/issues/events{/number}","events_url":"https://api.github.com/repos/pkdawson/plate-tectonics/events","assignees_url":"https://api.github.com/repos/pkdawson/plate-tectonics/assignees{/user}","branches_url":"https://api.github.com/repos/pkdawson/plate-tectonics/branches{/branch}","tags_url":"https://api.github.com/repos/pkdawson/plate-tectonics/tags","blobs_url":"https://api.github.com/repos/pkdawson/plate-tectonics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pkdawson/plate-tectonics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pkdawson/plate-tectonics/git/refs{/sha}","trees_url":"https://api.github.com/repos/pkdawson/plate-tectonics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pkdawson/plate-tectonics/statuses/{sha}","languages_url":"https://api.github.com/repos/pkdawson/plate-tectonics/languages","stargazers_url":"https://api.github.com/repos/pkdawson/plate-tectonics/stargazers","contributors_url":"https://api.github.com/repos/pkdawson/plate-tectonics/contributors","subscribers_url":"https://api.github.com/repos/pkdawson/plate-tectonics/subscribers","subscription_url":"https://api.github.com/repos/pkdawson/plate-tectonics/subscription","commits_url":"https://api.github.com/repos/pkdawson/plate-tectonics/commits{/sha}","git_commits_url":"https://api.github.com/repos/pkdawson/plate-tectonics/git/commits{/sha}","comments_url":"https://api.github.com/repos/pkdawson/plate-tectonics/comments{/number}","issue_comment_url":"https://api.github.com/repos/pkdawson/plate-tectonics/issues/comments{/number}","contents_url":"https://api.github.com/repos/pkdawson/plate-tectonics/contents/{+path}","compare_url":"https://api.github.com/repos/pkdawson/plate-tectonics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pkdawson/plate-tectonics/merges","archive_url":"https://api.github.com/repos/pkdawson/plate-tectonics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pkdawson/plate-tectonics/downloads","issues_url":"https://api.github.com/repos/pkdawson/plate-tectonics/issues{/number}","pulls_url":"https://api.github.com/repos/pkdawson/plate-tectonics/pulls{/number}","milestones_url":"https://api.github.com/repos/pkdawson/plate-tectonics/milestones{/number}","notifications_url":"https://api.github.com/repos/pkdawson/plate-tectonics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pkdawson/plate-tectonics/labels{/name}","releases_url":"https://api.github.com/repos/pkdawson/plate-tectonics/releases{/id}","deployments_url":"https://api.github.com/repos/pkdawson/plate-tectonics/deployments","created_at":"2016-09-01T17:46:50Z","updated_at":"2016-09-01T17:46:53Z","pushed_at":"2016-09-30T14:55:51Z","git_url":"git://github.com/pkdawson/plate-tectonics.git","ssh_url":"git@github.com:pkdawson/plate-tectonics.git","clone_url":"https://github.com/pkdawson/plate-tectonics.git","svn_url":"https://github.com/pkdawson/plate-tectonics","homepage":null,"size":3830,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Mindwerks:master","ref":"master","sha":"52728ec7838a1a6fd83b04b6b9d900a8c825f2b4","user":{"login":"Mindwerks","id":6725881,"avatar_url":"https://avatars.githubusercontent.com/u/6725881?v=3","gravatar_id":"","url":"https://api.github.com/users/Mindwerks","html_url":"https://github.com/Mindwerks","followers_url":"https://api.github.com/users/Mindwerks/followers","following_url":"https://api.github.com/users/Mindwerks/following{/other_user}","gists_url":"https://api.github.com/users/Mindwerks/gists{/gist_id}","starred_url":"https://api.github.com/users/Mindwerks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mindwerks/subscriptions","organizations_url":"https://api.github.com/users/Mindwerks/orgs","repos_url":"https://api.github.com/users/Mindwerks/repos","events_url":"https://api.github.com/users/Mindwerks/events{/privacy}","received_events_url":"https://api.github.com/users/Mindwerks/received_events","type":"Organization","site_admin":false},"repo":{"id":25725698,"name":"plate-tectonics","full_name":"Mindwerks/plate-tectonics","owner":{"login":"Mindwerks","id":6725881,"avatar_url":"https://avatars.githubusercontent.com/u/6725881?v=3","gravatar_id":"","url":"https://api.github.com/users/Mindwerks","html_url":"https://github.com/Mindwerks","followers_url":"https://api.github.com/users/Mindwerks/followers","following_url":"https://api.github.com/users/Mindwerks/following{/other_user}","gists_url":"https://api.github.com/users/Mindwerks/gists{/gist_id}","starred_url":"https://api.github.com/users/Mindwerks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mindwerks/subscriptions","organizations_url":"https://api.github.com/users/Mindwerks/orgs","repos_url":"https://api.github.com/users/Mindwerks/repos","events_url":"https://api.github.com/users/Mindwerks/events{/privacy}","received_events_url":"https://api.github.com/users/Mindwerks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mindwerks/plate-tectonics","description":"A fork of platec http://sourceforge.net/projects/platec/ ","fork":false,"url":"https://api.github.com/repos/Mindwerks/plate-tectonics","forks_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/forks","keys_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/teams","hooks_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/hooks","issue_events_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/issues/events{/number}","events_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/events","assignees_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/assignees{/user}","branches_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/branches{/branch}","tags_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/tags","blobs_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/statuses/{sha}","languages_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/languages","stargazers_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/stargazers","contributors_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/contributors","subscribers_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/subscribers","subscription_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/subscription","commits_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/contents/{+path}","compare_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/merges","archive_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/downloads","issues_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/issues{/number}","pulls_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls{/number}","milestones_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/milestones{/number}","notifications_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/labels{/name}","releases_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/releases{/id}","deployments_url":"https://api.github.com/repos/Mindwerks/plate-tectonics/deployments","created_at":"2014-10-25T08:57:15Z","updated_at":"2016-09-01T05:14:58Z","pushed_at":"2016-09-30T14:55:52Z","git_url":"git://github.com/Mindwerks/plate-tectonics.git","ssh_url":"git@github.com:Mindwerks/plate-tectonics.git","clone_url":"https://github.com/Mindwerks/plate-tectonics.git","svn_url":"https://github.com/Mindwerks/plate-tectonics","homepage":null,"size":5460,"stargazers_count":29,"watchers_count":29,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":12,"forks":6,"open_issues":12,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35"},"html":{"href":"https://github.com/Mindwerks/plate-tectonics/pull/35"},"issue":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/issues/35"},"comments":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/Mindwerks/plate-tectonics/statuses/c39dbbeac534d4562fa289eeac4f1614cb7ba40c"}}}}
{"actor":{"display_login":"ftomassetti"}}