GitHub PullRequestReviewCommentEvent at 2014-04-27 14:09:51
Repository: shogun
Actor: karlnapf
Payload: {"comment":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/12029312","id":12029312,"diff_hunk":"@@ -23,31 +23,32 @@ CSerializableFile::CSerializableFile()\n CSerializableFile::CSerializableFile(FILE* fstream, char rw)\n \t:CSGObject(), m_filename(NULL)\n {\n+\tREQUIRE(fstream != NULL, \"Provided fstream should be != NULL\\n\");\n \tinit(fstream, rw, \"(file)\");\n }\n \n CSerializableFile::CSerializableFile(const char* fname, char rw)\n \t:CSGObject(), m_filename(NULL)\n {\n-\tchar mode[3] = {rw, 'b', '\\0'};\n+\tconst char mode[3] = {rw, 'b', '\\0'};\n \n-\tinit(NULL, rw, fname);\n-\n-\tif (m_filename == NULL || *m_filename == '\\0') {\n-\t\tSG_WARNING(\"Filename not given for opening file!\\n\")\n-\t\tclose(); return;\n+\tif (fname == NULL || *fname == '\\0') {\n+\t\tclose();\n+\t\tSG_ERROR(\"Filename not given for opening file!\\n\")\n \t}\n \n \tif (rw != 'r' && rw != 'w') {\n-\t\tSG_WARNING(\"Unknown mode '%c'!\\n\", mode[0])\n-\t\tclose(); return;\n+\t\tclose();\n+\t\tSG_ERROR(\"Unknown mode '%c'!\\n\", mode[0])\n \t}\n \n-\tm_fstream = fopen(m_filename, mode);\n-\tif (!is_opened()) {\n-\t\tSG_WARNING(\"Error opening file '%s'\\n\", m_filename)\n-\t\tclose(); return;\n+\tFILE* fstream = fopen(fname, mode);\n+\tif (!fstream) {","path":"src/shogun/io/SerializableFile.cpp","position":36,"original_position":36,"commit_id":"c83bb6148f8365bd15616bb944dd4584b408bb0b","original_commit_id":"c83bb6148f8365bd15616bb944dd4584b408bb0b","user":{"login":"karlnapf","id":699071,"avatar_url":"https://avatars.githubusercontent.com/u/699071?","gravatar_id":"5dd0cd1feee1624c281cdd1801b9ea81","url":"https://api.github.com/users/karlnapf","html_url":"https://github.com/karlnapf","followers_url":"https://api.github.com/users/karlnapf/followers","following_url":"https://api.github.com/users/karlnapf/following{/other_user}","gists_url":"https://api.github.com/users/karlnapf/gists{/gist_id}","starred_url":"https://api.github.com/users/karlnapf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlnapf/subscriptions","organizations_url":"https://api.github.com/users/karlnapf/orgs","repos_url":"https://api.github.com/users/karlnapf/repos","events_url":"https://api.github.com/users/karlnapf/events{/privacy}","received_events_url":"https://api.github.com/users/karlnapf/received_events","type":"User","site_admin":false},"body":"I am not blaming you, sorry if it seems like that. I am just asking you to respect the standards we have agreed on. Everyone else does too. It doesn't slow down contributions, only discussing this every time again does. It annoys me too to have this discussion, but note that I (and everyone else) ask all contributors to do this.","created_at":"2014-04-27T14:09:51Z","updated_at":"2014-04-27T14:09:51Z","html_url":"https://github.com/shogun-toolbox/shogun/pull/2191#discussion_r12029312","pull_request_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2191","_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/12029312"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/2191#discussion_r12029312"},"pull_request":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/2191"}}}}