GitHub PullRequestReviewCommentEvent at 2014-05-23 06:17:27
Repository: engine
Actor: jakemask
Payload: {"comment":{"url":"https://api.github.com/repos/5-second-rule/engine/pulls/comments/12986894","id":12986894,"diff_hunk":"@@ -1,51 +1,57 @@\n-#include \"Handle.h\"\n-\n-Handle::Handle() : Handle(0, 0, HandleType::LOCAL) {}\n-\n-\n-Handle::Handle(int index, unsigned int id, HandleType type) {\n-\tthis->index = index;\n-\tthis->id = id;\n-\n-\tif (type == HandleType::LOCAL) {\n-\t\tthis->id |= LOCAL_MASK;\n-\t}\n-}\n-\n-Handle::~Handle() {}\n-\n-HandleType Handle::getType() const {\n-\treturn (HandleType)((this->id & LOCAL_MASK) != LOCAL_MASK);\n-}\n-\n-bool Handle::operator==(Handle const& handle) const {\n-\tif (this->id == handle.id){\n-\t\tassert(this->index == handle.index);\n-\t\treturn true;\n-\t}\n-\treturn false;\n-}\n-\n-void Handle::reserveSize(IReserve& buffer) const {\n-\tbuffer.reserve(sizeof(size_t) + sizeof(unsigned int));\n-}\n-\n-void Handle::fillBuffer(IFill& buffer) const {\n-\tchar *buf = buffer.getPointer();\n-\tmemcpy(buf, &this->index, sizeof(size_t));\n-\tmemcpy(buf + sizeof(size_t), &this->id, sizeof(unsigned int));\n-\tbuffer.filled();\n-}\n-\n-void Handle::deserialize(BufferReader& reader) {\n-\tconst char* buf = reader.getPointer();\n-\n-\tmemcpy(&this->index, buf, sizeof(size_t));\n-\tmemcpy(&this->id, buf + sizeof(size_t), sizeof(unsigned int));\n-\n-\treader.finished(sizeof(size_t) + sizeof(unsigned int));\n-}\n-\n+#include \"Handle.h\"\r\n+\r\n+#include <string>\r\n+#include <sstream>\r\n+\r\n+Handle::Handle() : Handle(-1, -1, HandleType::LOCAL) {}\r\n+\r\n+Handle::Handle(int index, unsigned int id, HandleType type) {\r\n+\tthis->index = index;\r\n+\tthis->id = id;\r\n+\r\n+\tif (type == HandleType::LOCAL) {\r\n+\t\tthis->id |= LOCAL_MASK;\r\n+\t}\r\n+}\r\n+\r\n+Handle::~Handle() {}\r\n+\r\n+HandleType Handle::getType() const {\r\n+\treturn (HandleType)((this->id & LOCAL_MASK) != LOCAL_MASK);\r\n+}\r\n+\r\n+bool Handle::isLocal() const {\r\n+\treturn getType() == HandleType::LOCAL;\r\n+}\r\n+\r\n+bool Handle::operator==(Handle const& handle) const {\r\n+\tif (this->id == handle.id){\r\n+\t\tassert(this->index == handle.index);\r\n+\t\treturn true;\r\n+\t}\r\n+\treturn false;\r\n+}\r\n+\r\n+void Handle::reserveSize(IReserve& buffer) const {\r\n+\tbuffer.reserve(sizeof(size_t) + sizeof(unsigned int));\r\n+}\r\n+\r\n+void Handle::fillBuffer(IFill& buffer) const {\r\n+\tchar *buf = buffer.getPointer();\r\n+\tmemcpy(buf, &this->index, sizeof(size_t));\r\n+\tmemcpy(buf + sizeof(size_t), &this->id, sizeof(unsigned int));\r\n+\tbuffer.filled();\r\n+}\r\n+\r\n+void Handle::deserialize(BufferReader& reader) {\r\n+\tconst char* buf = reader.getPointer();\r\n+\r\n+\tmemcpy(&this->index, buf, sizeof(size_t));\r\n+\tmemcpy(&this->id, buf + sizeof(size_t), sizeof(unsigned int));\r\n+\r\n+\treader.finished(sizeof(size_t) + sizeof(unsigned int));\r\n+}\r\n+\r","path":"engine-core/Handle.cpp","position":102,"original_position":102,"commit_id":"a9e513744c83dd77517a47180b5a1e20e1225fee","original_commit_id":"a9e513744c83dd77517a47180b5a1e20e1225fee","user":{"login":"jakemask","id":1007134,"avatar_url":"https://avatars.githubusercontent.com/u/1007134?","gravatar_id":"e33823ed12a826dacad647bcad6e8018","url":"https://api.github.com/users/jakemask","html_url":"https://github.com/jakemask","followers_url":"https://api.github.com/users/jakemask/followers","following_url":"https://api.github.com/users/jakemask/following{/other_user}","gists_url":"https://api.github.com/users/jakemask/gists{/gist_id}","starred_url":"https://api.github.com/users/jakemask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakemask/subscriptions","organizations_url":"https://api.github.com/users/jakemask/orgs","repos_url":"https://api.github.com/users/jakemask/repos","events_url":"https://api.github.com/users/jakemask/events{/privacy}","received_events_url":"https://api.github.com/users/jakemask/received_events","type":"User","site_admin":false},"body":"This has the \"entire file modified\" issue again.","created_at":"2014-05-23T06:17:27Z","updated_at":"2014-05-23T06:17:27Z","html_url":"https://github.com/5-second-rule/engine/pull/12#discussion_r12986894","pull_request_url":"https://api.github.com/repos/5-second-rule/engine/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/5-second-rule/engine/pulls/comments/12986894"},"html":{"href":"https://github.com/5-second-rule/engine/pull/12#discussion_r12986894"},"pull_request":{"href":"https://api.github.com/repos/5-second-rule/engine/pulls/12"}}}}