GitHub PullRequestReviewCommentEvent at 2014-10-22 10:58:29
Repository: ethersex
Actor: eku
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ethersex/ethersex/pulls/comments/19205834","id":19205834,"diff_hunk":"@@ -22,53 +22,129 @@\n #include <stdint.h>\n #include \"core/util/string_parsing.h\"\n \n-/* Takes a character strint and an place for the value, and parses the first integer\n+/* Takes a character string and an place for the value, and parses the first integer\n  * after all spaces. If there isn't an integer, it will return 0,\n  * otherwise the number of parsed characters, including the spaces\n  */\n \n-uint8_t \n-next_uint16(char *cmd, uint16_t *value) {\n-    uint8_t found_number = 0;\n-    char *old_cmd = cmd;\n-    *value = 0;\n+uint8_t\n+next_uint16(char *cmd, uint16_t * value)\n+{\n+  uint8_t found_number = 0;\n+  char *old_cmd = cmd;\n+  *value = 0;\n \n-    while (*cmd == ' ') cmd++; /* Strip the spaces before */\n+  while (*cmd == ' ')\n+    cmd++;                      /* Strip the spaces before */\n \n-    while (*cmd >= '0' && *cmd <= '9') {\n-        *value = (*value) * 10 + (*cmd) - '0';\n-        cmd++;\n-        found_number = 1;\n-    }\n+  while (*cmd >= '0' && *cmd <= '9')\n+  {\n+    *value = (*value) * 10 + (*cmd) - '0';\n+    cmd++;\n+    found_number = 1;\n+  }\n \n-    return found_number ? cmd - old_cmd : 0;    \n+  return found_number ? cmd - old_cmd : 0;\n+}\n+\n+uint8_t\n+next_int16(char *cmd, int16_t * value)\n+{\n+  uint8_t found_number = 0, found_negative = 0;\n+  char *old_cmd = cmd;\n+  *value = 0;\n+  while (*cmd == ' ')\n+    cmd++;                      /* Strip the spaces before */\n+  if (*cmd == '-')\n+  {\n+    found_negative = 1;\n+    cmd++;\n+  }\n+  while (*cmd >= '0' && *cmd <= '9')\n+  {\n+    *value = (*value) * 10 + (*cmd) - '0';\n+    cmd++;\n+    found_number = 1;\n+  }\n+  if (found_number && found_negative)\n+    *value *= -1;\n+  return found_number ? cmd - old_cmd : 0;\n }\n \n+/* Takes a character string and an place for the value, and parses the first number\n+* after all spaces. Number can contain decimal point. The returned integer is\n+* a fixpoint integer with fixeddigits decimal places. If there isn't an integer, it will return 0,\n+* otherwise the number of parsed characters, including the spaces\n+*/\n+uint8_t\n+next_int16_fp(char *cmd, int16_t * value, uint8_t fixeddigits)","path":"core/util/string_parsing.c","position":72,"original_position":72,"commit_id":"a013ad8e8fd6c796bbf8d48dd588b25385a1c3ea","original_commit_id":"a013ad8e8fd6c796bbf8d48dd588b25385a1c3ea","user":{"login":"eku","id":418685,"avatar_url":"https://avatars.githubusercontent.com/u/418685?v=2","gravatar_id":"","url":"https://api.github.com/users/eku","html_url":"https://github.com/eku","followers_url":"https://api.github.com/users/eku/followers","following_url":"https://api.github.com/users/eku/following{/other_user}","gists_url":"https://api.github.com/users/eku/gists{/gist_id}","starred_url":"https://api.github.com/users/eku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eku/subscriptions","organizations_url":"https://api.github.com/users/eku/orgs","repos_url":"https://api.github.com/users/eku/repos","events_url":"https://api.github.com/users/eku/events{/privacy}","received_events_url":"https://api.github.com/users/eku/received_events","type":"User","site_admin":false},"body":"I would mark cmd as const and use a temporary copy that is incremented.","created_at":"2014-10-22T10:58:29Z","updated_at":"2014-10-22T10:58:29Z","html_url":"https://github.com/ethersex/ethersex/pull/367#discussion_r19205834","pull_request_url":"https://api.github.com/repos/ethersex/ethersex/pulls/367","_links":{"self":{"href":"https://api.github.com/repos/ethersex/ethersex/pulls/comments/19205834"},"html":{"href":"https://github.com/ethersex/ethersex/pull/367#discussion_r19205834"},"pull_request":{"href":"https://api.github.com/repos/ethersex/ethersex/pulls/367"}}},"pull_request":{"url":"https://api.github.com/repos/ethersex/ethersex/pulls/367","id":23099767,"html_url":"https://github.com/ethersex/ethersex/pull/367","diff_url":"https://github.com/ethersex/ethersex/pull/367.diff","patch_url":"https://github.com/ethersex/ethersex/pull/367.patch","issue_url":"https://api.github.com/repos/ethersex/ethersex/issues/367","number":367,"state":"open","locked":false,"title":"Make itoa_fixpoint save: add buffer lenght param","user":{"login":"AnDann","id":5374645,"avatar_url":"https://avatars.githubusercontent.com/u/5374645?v=2","gravatar_id":"","url":"https://api.github.com/users/AnDann","html_url":"https://github.com/AnDann","followers_url":"https://api.github.com/users/AnDann/followers","following_url":"https://api.github.com/users/AnDann/following{/other_user}","gists_url":"https://api.github.com/users/AnDann/gists{/gist_id}","starred_url":"https://api.github.com/users/AnDann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnDann/subscriptions","organizations_url":"https://api.github.com/users/AnDann/orgs","repos_url":"https://api.github.com/users/AnDann/repos","events_url":"https://api.github.com/users/AnDann/events{/privacy}","received_events_url":"https://api.github.com/users/AnDann/received_events","type":"User","site_admin":false},"body":"Add string parsing for fixpoint int16 and int16","created_at":"2014-10-21T16:42:03Z","updated_at":"2014-10-22T10:58:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abe3c12b4fd05479eed3dfaec649ee8cdaa15e8c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ethersex/ethersex/pulls/367/commits","review_comments_url":"https://api.github.com/repos/ethersex/ethersex/pulls/367/comments","review_comment_url":"https://api.github.com/repos/ethersex/ethersex/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ethersex/ethersex/issues/367/comments","statuses_url":"https://api.github.com/repos/ethersex/ethersex/statuses/a013ad8e8fd6c796bbf8d48dd588b25385a1c3ea","head":{"label":"AnDann:fixpoint","ref":"fixpoint","sha":"a013ad8e8fd6c796bbf8d48dd588b25385a1c3ea","user":{"login":"AnDann","id":5374645,"avatar_url":"https://avatars.githubusercontent.com/u/5374645?v=2","gravatar_id":"","url":"https://api.github.com/users/AnDann","html_url":"https://github.com/AnDann","followers_url":"https://api.github.com/users/AnDann/followers","following_url":"https://api.github.com/users/AnDann/following{/other_user}","gists_url":"https://api.github.com/users/AnDann/gists{/gist_id}","starred_url":"https://api.github.com/users/AnDann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnDann/subscriptions","organizations_url":"https://api.github.com/users/AnDann/orgs","repos_url":"https://api.github.com/users/AnDann/repos","events_url":"https://api.github.com/users/AnDann/events{/privacy}","received_events_url":"https://api.github.com/users/AnDann/received_events","type":"User","site_admin":false},"repo":{"id":12569201,"name":"ethersex","full_name":"AnDann/ethersex","owner":{"login":"AnDann","id":5374645,"avatar_url":"https://avatars.githubusercontent.com/u/5374645?v=2","gravatar_id":"","url":"https://api.github.com/users/AnDann","html_url":"https://github.com/AnDann","followers_url":"https://api.github.com/users/AnDann/followers","following_url":"https://api.github.com/users/AnDann/following{/other_user}","gists_url":"https://api.github.com/users/AnDann/gists{/gist_id}","starred_url":"https://api.github.com/users/AnDann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnDann/subscriptions","organizations_url":"https://api.github.com/users/AnDann/orgs","repos_url":"https://api.github.com/users/AnDann/repos","events_url":"https://api.github.com/users/AnDann/events{/privacy}","received_events_url":"https://api.github.com/users/AnDann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AnDann/ethersex","description":"Module for access to BoilerSystemBus (BSB)","fork":true,"url":"https://api.github.com/repos/AnDann/ethersex","forks_url":"https://api.github.com/repos/AnDann/ethersex/forks","keys_url":"https://api.github.com/repos/AnDann/ethersex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnDann/ethersex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnDann/ethersex/teams","hooks_url":"https://api.github.com/repos/AnDann/ethersex/hooks","issue_events_url":"https://api.github.com/repos/AnDann/ethersex/issues/events{/number}","events_url":"https://api.github.com/repos/AnDann/ethersex/events","assignees_url":"https://api.github.com/repos/AnDann/ethersex/assignees{/user}","branches_url":"https://api.github.com/repos/AnDann/ethersex/branches{/branch}","tags_url":"https://api.github.com/repos/AnDann/ethersex/tags","blobs_url":"https://api.github.com/repos/AnDann/ethersex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnDann/ethersex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnDann/ethersex/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnDann/ethersex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnDann/ethersex/statuses/{sha}","languages_url":"https://api.github.com/repos/AnDann/ethersex/languages","stargazers_url":"https://api.github.com/repos/AnDann/ethersex/stargazers","contributors_url":"https://api.github.com/repos/AnDann/ethersex/contributors","subscribers_url":"https://api.github.com/repos/AnDann/ethersex/subscribers","subscription_url":"https://api.github.com/repos/AnDann/ethersex/subscription","commits_url":"https://api.github.com/repos/AnDann/ethersex/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnDann/ethersex/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnDann/ethersex/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnDann/ethersex/issues/comments/{number}","contents_url":"https://api.github.com/repos/AnDann/ethersex/contents/{+path}","compare_url":"https://api.github.com/repos/AnDann/ethersex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnDann/ethersex/merges","archive_url":"https://api.github.com/repos/AnDann/ethersex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnDann/ethersex/downloads","issues_url":"https://api.github.com/repos/AnDann/ethersex/issues{/number}","pulls_url":"https://api.github.com/repos/AnDann/ethersex/pulls{/number}","milestones_url":"https://api.github.com/repos/AnDann/ethersex/milestones{/number}","notifications_url":"https://api.github.com/repos/AnDann/ethersex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnDann/ethersex/labels{/name}","releases_url":"https://api.github.com/repos/AnDann/ethersex/releases{/id}","created_at":"2013-09-03T16:37:01Z","updated_at":"2014-07-31T16:16:11Z","pushed_at":"2014-10-21T18:50:19Z","git_url":"git://github.com/AnDann/ethersex.git","ssh_url":"git@github.com:AnDann/ethersex.git","clone_url":"https://github.com/AnDann/ethersex.git","svn_url":"https://github.com/AnDann/ethersex","homepage":"http://www.ethersex.de","size":11430,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":false,"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":"ethersex:master","ref":"master","sha":"8171a04b6f8b2fce5051edc96668b1d979476fc9","user":{"login":"ethersex","id":113061,"avatar_url":"https://avatars.githubusercontent.com/u/113061?v=2","gravatar_id":"","url":"https://api.github.com/users/ethersex","html_url":"https://github.com/ethersex","followers_url":"https://api.github.com/users/ethersex/followers","following_url":"https://api.github.com/users/ethersex/following{/other_user}","gists_url":"https://api.github.com/users/ethersex/gists{/gist_id}","starred_url":"https://api.github.com/users/ethersex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethersex/subscriptions","organizations_url":"https://api.github.com/users/ethersex/orgs","repos_url":"https://api.github.com/users/ethersex/repos","events_url":"https://api.github.com/users/ethersex/events{/privacy}","received_events_url":"https://api.github.com/users/ethersex/received_events","type":"Organization","site_admin":false},"repo":{"id":272080,"name":"ethersex","full_name":"ethersex/ethersex","owner":{"login":"ethersex","id":113061,"avatar_url":"https://avatars.githubusercontent.com/u/113061?v=2","gravatar_id":"","url":"https://api.github.com/users/ethersex","html_url":"https://github.com/ethersex","followers_url":"https://api.github.com/users/ethersex/followers","following_url":"https://api.github.com/users/ethersex/following{/other_user}","gists_url":"https://api.github.com/users/ethersex/gists{/gist_id}","starred_url":"https://api.github.com/users/ethersex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethersex/subscriptions","organizations_url":"https://api.github.com/users/ethersex/orgs","repos_url":"https://api.github.com/users/ethersex/repos","events_url":"https://api.github.com/users/ethersex/events{/privacy}","received_events_url":"https://api.github.com/users/ethersex/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethersex/ethersex","description":"etherrape port towards IPv6","fork":false,"url":"https://api.github.com/repos/ethersex/ethersex","forks_url":"https://api.github.com/repos/ethersex/ethersex/forks","keys_url":"https://api.github.com/repos/ethersex/ethersex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethersex/ethersex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethersex/ethersex/teams","hooks_url":"https://api.github.com/repos/ethersex/ethersex/hooks","issue_events_url":"https://api.github.com/repos/ethersex/ethersex/issues/events{/number}","events_url":"https://api.github.com/repos/ethersex/ethersex/events","assignees_url":"https://api.github.com/repos/ethersex/ethersex/assignees{/user}","branches_url":"https://api.github.com/repos/ethersex/ethersex/branches{/branch}","tags_url":"https://api.github.com/repos/ethersex/ethersex/tags","blobs_url":"https://api.github.com/repos/ethersex/ethersex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethersex/ethersex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethersex/ethersex/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethersex/ethersex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethersex/ethersex/statuses/{sha}","languages_url":"https://api.github.com/repos/ethersex/ethersex/languages","stargazers_url":"https://api.github.com/repos/ethersex/ethersex/stargazers","contributors_url":"https://api.github.com/repos/ethersex/ethersex/contributors","subscribers_url":"https://api.github.com/repos/ethersex/ethersex/subscribers","subscription_url":"https://api.github.com/repos/ethersex/ethersex/subscription","commits_url":"https://api.github.com/repos/ethersex/ethersex/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethersex/ethersex/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethersex/ethersex/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethersex/ethersex/issues/comments/{number}","contents_url":"https://api.github.com/repos/ethersex/ethersex/contents/{+path}","compare_url":"https://api.github.com/repos/ethersex/ethersex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethersex/ethersex/merges","archive_url":"https://api.github.com/repos/ethersex/ethersex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethersex/ethersex/downloads","issues_url":"https://api.github.com/repos/ethersex/ethersex/issues{/number}","pulls_url":"https://api.github.com/repos/ethersex/ethersex/pulls{/number}","milestones_url":"https://api.github.com/repos/ethersex/ethersex/milestones{/number}","notifications_url":"https://api.github.com/repos/ethersex/ethersex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethersex/ethersex/labels{/name}","releases_url":"https://api.github.com/repos/ethersex/ethersex/releases{/id}","created_at":"2009-08-07T22:00:44Z","updated_at":"2014-10-01T08:22:11Z","pushed_at":"2014-10-17T10:25:13Z","git_url":"git://github.com/ethersex/ethersex.git","ssh_url":"git@github.com:ethersex/ethersex.git","clone_url":"https://github.com/ethersex/ethersex.git","svn_url":"https://github.com/ethersex/ethersex","homepage":"http://www.ethersex.de","size":13559,"stargazers_count":141,"watchers_count":141,"language":"C","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":133,"mirror_url":null,"open_issues_count":42,"forks":133,"open_issues":42,"watchers":141,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ethersex/ethersex/pulls/367"},"html":{"href":"https://github.com/ethersex/ethersex/pull/367"},"issue":{"href":"https://api.github.com/repos/ethersex/ethersex/issues/367"},"comments":{"href":"https://api.github.com/repos/ethersex/ethersex/issues/367/comments"},"review_comments":{"href":"https://api.github.com/repos/ethersex/ethersex/pulls/367/comments"},"review_comment":{"href":"https://api.github.com/repos/ethersex/ethersex/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ethersex/ethersex/pulls/367/commits"},"statuses":{"href":"https://api.github.com/repos/ethersex/ethersex/statuses/a013ad8e8fd6c796bbf8d48dd588b25385a1c3ea"}}}}