{"action":"created","comment":{"url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/comments/48685107","id":48685107,"diff_hunk":"@@ -0,0 +1,156 @@\n+#ifndef __BITSET_H__\n+#define __BITSET_H__\n+#include <stdint.h>\n+#include <stddef.h>\n+#include \"common.h\"\n+\n+/* Bit operations on simple values. */\n+#define BIT_SET(n, b) ((n) |=  (1 << (b)) )\n+#define BIT_CLR(n, b) ((n) &= ~(1 << (b)) )\n+#define BIT_INV(n, b) ((n) ^=  (1 << (b)) )\n+#define BIT_GET(n, b) (((n) & (1<<(b))) != 0)\n+\n+/* TODO: This should be in some other file. */\n+\n+/* ============================== */\n+/*   Bitsets                      */\n+\n+/* Defines a variable of bitset<size> type, named \"name\". This can be\n+ * used both for creating a bitset variable, as well as for defining a\n+ * bitset field within a struct. */\n+#define BITSET_DEFINE(name, size)                       \\\n+    struct name ## _bitset ## size ##_t {               \\\n+        WORD_TYPE bf[_BITSET_WORDS_NO(size)];           \\\n+    } name;\n+\n+/* Macros for initialising bitsets. */","path":"bitset.h","position":26,"original_position":26,"commit_id":"014647b9f231fbe1253c3258b570270c85e9c430","original_commit_id":"014647b9f231fbe1253c3258b570270c85e9c430","user":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"body":"`BITSET_CLEAR` is defined twice?","created_at":"2016-01-02T14:56:25Z","updated_at":"2016-01-02T14:56:25Z","html_url":"https://github.com/cahirwpz/wifire-os/pull/22#discussion_r48685107","pull_request_url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/comments/48685107"},"html":{"href":"https://github.com/cahirwpz/wifire-os/pull/22#discussion_r48685107"},"pull_request":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22","id":54897052,"html_url":"https://github.com/cahirwpz/wifire-os/pull/22","diff_url":"https://github.com/cahirwpz/wifire-os/pull/22.diff","patch_url":"https://github.com/cahirwpz/wifire-os/pull/22.patch","issue_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues/22","number":22,"state":"open","locked":false,"title":"Bit operations and bitset type template macros","user":{"login":"rafalcieslak","id":6637987,"avatar_url":"https://avatars.githubusercontent.com/u/6637987?v=3","gravatar_id":"","url":"https://api.github.com/users/rafalcieslak","html_url":"https://github.com/rafalcieslak","followers_url":"https://api.github.com/users/rafalcieslak/followers","following_url":"https://api.github.com/users/rafalcieslak/following{/other_user}","gists_url":"https://api.github.com/users/rafalcieslak/gists{/gist_id}","starred_url":"https://api.github.com/users/rafalcieslak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafalcieslak/subscriptions","organizations_url":"https://api.github.com/users/rafalcieslak/orgs","repos_url":"https://api.github.com/users/rafalcieslak/repos","events_url":"https://api.github.com/users/rafalcieslak/events{/privacy}","received_events_url":"https://api.github.com/users/rafalcieslak/received_events","type":"User","site_admin":false},"body":"A collection of macros that implement a bitset type. I've only implemented the basic operations, are there any more that are going to be frequently useful, and so I should add them?","created_at":"2016-01-01T21:58:01Z","updated_at":"2016-01-02T14:56:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e81b4d037e8c0a067be674e09f2f94f8a9bc12c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22/commits","review_comments_url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22/comments","review_comment_url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues/22/comments","statuses_url":"https://api.github.com/repos/cahirwpz/wifire-os/statuses/014647b9f231fbe1253c3258b570270c85e9c430","head":{"label":"cahirwpz:bitset","ref":"bitset","sha":"014647b9f231fbe1253c3258b570270c85e9c430","user":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"repo":{"id":46346617,"name":"wifire-os","full_name":"cahirwpz/wifire-os","owner":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cahirwpz/wifire-os","description":"An experiment with implementation of very simple embedded operating system for ChipKIT WiFire.","fork":false,"url":"https://api.github.com/repos/cahirwpz/wifire-os","forks_url":"https://api.github.com/repos/cahirwpz/wifire-os/forks","keys_url":"https://api.github.com/repos/cahirwpz/wifire-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cahirwpz/wifire-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cahirwpz/wifire-os/teams","hooks_url":"https://api.github.com/repos/cahirwpz/wifire-os/hooks","issue_events_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues/events{/number}","events_url":"https://api.github.com/repos/cahirwpz/wifire-os/events","assignees_url":"https://api.github.com/repos/cahirwpz/wifire-os/assignees{/user}","branches_url":"https://api.github.com/repos/cahirwpz/wifire-os/branches{/branch}","tags_url":"https://api.github.com/repos/cahirwpz/wifire-os/tags","blobs_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cahirwpz/wifire-os/statuses/{sha}","languages_url":"https://api.github.com/repos/cahirwpz/wifire-os/languages","stargazers_url":"https://api.github.com/repos/cahirwpz/wifire-os/stargazers","contributors_url":"https://api.github.com/repos/cahirwpz/wifire-os/contributors","subscribers_url":"https://api.github.com/repos/cahirwpz/wifire-os/subscribers","subscription_url":"https://api.github.com/repos/cahirwpz/wifire-os/subscription","commits_url":"https://api.github.com/repos/cahirwpz/wifire-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/cahirwpz/wifire-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/cahirwpz/wifire-os/contents/{+path}","compare_url":"https://api.github.com/repos/cahirwpz/wifire-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cahirwpz/wifire-os/merges","archive_url":"https://api.github.com/repos/cahirwpz/wifire-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cahirwpz/wifire-os/downloads","issues_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues{/number}","pulls_url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls{/number}","milestones_url":"https://api.github.com/repos/cahirwpz/wifire-os/milestones{/number}","notifications_url":"https://api.github.com/repos/cahirwpz/wifire-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cahirwpz/wifire-os/labels{/name}","releases_url":"https://api.github.com/repos/cahirwpz/wifire-os/releases{/id}","created_at":"2015-11-17T12:46:47Z","updated_at":"2015-12-25T23:11:16Z","pushed_at":"2016-01-02T14:41:58Z","git_url":"git://github.com/cahirwpz/wifire-os.git","ssh_url":"git@github.com:cahirwpz/wifire-os.git","clone_url":"https://github.com/cahirwpz/wifire-os.git","svn_url":"https://github.com/cahirwpz/wifire-os","homepage":null,"size":815,"stargazers_count":3,"watchers_count":3,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":3,"default_branch":"master"}},"base":{"label":"cahirwpz:master","ref":"master","sha":"0e9d20d7d825f6c7c282c9331f7d37f022d7db23","user":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"repo":{"id":46346617,"name":"wifire-os","full_name":"cahirwpz/wifire-os","owner":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cahirwpz/wifire-os","description":"An experiment with implementation of very simple embedded operating system for ChipKIT WiFire.","fork":false,"url":"https://api.github.com/repos/cahirwpz/wifire-os","forks_url":"https://api.github.com/repos/cahirwpz/wifire-os/forks","keys_url":"https://api.github.com/repos/cahirwpz/wifire-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cahirwpz/wifire-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cahirwpz/wifire-os/teams","hooks_url":"https://api.github.com/repos/cahirwpz/wifire-os/hooks","issue_events_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues/events{/number}","events_url":"https://api.github.com/repos/cahirwpz/wifire-os/events","assignees_url":"https://api.github.com/repos/cahirwpz/wifire-os/assignees{/user}","branches_url":"https://api.github.com/repos/cahirwpz/wifire-os/branches{/branch}","tags_url":"https://api.github.com/repos/cahirwpz/wifire-os/tags","blobs_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cahirwpz/wifire-os/statuses/{sha}","languages_url":"https://api.github.com/repos/cahirwpz/wifire-os/languages","stargazers_url":"https://api.github.com/repos/cahirwpz/wifire-os/stargazers","contributors_url":"https://api.github.com/repos/cahirwpz/wifire-os/contributors","subscribers_url":"https://api.github.com/repos/cahirwpz/wifire-os/subscribers","subscription_url":"https://api.github.com/repos/cahirwpz/wifire-os/subscription","commits_url":"https://api.github.com/repos/cahirwpz/wifire-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/cahirwpz/wifire-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/cahirwpz/wifire-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/cahirwpz/wifire-os/contents/{+path}","compare_url":"https://api.github.com/repos/cahirwpz/wifire-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cahirwpz/wifire-os/merges","archive_url":"https://api.github.com/repos/cahirwpz/wifire-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cahirwpz/wifire-os/downloads","issues_url":"https://api.github.com/repos/cahirwpz/wifire-os/issues{/number}","pulls_url":"https://api.github.com/repos/cahirwpz/wifire-os/pulls{/number}","milestones_url":"https://api.github.com/repos/cahirwpz/wifire-os/milestones{/number}","notifications_url":"https://api.github.com/repos/cahirwpz/wifire-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cahirwpz/wifire-os/labels{/name}","releases_url":"https://api.github.com/repos/cahirwpz/wifire-os/releases{/id}","created_at":"2015-11-17T12:46:47Z","updated_at":"2015-12-25T23:11:16Z","pushed_at":"2016-01-02T14:41:58Z","git_url":"git://github.com/cahirwpz/wifire-os.git","ssh_url":"git@github.com:cahirwpz/wifire-os.git","clone_url":"https://github.com/cahirwpz/wifire-os.git","svn_url":"https://github.com/cahirwpz/wifire-os","homepage":null,"size":815,"stargazers_count":3,"watchers_count":3,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":15,"forks":3,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22"},"html":{"href":"https://github.com/cahirwpz/wifire-os/pull/22"},"issue":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/issues/22"},"comments":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/cahirwpz/wifire-os/statuses/014647b9f231fbe1253c3258b570270c85e9c430"}}}}