[jira] [Updated] (MESOS-3795) process::io::write takes parameter as void* which could be const

2015-11-30 Thread Benjamin Bannier (JIRA)

 [ 
https://issues.apache.org/jira/browse/MESOS-3795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Bannier updated MESOS-3795:

Shepherd: Bernd Mathiske
  Sprint: Mesosphere Sprint 23

> process::io::write takes parameter as void* which could be const
> 
>
> Key: MESOS-3795
> URL: https://issues.apache.org/jira/browse/MESOS-3795
> Project: Mesos
>  Issue Type: Improvement
>  Components: libprocess
>Reporter: Benjamin Bannier
>Assignee: Benjamin Bannier
>  Labels: mesosphere, tech-debt
>
> In libprocess we have
> {code}
> Future write(int fd, void* data, size_t size);
> {code}
> which expects a non-{{const}} {{void*}} for its {{data}} parameter. Under the 
> covers {{data}} appears to be handled as a {{const}} (like one would expect 
> from the signature its inspiration {{::write}}).
> This function is not used too often, but since it expects a non-{{const}} 
> value for {{data}} automatic conversions to {{void*}} from other pointer 
> types are disabled; instead callers seem cast manually to {{void*}} -- often 
> with C-style casts.
> We should sync this method's signature with that of {{::write}}.
> In addition to following the expected semantics of {{::write}}, having this 
> work without casts with any pointer value {{data}} would make it easier to 
> interface this with character literals, or raw data ptrs from STL containers 
> (e.g. {{Container::data}}). It would probably also indirectly eliminate 
> temptation to use C-casts.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (MESOS-3795) process::io::write takes parameter as void* which could be const

2015-11-25 Thread Benjamin Bannier (JIRA)

 [ 
https://issues.apache.org/jira/browse/MESOS-3795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Bannier updated MESOS-3795:

Attachment: (was: ubuntu14_clang-3.6_FAILED.log)

> process::io::write takes parameter as void* which could be const
> 
>
> Key: MESOS-3795
> URL: https://issues.apache.org/jira/browse/MESOS-3795
> Project: Mesos
>  Issue Type: Improvement
>  Components: libprocess
>Reporter: Benjamin Bannier
>  Labels: mesosphere, tech-debt
>
> In libprocess we have
> {code}
> Future write(int fd, void* data, size_t size);
> {code}
> which expects a non-{{const}} {{void*}} for its {{data}} parameter. Under the 
> covers {{data}} appears to be handled as a {{const}} (like one would expect 
> from the signature its inspiration {{::write}}).
> This function is not used too often, but since it expects a non-{{const}} 
> value for {{data}} automatic conversions to {{void*}} from other pointer 
> types are disabled; instead callers seem cast manually to {{void*}} -- often 
> with C-style casts.
> We should sync this method's signature with that of {{::write}}.
> In addition to following the expected semantics of {{::write}}, having this 
> work without casts with any pointer value {{data}} would make it easier to 
> interface this with character literals, or raw data ptrs from STL containers 
> (e.g. {{Container::data}}). It would probably also indirectly eliminate 
> temptation to use C-casts.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)