{"action":"created","comment":{"url":"https://api.github.com/repos/radare/radare2/pulls/comments/75217334","id":75217334,"diff_hunk":"@@ -1079,22 +1089,64 @@ int r_print_format_struct_size(const char *f, RPrint *p, int mode) {\n \t\t\t{\n \t\t\tconst char *format = NULL;\n \t\t\tchar *endname = NULL, *structname = NULL;\n+\t\t\tchar tmp = 0;\n \t\t\tstructname = strdup (r_str_word_get0 (args, idx));\n \t\t\tif (*structname == '(') {\n-\t\t\t\tendname = strchr (structname, ')');\n+\t\t\t\tendname = strrchr (structname, ')');\n \t\t\t} else {\n \t\t\t\teprintf (\"Struct name missing (%s)\\n\", structname);\n \t\t\t\tfree (structname);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif (endname) *endname = '\\0';\n-\t\t\tformat = r_strht_get (p->formats, structname + 1);\n-\t\t\tfree (structname);\n+\t\t\tformat = strchr (structname, ' ');\n+\t\t\tif (format) {\n+\t\t\t\ttmp = *format;\n+\t\t\t\twhile (tmp == ' ') {\n+\t\t\t\t\tformat++;\n+\t\t\t\t\ttmp = *format;\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tformat = r_strht_get (p->formats, structname + 1);\n+\t\t\t}\n \t\t\tsize += tabsize * r_print_format_struct_size (format, p, mode);\n+\t\t\tfree (structname);\n \t\t\t}\n \t\t\tbreak;\n-\t\t\t// TODO continue list\n+\t\tcase '{':\n+\t\t\twhile (fmt[i] != '}') {\n+\t\t\t\ti++;\n+\t\t\t}\n+\t\t\ti++;\n+\t\t\tidx--;\n+\t\t\tbreak;\n+\t\tcase '}':\n+\t\t\tfree (o);\n+\t\t\tfree (args);\n+\t\t\treturn -1;\n+\t\t\tbreak;\n+\t\tcase '+':\n+\t\tcase 'e':\n+\t\t\tidx--;\n+\t\t\tbreak;\n+\t\tcase 'p':\n+\t\t\tif (fmt[i+1] == '2') {","path":"libr/util/p_format.c","position":107,"original_position":107,"commit_id":"9f8736643b5597fc84841e7e32ed98971dfdb27d","original_commit_id":"96365d8ce8d4f28f3ddef148e49729f044df1a20","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"body":"use braces in oneliners, this is how we decided to code after 1 year of discussions :P and the code style is slowly changing towards this\n\n\n\n> On 17 Aug 2016, at 22:28, Jaime Peñalba <notifications@github.com> wrote:\n> \n> In libr/util/p_format.c <https://github.com/radare/radare2/pull/5547#discussion_r75200353>:\n> \n> > +\t\t\t\ti++;\n> > +\t\t\t}\n> > +\t\t\ti++;\n> > +\t\t\tidx--;\n> > +\t\t\tbreak;\n> > +\t\tcase '}':\n> > +\t\t\tfree (o);\n> > +\t\t\tfree (args);\n> > +\t\t\treturn -1;\n> > +\t\t\tbreak;\n> > +\t\tcase '+':\n> > +\t\tcase 'e':\n> > +\t\t\tidx--;\n> > +\t\t\tbreak;\n> > +\t\tcase 'p':\n> > +\t\t\tif (fmt[i+1] == '2') {\n> Do not use braces for one line statements\n> \n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub <https://github.com/radare/radare2/pull/5547/files/96365d8ce8d4f28f3ddef148e49729f044df1a20#r75200353>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AA3-lrt9EwnYDke9oO8mdUuGE8w6N3RNks5qg27ggaJpZM4Jm2Tj>.\n> \n\n","created_at":"2016-08-17T22:12:20Z","updated_at":"2016-08-17T22:12:20Z","html_url":"https://github.com/radare/radare2/pull/5547#discussion_r75217334","pull_request_url":"https://api.github.com/repos/radare/radare2/pulls/5547","_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments/75217334"},"html":{"href":"https://github.com/radare/radare2/pull/5547#discussion_r75217334"},"pull_request":{"href":"https://api.github.com/repos/radare/radare2/pulls/5547"}}},"pull_request":{"url":"https://api.github.com/repos/radare/radare2/pulls/5547","id":81709978,"html_url":"https://github.com/radare/radare2/pull/5547","diff_url":"https://github.com/radare/radare2/pull/5547.diff","patch_url":"https://github.com/radare/radare2/pull/5547.patch","issue_url":"https://api.github.com/repos/radare/radare2/issues/5547","number":5547,"state":"open","locked":false,"title":"anon pf struct","user":{"login":"P4N74","id":11134594,"avatar_url":"https://avatars.githubusercontent.com/u/11134594?v=3","gravatar_id":"","url":"https://api.github.com/users/P4N74","html_url":"https://github.com/P4N74","followers_url":"https://api.github.com/users/P4N74/followers","following_url":"https://api.github.com/users/P4N74/following{/other_user}","gists_url":"https://api.github.com/users/P4N74/gists{/gist_id}","starred_url":"https://api.github.com/users/P4N74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P4N74/subscriptions","organizations_url":"https://api.github.com/users/P4N74/orgs","repos_url":"https://api.github.com/users/P4N74/repos","events_url":"https://api.github.com/users/P4N74/events{/privacy}","received_events_url":"https://api.github.com/users/P4N74/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-17T20:22:51Z","updated_at":"2016-08-17T22:12:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39f81167d7ebcc83b3381526e03cbca8419c1863","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/radare/radare2/pulls/5547/commits","review_comments_url":"https://api.github.com/repos/radare/radare2/pulls/5547/comments","review_comment_url":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/radare/radare2/issues/5547/comments","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/9f8736643b5597fc84841e7e32ed98971dfdb27d","head":{"label":"P4N74:pf","ref":"pf","sha":"9f8736643b5597fc84841e7e32ed98971dfdb27d","user":{"login":"P4N74","id":11134594,"avatar_url":"https://avatars.githubusercontent.com/u/11134594?v=3","gravatar_id":"","url":"https://api.github.com/users/P4N74","html_url":"https://github.com/P4N74","followers_url":"https://api.github.com/users/P4N74/followers","following_url":"https://api.github.com/users/P4N74/following{/other_user}","gists_url":"https://api.github.com/users/P4N74/gists{/gist_id}","starred_url":"https://api.github.com/users/P4N74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P4N74/subscriptions","organizations_url":"https://api.github.com/users/P4N74/orgs","repos_url":"https://api.github.com/users/P4N74/repos","events_url":"https://api.github.com/users/P4N74/events{/privacy}","received_events_url":"https://api.github.com/users/P4N74/received_events","type":"User","site_admin":false},"repo":{"id":55441644,"name":"radare2","full_name":"P4N74/radare2","owner":{"login":"P4N74","id":11134594,"avatar_url":"https://avatars.githubusercontent.com/u/11134594?v=3","gravatar_id":"","url":"https://api.github.com/users/P4N74","html_url":"https://github.com/P4N74","followers_url":"https://api.github.com/users/P4N74/followers","following_url":"https://api.github.com/users/P4N74/following{/other_user}","gists_url":"https://api.github.com/users/P4N74/gists{/gist_id}","starred_url":"https://api.github.com/users/P4N74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P4N74/subscriptions","organizations_url":"https://api.github.com/users/P4N74/orgs","repos_url":"https://api.github.com/users/P4N74/repos","events_url":"https://api.github.com/users/P4N74/events{/privacy}","received_events_url":"https://api.github.com/users/P4N74/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/P4N74/radare2","description":"unix-like reverse engineering framework and commandline tools","fork":true,"url":"https://api.github.com/repos/P4N74/radare2","forks_url":"https://api.github.com/repos/P4N74/radare2/forks","keys_url":"https://api.github.com/repos/P4N74/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/P4N74/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/P4N74/radare2/teams","hooks_url":"https://api.github.com/repos/P4N74/radare2/hooks","issue_events_url":"https://api.github.com/repos/P4N74/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/P4N74/radare2/events","assignees_url":"https://api.github.com/repos/P4N74/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/P4N74/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/P4N74/radare2/tags","blobs_url":"https://api.github.com/repos/P4N74/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/P4N74/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/P4N74/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/P4N74/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/P4N74/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/P4N74/radare2/languages","stargazers_url":"https://api.github.com/repos/P4N74/radare2/stargazers","contributors_url":"https://api.github.com/repos/P4N74/radare2/contributors","subscribers_url":"https://api.github.com/repos/P4N74/radare2/subscribers","subscription_url":"https://api.github.com/repos/P4N74/radare2/subscription","commits_url":"https://api.github.com/repos/P4N74/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/P4N74/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/P4N74/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/P4N74/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/P4N74/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/P4N74/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/P4N74/radare2/merges","archive_url":"https://api.github.com/repos/P4N74/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/P4N74/radare2/downloads","issues_url":"https://api.github.com/repos/P4N74/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/P4N74/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/P4N74/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/P4N74/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/P4N74/radare2/labels{/name}","releases_url":"https://api.github.com/repos/P4N74/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/P4N74/radare2/deployments","created_at":"2016-04-04T20:15:18Z","updated_at":"2016-04-04T20:15:31Z","pushed_at":"2016-08-17T21:24:54Z","git_url":"git://github.com/P4N74/radare2.git","ssh_url":"git@github.com:P4N74/radare2.git","clone_url":"https://github.com/P4N74/radare2.git","svn_url":"https://github.com/P4N74/radare2","homepage":"http://www.radare.org/","size":60153,"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":"radare:master","ref":"master","sha":"34dea157f0cefcc78e3a530f332b9915f46e4a55","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"repo":{"id":4869294,"name":"radare2","full_name":"radare/radare2","owner":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radare/radare2","description":"unix-like reverse engineering framework and commandline tools","fork":false,"url":"https://api.github.com/repos/radare/radare2","forks_url":"https://api.github.com/repos/radare/radare2/forks","keys_url":"https://api.github.com/repos/radare/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radare/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radare/radare2/teams","hooks_url":"https://api.github.com/repos/radare/radare2/hooks","issue_events_url":"https://api.github.com/repos/radare/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/radare/radare2/events","assignees_url":"https://api.github.com/repos/radare/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/radare/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/radare/radare2/tags","blobs_url":"https://api.github.com/repos/radare/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radare/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radare/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/radare/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/radare/radare2/languages","stargazers_url":"https://api.github.com/repos/radare/radare2/stargazers","contributors_url":"https://api.github.com/repos/radare/radare2/contributors","subscribers_url":"https://api.github.com/repos/radare/radare2/subscribers","subscription_url":"https://api.github.com/repos/radare/radare2/subscription","commits_url":"https://api.github.com/repos/radare/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/radare/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/radare/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/radare/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/radare/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/radare/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radare/radare2/merges","archive_url":"https://api.github.com/repos/radare/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radare/radare2/downloads","issues_url":"https://api.github.com/repos/radare/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/radare/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/radare/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/radare/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radare/radare2/labels{/name}","releases_url":"https://api.github.com/repos/radare/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/radare/radare2/deployments","created_at":"2012-07-03T07:42:26Z","updated_at":"2016-08-17T15:33:56Z","pushed_at":"2016-08-17T21:24:55Z","git_url":"git://github.com/radare/radare2.git","ssh_url":"git@github.com:radare/radare2.git","clone_url":"https://github.com/radare/radare2.git","svn_url":"https://github.com/radare/radare2","homepage":"http://www.radare.org/","size":77904,"stargazers_count":3064,"watchers_count":3064,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":692,"mirror_url":null,"open_issues_count":788,"forks":692,"open_issues":788,"watchers":3064,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/5547"},"html":{"href":"https://github.com/radare/radare2/pull/5547"},"issue":{"href":"https://api.github.com/repos/radare/radare2/issues/5547"},"comments":{"href":"https://api.github.com/repos/radare/radare2/issues/5547/comments"},"review_comments":{"href":"https://api.github.com/repos/radare/radare2/pulls/5547/comments"},"review_comment":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/radare/radare2/pulls/5547/commits"},"statuses":{"href":"https://api.github.com/repos/radare/radare2/statuses/9f8736643b5597fc84841e7e32ed98971dfdb27d"}}}}
{"actor":{"display_login":"radare"}}