{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/3470","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3470/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3470/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3470/events","html_url":"https://github.com/chapel-lang/chapel/pull/3470","id":140756958,"number":3470,"title":"Adjust channel.readbits/writebits to accept other integral types","user":{"login":"mppf","id":3653132,"avatar_url":"https://avatars.githubusercontent.com/u/3653132?v=3","gravatar_id":"","url":"https://api.github.com/users/mppf","html_url":"https://github.com/mppf","followers_url":"https://api.github.com/users/mppf/followers","following_url":"https://api.github.com/users/mppf/following{/other_user}","gists_url":"https://api.github.com/users/mppf/gists{/gist_id}","starred_url":"https://api.github.com/users/mppf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppf/subscriptions","organizations_url":"https://api.github.com/users/mppf/orgs","repos_url":"https://api.github.com/users/mppf/repos","events_url":"https://api.github.com/users/mppf/events{/privacy}","received_events_url":"https://api.github.com/users/mppf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-14T18:22:23Z","updated_at":"2016-03-14T18:38:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3470","html_url":"https://github.com/chapel-lang/chapel/pull/3470","diff_url":"https://github.com/chapel-lang/chapel/pull/3470.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/3470.patch"},"body":"Originally, these functions insisted on uint for the value\r\nto read/write and int(8) for the count of bits. That required\r\nsome awkward casting in the Mandelbrot MPlot.chpl for tutorials.\r\nI've had a TO-DO for some time to remove the need for the casts.\r\n\r\nFirst, this change adjusts the value and numbits arguments for\r\nchannel.read/writebits to accept any integral type.\r\n\r\nThen, this change also adds new checks. It uses the same config param as\r\nsafeCast to skip extra checks with --fast. If the checks are not skipped, they\r\ngenerate a halt if there is an attempt to read a negative number of bits or to\r\nread more bits than the passed value. (E.g. reading 9 bits into a uint(8)).\r\n\r\nLastly, this change adds tests."},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/196462918","html_url":"https://github.com/chapel-lang/chapel/pull/3470#issuecomment-196462918","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3470","id":196462918,"user":{"login":"lydia-duncan","id":2454710,"avatar_url":"https://avatars.githubusercontent.com/u/2454710?v=3","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T18:38:14Z","updated_at":"2016-03-14T18:38:14Z","body":"I think this look good and it seems like the tests you've added cover the error cases I can think of.  Assuming the modification doesn't break standard testing, I think this is good to go!"}}