{"action":"created","comment":{"url":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments/36821601","id":36821601,"diff_hunk":"@@ -1258,35 +1265,19 @@ static void callback_dispatcher(ffi_cif *cif, void *ret, void **args, void *user\n \t}\n \n \tif (type == REB_CALLBACK) {\n-\t\tVAL_ROUTINE_CLOSURE(out) = ffi_closure_alloc(sizeof(ffi_closure), (void**)&VAL_ROUTINE_DISPATCHER(out));\n+\t\tVAL_ROUTINE_CLOSURE(out) = ffi_closure_alloc(sizeof(ffi_closure), &VAL_ROUTINE_DISPATCHER(out));\n \t\tif (VAL_ROUTINE_CLOSURE(out) == NULL) {\n \t\t\t//printf(\"No memory\\n\");\n \t\t\tret = FALSE;\n \t\t} else {\n-\t\t\t// !!! Technically you can't cast function pointers to void*\n-\t\t\t//\n-\t\t\t//     http://stackoverflow.com/questions/3941793/\n-\t\t\t//\n-\t\t\t// On non-embedded systems the odds are they're the same size.\n-\t\t\t// But there's no way to get *just* this warning disabled (it's\n-\t\t\t// part of --pedantic).  So to keep the other warnings but\n-\t\t\t// quiet the compiler on this one, we use pass a union big\n-\t\t\t// enough to hold either a function pointer or a void pointer.\n-\t\t\tunion funcptr_and_dataptr {\n-\t\t\t\tCFUNC *func;\n-\t\t\t\tvoid *data;\n-\t\t\t} dispatcher_hack;\n-\n \t\t\tffi_status status;\n \n-\t\t\tdispatcher_hack.func = VAL_ROUTINE_DISPATCHER(out);\n-\n \t\t\tstatus = ffi_prep_closure_loc(\n \t\t\t\tcast(ffi_closure*, VAL_ROUTINE_CLOSURE(out)),\n \t\t\t\tcast(ffi_cif*, VAL_ROUTINE_CIF(out)),\n \t\t\t\tcallback_dispatcher,\n \t\t\t\tVAL_ROUTINE_INFO(out),\n-\t\t\t\t&dispatcher_hack","path":"src/core/t-routine.c","position":108,"original_position":99,"commit_id":"300fad9d3e40b5b3c48d8c24b16efe9f7d7530b6","original_commit_id":"9bea50c341812311f8399a2b2f6f9dcde0ea264e","user":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars.githubusercontent.com/u/20440?v=3","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"body":"C99 and C11 allow for union access:\r\n\r\nhttp://stackoverflow.com/questions/11639947/is-type-punning-through-a-union-unspecified-in-c99-and-has-it-become-specified\r\n\r\nBut I guess if FFI is wanting a void*, and you have void*s at all points with no cast of a function pointer to a void pointer, then things are as good as they're going to be...","created_at":"2015-08-12T02:23:07Z","updated_at":"2015-08-12T02:23:07Z","html_url":"https://github.com/metaeducation/ren-c/pull/37#discussion_r36821601","pull_request_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments/36821601"},"html":{"href":"https://github.com/metaeducation/ren-c/pull/37#discussion_r36821601"},"pull_request":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/metaeducation/ren-c/pulls/37","id":42172082,"html_url":"https://github.com/metaeducation/ren-c/pull/37","diff_url":"https://github.com/metaeducation/ren-c/pull/37.diff","patch_url":"https://github.com/metaeducation/ren-c/pull/37.patch","issue_url":"https://api.github.com/repos/metaeducation/ren-c/issues/37","number":37,"state":"open","locked":false,"title":"Fix the argument to ffi_prep_closure_loc","user":{"login":"zsx","id":1753,"avatar_url":"https://avatars.githubusercontent.com/u/1753?v=3","gravatar_id":"","url":"https://api.github.com/users/zsx","html_url":"https://github.com/zsx","followers_url":"https://api.github.com/users/zsx/followers","following_url":"https://api.github.com/users/zsx/following{/other_user}","gists_url":"https://api.github.com/users/zsx/gists{/gist_id}","starred_url":"https://api.github.com/users/zsx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsx/subscriptions","organizations_url":"https://api.github.com/users/zsx/orgs","repos_url":"https://api.github.com/users/zsx/repos","events_url":"https://api.github.com/users/zsx/events{/privacy}","received_events_url":"https://api.github.com/users/zsx/received_events","type":"User","site_admin":false},"body":"With these fixes and https://github.com/zsx/r3/commit/71c105820c76c32b7da0492b1319ef3e6d8f5b76, qsort.r runs fine","created_at":"2015-08-11T20:11:24Z","updated_at":"2015-08-12T02:23:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c47cd054d5aba7b45a0cbb2db1cd35835b6915aa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/37/commits","review_comments_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/37/comments","review_comment_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metaeducation/ren-c/issues/37/comments","statuses_url":"https://api.github.com/repos/metaeducation/ren-c/statuses/300fad9d3e40b5b3c48d8c24b16efe9f7d7530b6","head":{"label":"zsx:ren-c-ffi","ref":"ren-c-ffi","sha":"300fad9d3e40b5b3c48d8c24b16efe9f7d7530b6","user":{"login":"zsx","id":1753,"avatar_url":"https://avatars.githubusercontent.com/u/1753?v=3","gravatar_id":"","url":"https://api.github.com/users/zsx","html_url":"https://github.com/zsx","followers_url":"https://api.github.com/users/zsx/followers","following_url":"https://api.github.com/users/zsx/following{/other_user}","gists_url":"https://api.github.com/users/zsx/gists{/gist_id}","starred_url":"https://api.github.com/users/zsx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsx/subscriptions","organizations_url":"https://api.github.com/users/zsx/orgs","repos_url":"https://api.github.com/users/zsx/repos","events_url":"https://api.github.com/users/zsx/events{/privacy}","received_events_url":"https://api.github.com/users/zsx/received_events","type":"User","site_admin":false},"repo":{"id":12062189,"name":"r3","full_name":"zsx/r3","owner":{"login":"zsx","id":1753,"avatar_url":"https://avatars.githubusercontent.com/u/1753?v=3","gravatar_id":"","url":"https://api.github.com/users/zsx","html_url":"https://github.com/zsx","followers_url":"https://api.github.com/users/zsx/followers","following_url":"https://api.github.com/users/zsx/following{/other_user}","gists_url":"https://api.github.com/users/zsx/gists{/gist_id}","starred_url":"https://api.github.com/users/zsx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsx/subscriptions","organizations_url":"https://api.github.com/users/zsx/orgs","repos_url":"https://api.github.com/users/zsx/repos","events_url":"https://api.github.com/users/zsx/events{/privacy}","received_events_url":"https://api.github.com/users/zsx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zsx/r3","description":"Rebol (R3) source code","fork":true,"url":"https://api.github.com/repos/zsx/r3","forks_url":"https://api.github.com/repos/zsx/r3/forks","keys_url":"https://api.github.com/repos/zsx/r3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zsx/r3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zsx/r3/teams","hooks_url":"https://api.github.com/repos/zsx/r3/hooks","issue_events_url":"https://api.github.com/repos/zsx/r3/issues/events{/number}","events_url":"https://api.github.com/repos/zsx/r3/events","assignees_url":"https://api.github.com/repos/zsx/r3/assignees{/user}","branches_url":"https://api.github.com/repos/zsx/r3/branches{/branch}","tags_url":"https://api.github.com/repos/zsx/r3/tags","blobs_url":"https://api.github.com/repos/zsx/r3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zsx/r3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zsx/r3/git/refs{/sha}","trees_url":"https://api.github.com/repos/zsx/r3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zsx/r3/statuses/{sha}","languages_url":"https://api.github.com/repos/zsx/r3/languages","stargazers_url":"https://api.github.com/repos/zsx/r3/stargazers","contributors_url":"https://api.github.com/repos/zsx/r3/contributors","subscribers_url":"https://api.github.com/repos/zsx/r3/subscribers","subscription_url":"https://api.github.com/repos/zsx/r3/subscription","commits_url":"https://api.github.com/repos/zsx/r3/commits{/sha}","git_commits_url":"https://api.github.com/repos/zsx/r3/git/commits{/sha}","comments_url":"https://api.github.com/repos/zsx/r3/comments{/number}","issue_comment_url":"https://api.github.com/repos/zsx/r3/issues/comments{/number}","contents_url":"https://api.github.com/repos/zsx/r3/contents/{+path}","compare_url":"https://api.github.com/repos/zsx/r3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zsx/r3/merges","archive_url":"https://api.github.com/repos/zsx/r3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zsx/r3/downloads","issues_url":"https://api.github.com/repos/zsx/r3/issues{/number}","pulls_url":"https://api.github.com/repos/zsx/r3/pulls{/number}","milestones_url":"https://api.github.com/repos/zsx/r3/milestones{/number}","notifications_url":"https://api.github.com/repos/zsx/r3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zsx/r3/labels{/name}","releases_url":"https://api.github.com/repos/zsx/r3/releases{/id}","created_at":"2013-08-12T17:43:55Z","updated_at":"2015-07-07T18:36:26Z","pushed_at":"2015-08-12T01:56:10Z","git_url":"git://github.com/zsx/r3.git","ssh_url":"git@github.com:zsx/r3.git","clone_url":"https://github.com/zsx/r3.git","svn_url":"https://github.com/zsx/r3","homepage":"","size":97198,"stargazers_count":12,"watchers_count":12,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":12,"default_branch":"atronix"}},"base":{"label":"metaeducation:master","ref":"master","sha":"5dc4b48b5f45eb7ea729fba12882a0ed3ff3d37e","user":{"login":"metaeducation","id":8308455,"avatar_url":"https://avatars.githubusercontent.com/u/8308455?v=3","gravatar_id":"","url":"https://api.github.com/users/metaeducation","html_url":"https://github.com/metaeducation","followers_url":"https://api.github.com/users/metaeducation/followers","following_url":"https://api.github.com/users/metaeducation/following{/other_user}","gists_url":"https://api.github.com/users/metaeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/metaeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metaeducation/subscriptions","organizations_url":"https://api.github.com/users/metaeducation/orgs","repos_url":"https://api.github.com/users/metaeducation/repos","events_url":"https://api.github.com/users/metaeducation/events{/privacy}","received_events_url":"https://api.github.com/users/metaeducation/received_events","type":"Organization","site_admin":false},"repo":{"id":35589720,"name":"ren-c","full_name":"metaeducation/ren-c","owner":{"login":"metaeducation","id":8308455,"avatar_url":"https://avatars.githubusercontent.com/u/8308455?v=3","gravatar_id":"","url":"https://api.github.com/users/metaeducation","html_url":"https://github.com/metaeducation","followers_url":"https://api.github.com/users/metaeducation/followers","following_url":"https://api.github.com/users/metaeducation/following{/other_user}","gists_url":"https://api.github.com/users/metaeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/metaeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metaeducation/subscriptions","organizations_url":"https://api.github.com/users/metaeducation/orgs","repos_url":"https://api.github.com/users/metaeducation/repos","events_url":"https://api.github.com/users/metaeducation/events{/privacy}","received_events_url":"https://api.github.com/users/metaeducation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metaeducation/ren-c","description":"Library for embedding a Rebol interpreter into C codebases","fork":true,"url":"https://api.github.com/repos/metaeducation/ren-c","forks_url":"https://api.github.com/repos/metaeducation/ren-c/forks","keys_url":"https://api.github.com/repos/metaeducation/ren-c/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metaeducation/ren-c/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metaeducation/ren-c/teams","hooks_url":"https://api.github.com/repos/metaeducation/ren-c/hooks","issue_events_url":"https://api.github.com/repos/metaeducation/ren-c/issues/events{/number}","events_url":"https://api.github.com/repos/metaeducation/ren-c/events","assignees_url":"https://api.github.com/repos/metaeducation/ren-c/assignees{/user}","branches_url":"https://api.github.com/repos/metaeducation/ren-c/branches{/branch}","tags_url":"https://api.github.com/repos/metaeducation/ren-c/tags","blobs_url":"https://api.github.com/repos/metaeducation/ren-c/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metaeducation/ren-c/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metaeducation/ren-c/git/refs{/sha}","trees_url":"https://api.github.com/repos/metaeducation/ren-c/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metaeducation/ren-c/statuses/{sha}","languages_url":"https://api.github.com/repos/metaeducation/ren-c/languages","stargazers_url":"https://api.github.com/repos/metaeducation/ren-c/stargazers","contributors_url":"https://api.github.com/repos/metaeducation/ren-c/contributors","subscribers_url":"https://api.github.com/repos/metaeducation/ren-c/subscribers","subscription_url":"https://api.github.com/repos/metaeducation/ren-c/subscription","commits_url":"https://api.github.com/repos/metaeducation/ren-c/commits{/sha}","git_commits_url":"https://api.github.com/repos/metaeducation/ren-c/git/commits{/sha}","comments_url":"https://api.github.com/repos/metaeducation/ren-c/comments{/number}","issue_comment_url":"https://api.github.com/repos/metaeducation/ren-c/issues/comments{/number}","contents_url":"https://api.github.com/repos/metaeducation/ren-c/contents/{+path}","compare_url":"https://api.github.com/repos/metaeducation/ren-c/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metaeducation/ren-c/merges","archive_url":"https://api.github.com/repos/metaeducation/ren-c/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metaeducation/ren-c/downloads","issues_url":"https://api.github.com/repos/metaeducation/ren-c/issues{/number}","pulls_url":"https://api.github.com/repos/metaeducation/ren-c/pulls{/number}","milestones_url":"https://api.github.com/repos/metaeducation/ren-c/milestones{/number}","notifications_url":"https://api.github.com/repos/metaeducation/ren-c/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metaeducation/ren-c/labels{/name}","releases_url":"https://api.github.com/repos/metaeducation/ren-c/releases{/id}","created_at":"2015-05-14T03:55:55Z","updated_at":"2015-08-06T10:42:25Z","pushed_at":"2015-08-12T01:56:10Z","git_url":"git://github.com/metaeducation/ren-c.git","ssh_url":"git@github.com:metaeducation/ren-c.git","clone_url":"https://github.com/metaeducation/ren-c.git","svn_url":"https://github.com/metaeducation/ren-c","homepage":"","size":6551,"stargazers_count":12,"watchers_count":12,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":5,"forks":7,"open_issues":5,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/37"},"html":{"href":"https://github.com/metaeducation/ren-c/pull/37"},"issue":{"href":"https://api.github.com/repos/metaeducation/ren-c/issues/37"},"comments":{"href":"https://api.github.com/repos/metaeducation/ren-c/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/metaeducation/ren-c/statuses/300fad9d3e40b5b3c48d8c24b16efe9f7d7530b6"}}}}