{"action":"created","comment":{"url":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/comments/58253045","id":58253045,"diff_hunk":"@@ -379,13 +382,208 @@ void JsonCodec::encodeField(StructSchema::Field field, DynamicValue::Reader inpu\n   encode(input, field.getType(), output);\n }\n \n+namespace {\n+int64_t parseInt64(kj::StringPtr s) {\n+  char *endPtr;\n+  errno = 0;\n+  int64_t value = std::strtoll(s.begin(), &endPtr, 10);\n+  KJ_REQUIRE(endPtr == s.end(), \"String does not contain valid number\", s);\n+  KJ_REQUIRE(errno != ERANGE, \"Value out-of-range\", s);","path":"c++/src/capnp/compat/json.c++","position":28,"original_position":28,"commit_id":"b62da6c57e8946b9c7dfc45ee604bf4d5a08fcab","original_commit_id":"b62da6c57e8946b9c7dfc45ee604bf4d5a08fcab","user":{"login":"katreniak","id":3446570,"avatar_url":"https://avatars.githubusercontent.com/u/3446570?v=3","gravatar_id":"","url":"https://api.github.com/users/katreniak","html_url":"https://github.com/katreniak","followers_url":"https://api.github.com/users/katreniak/followers","following_url":"https://api.github.com/users/katreniak/following{/other_user}","gists_url":"https://api.github.com/users/katreniak/gists{/gist_id}","starred_url":"https://api.github.com/users/katreniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katreniak/subscriptions","organizations_url":"https://api.github.com/users/katreniak/orgs","repos_url":"https://api.github.com/users/katreniak/repos","events_url":"https://api.github.com/users/katreniak/events{/privacy}","received_events_url":"https://api.github.com/users/katreniak/received_events","type":"User","site_admin":false},"body":"I don't see point to complicate the code. Do we really care about strtoll implementation that returns errno==ERANGE  and it does not mean range error? I consider it invalid strtoll implementation. My interpretation is that strltoll is required to not set errno if conversion was successful.\r\n\r\n\r\n","created_at":"2016-04-01T19:08:18Z","updated_at":"2016-04-01T19:08:18Z","html_url":"https://github.com/sandstorm-io/capnproto/pull/297#discussion_r58253045","pull_request_url":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297","_links":{"self":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/comments/58253045"},"html":{"href":"https://github.com/sandstorm-io/capnproto/pull/297#discussion_r58253045"},"pull_request":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297"}}},"pull_request":{"url":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297","id":63849578,"html_url":"https://github.com/sandstorm-io/capnproto/pull/297","diff_url":"https://github.com/sandstorm-io/capnproto/pull/297.diff","patch_url":"https://github.com/sandstorm-io/capnproto/pull/297.patch","issue_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/297","number":297,"state":"open","locked":false,"title":"json: implement decode(... input, DynamicStruct::Builder output)","user":{"login":"katreniak","id":3446570,"avatar_url":"https://avatars.githubusercontent.com/u/3446570?v=3","gravatar_id":"","url":"https://api.github.com/users/katreniak","html_url":"https://github.com/katreniak","followers_url":"https://api.github.com/users/katreniak/followers","following_url":"https://api.github.com/users/katreniak/following{/other_user}","gists_url":"https://api.github.com/users/katreniak/gists{/gist_id}","starred_url":"https://api.github.com/users/katreniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katreniak/subscriptions","organizations_url":"https://api.github.com/users/katreniak/orgs","repos_url":"https://api.github.com/users/katreniak/repos","events_url":"https://api.github.com/users/katreniak/events{/privacy}","received_events_url":"https://api.github.com/users/katreniak/received_events","type":"User","site_admin":false},"body":"* type and field handlers are not implemented yet.\r\n* top level json object must be struct.\r\n\r\nThis code covers the basic use case: to convert json string to capnp struct.","created_at":"2016-03-23T09:02:21Z","updated_at":"2016-04-01T19:08:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e4636ed919b5eb8c41a0851d25e4ed372b4705e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297/commits","review_comments_url":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297/comments","review_comment_url":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/297/comments","statuses_url":"https://api.github.com/repos/sandstorm-io/capnproto/statuses/b62da6c57e8946b9c7dfc45ee604bf4d5a08fcab","head":{"label":"katreniak:bka-jsonDecode","ref":"bka-jsonDecode","sha":"b62da6c57e8946b9c7dfc45ee604bf4d5a08fcab","user":{"login":"katreniak","id":3446570,"avatar_url":"https://avatars.githubusercontent.com/u/3446570?v=3","gravatar_id":"","url":"https://api.github.com/users/katreniak","html_url":"https://github.com/katreniak","followers_url":"https://api.github.com/users/katreniak/followers","following_url":"https://api.github.com/users/katreniak/following{/other_user}","gists_url":"https://api.github.com/users/katreniak/gists{/gist_id}","starred_url":"https://api.github.com/users/katreniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katreniak/subscriptions","organizations_url":"https://api.github.com/users/katreniak/orgs","repos_url":"https://api.github.com/users/katreniak/repos","events_url":"https://api.github.com/users/katreniak/events{/privacy}","received_events_url":"https://api.github.com/users/katreniak/received_events","type":"User","site_admin":false},"repo":{"id":53860148,"name":"capnproto","full_name":"katreniak/capnproto","owner":{"login":"katreniak","id":3446570,"avatar_url":"https://avatars.githubusercontent.com/u/3446570?v=3","gravatar_id":"","url":"https://api.github.com/users/katreniak","html_url":"https://github.com/katreniak","followers_url":"https://api.github.com/users/katreniak/followers","following_url":"https://api.github.com/users/katreniak/following{/other_user}","gists_url":"https://api.github.com/users/katreniak/gists{/gist_id}","starred_url":"https://api.github.com/users/katreniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katreniak/subscriptions","organizations_url":"https://api.github.com/users/katreniak/orgs","repos_url":"https://api.github.com/users/katreniak/repos","events_url":"https://api.github.com/users/katreniak/events{/privacy}","received_events_url":"https://api.github.com/users/katreniak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/katreniak/capnproto","description":"Cap'n Proto serialization/RPC system","fork":true,"url":"https://api.github.com/repos/katreniak/capnproto","forks_url":"https://api.github.com/repos/katreniak/capnproto/forks","keys_url":"https://api.github.com/repos/katreniak/capnproto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/katreniak/capnproto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/katreniak/capnproto/teams","hooks_url":"https://api.github.com/repos/katreniak/capnproto/hooks","issue_events_url":"https://api.github.com/repos/katreniak/capnproto/issues/events{/number}","events_url":"https://api.github.com/repos/katreniak/capnproto/events","assignees_url":"https://api.github.com/repos/katreniak/capnproto/assignees{/user}","branches_url":"https://api.github.com/repos/katreniak/capnproto/branches{/branch}","tags_url":"https://api.github.com/repos/katreniak/capnproto/tags","blobs_url":"https://api.github.com/repos/katreniak/capnproto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/katreniak/capnproto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/katreniak/capnproto/git/refs{/sha}","trees_url":"https://api.github.com/repos/katreniak/capnproto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/katreniak/capnproto/statuses/{sha}","languages_url":"https://api.github.com/repos/katreniak/capnproto/languages","stargazers_url":"https://api.github.com/repos/katreniak/capnproto/stargazers","contributors_url":"https://api.github.com/repos/katreniak/capnproto/contributors","subscribers_url":"https://api.github.com/repos/katreniak/capnproto/subscribers","subscription_url":"https://api.github.com/repos/katreniak/capnproto/subscription","commits_url":"https://api.github.com/repos/katreniak/capnproto/commits{/sha}","git_commits_url":"https://api.github.com/repos/katreniak/capnproto/git/commits{/sha}","comments_url":"https://api.github.com/repos/katreniak/capnproto/comments{/number}","issue_comment_url":"https://api.github.com/repos/katreniak/capnproto/issues/comments{/number}","contents_url":"https://api.github.com/repos/katreniak/capnproto/contents/{+path}","compare_url":"https://api.github.com/repos/katreniak/capnproto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/katreniak/capnproto/merges","archive_url":"https://api.github.com/repos/katreniak/capnproto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/katreniak/capnproto/downloads","issues_url":"https://api.github.com/repos/katreniak/capnproto/issues{/number}","pulls_url":"https://api.github.com/repos/katreniak/capnproto/pulls{/number}","milestones_url":"https://api.github.com/repos/katreniak/capnproto/milestones{/number}","notifications_url":"https://api.github.com/repos/katreniak/capnproto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/katreniak/capnproto/labels{/name}","releases_url":"https://api.github.com/repos/katreniak/capnproto/releases{/id}","deployments_url":"https://api.github.com/repos/katreniak/capnproto/deployments","created_at":"2016-03-14T13:51:59Z","updated_at":"2016-03-14T13:52:01Z","pushed_at":"2016-04-01T07:04:12Z","git_url":"git://github.com/katreniak/capnproto.git","ssh_url":"git@github.com:katreniak/capnproto.git","clone_url":"https://github.com/katreniak/capnproto.git","svn_url":"https://github.com/katreniak/capnproto","homepage":"https://capnproto.org","size":13212,"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":"sandstorm-io:master","ref":"master","sha":"981814ebcc649a80c64b3623c32ad69fddd06cc5","user":{"login":"sandstorm-io","id":7479094,"avatar_url":"https://avatars.githubusercontent.com/u/7479094?v=3","gravatar_id":"","url":"https://api.github.com/users/sandstorm-io","html_url":"https://github.com/sandstorm-io","followers_url":"https://api.github.com/users/sandstorm-io/followers","following_url":"https://api.github.com/users/sandstorm-io/following{/other_user}","gists_url":"https://api.github.com/users/sandstorm-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sandstorm-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandstorm-io/subscriptions","organizations_url":"https://api.github.com/users/sandstorm-io/orgs","repos_url":"https://api.github.com/users/sandstorm-io/repos","events_url":"https://api.github.com/users/sandstorm-io/events{/privacy}","received_events_url":"https://api.github.com/users/sandstorm-io/received_events","type":"Organization","site_admin":false},"repo":{"id":9090933,"name":"capnproto","full_name":"sandstorm-io/capnproto","owner":{"login":"sandstorm-io","id":7479094,"avatar_url":"https://avatars.githubusercontent.com/u/7479094?v=3","gravatar_id":"","url":"https://api.github.com/users/sandstorm-io","html_url":"https://github.com/sandstorm-io","followers_url":"https://api.github.com/users/sandstorm-io/followers","following_url":"https://api.github.com/users/sandstorm-io/following{/other_user}","gists_url":"https://api.github.com/users/sandstorm-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sandstorm-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandstorm-io/subscriptions","organizations_url":"https://api.github.com/users/sandstorm-io/orgs","repos_url":"https://api.github.com/users/sandstorm-io/repos","events_url":"https://api.github.com/users/sandstorm-io/events{/privacy}","received_events_url":"https://api.github.com/users/sandstorm-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sandstorm-io/capnproto","description":"Cap'n Proto serialization/RPC system","fork":false,"url":"https://api.github.com/repos/sandstorm-io/capnproto","forks_url":"https://api.github.com/repos/sandstorm-io/capnproto/forks","keys_url":"https://api.github.com/repos/sandstorm-io/capnproto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sandstorm-io/capnproto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sandstorm-io/capnproto/teams","hooks_url":"https://api.github.com/repos/sandstorm-io/capnproto/hooks","issue_events_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/events{/number}","events_url":"https://api.github.com/repos/sandstorm-io/capnproto/events","assignees_url":"https://api.github.com/repos/sandstorm-io/capnproto/assignees{/user}","branches_url":"https://api.github.com/repos/sandstorm-io/capnproto/branches{/branch}","tags_url":"https://api.github.com/repos/sandstorm-io/capnproto/tags","blobs_url":"https://api.github.com/repos/sandstorm-io/capnproto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sandstorm-io/capnproto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sandstorm-io/capnproto/git/refs{/sha}","trees_url":"https://api.github.com/repos/sandstorm-io/capnproto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sandstorm-io/capnproto/statuses/{sha}","languages_url":"https://api.github.com/repos/sandstorm-io/capnproto/languages","stargazers_url":"https://api.github.com/repos/sandstorm-io/capnproto/stargazers","contributors_url":"https://api.github.com/repos/sandstorm-io/capnproto/contributors","subscribers_url":"https://api.github.com/repos/sandstorm-io/capnproto/subscribers","subscription_url":"https://api.github.com/repos/sandstorm-io/capnproto/subscription","commits_url":"https://api.github.com/repos/sandstorm-io/capnproto/commits{/sha}","git_commits_url":"https://api.github.com/repos/sandstorm-io/capnproto/git/commits{/sha}","comments_url":"https://api.github.com/repos/sandstorm-io/capnproto/comments{/number}","issue_comment_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/comments{/number}","contents_url":"https://api.github.com/repos/sandstorm-io/capnproto/contents/{+path}","compare_url":"https://api.github.com/repos/sandstorm-io/capnproto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sandstorm-io/capnproto/merges","archive_url":"https://api.github.com/repos/sandstorm-io/capnproto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sandstorm-io/capnproto/downloads","issues_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues{/number}","pulls_url":"https://api.github.com/repos/sandstorm-io/capnproto/pulls{/number}","milestones_url":"https://api.github.com/repos/sandstorm-io/capnproto/milestones{/number}","notifications_url":"https://api.github.com/repos/sandstorm-io/capnproto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sandstorm-io/capnproto/labels{/name}","releases_url":"https://api.github.com/repos/sandstorm-io/capnproto/releases{/id}","deployments_url":"https://api.github.com/repos/sandstorm-io/capnproto/deployments","created_at":"2013-03-29T02:38:48Z","updated_at":"2016-04-01T02:01:39Z","pushed_at":"2016-04-01T01:52:09Z","git_url":"git://github.com/sandstorm-io/capnproto.git","ssh_url":"git@github.com:sandstorm-io/capnproto.git","clone_url":"https://github.com/sandstorm-io/capnproto.git","svn_url":"https://github.com/sandstorm-io/capnproto","homepage":"https://capnproto.org","size":14224,"stargazers_count":3383,"watchers_count":3383,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":282,"mirror_url":null,"open_issues_count":51,"forks":282,"open_issues":51,"watchers":3383,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297"},"html":{"href":"https://github.com/sandstorm-io/capnproto/pull/297"},"issue":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/issues/297"},"comments":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/issues/297/comments"},"review_comments":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297/comments"},"review_comment":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/pulls/297/commits"},"statuses":{"href":"https://api.github.com/repos/sandstorm-io/capnproto/statuses/b62da6c57e8946b9c7dfc45ee604bf4d5a08fcab"}}}}