octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pointer convention for functions


From: John W. Eaton
Subject: Re: Pointer convention for functions
Date: Tue, 25 Apr 2017 01:11:59 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

On 04/24/2017 08:21 PM, Rik wrote:
jwe,

What do you think about using the spaced out style for function
declarations which return a pointer object?

For example:

corefcn/mexproto.h:78:extern OCTINTERP_API const char *mexFunctionName (void);

I think this would be clearer if it were written as

extern OCTINTERP_API const char * mexFunctionName (void);

This would also be in keeping with our guidelines for declaring functions
which says that the return type should appear alone on the first line
followed by the name of the function and the list of arguments.

extern OCTINTERP_API const char *
mexFunctionName (void)
{
  ...
}

It looks a little funny to me to have spaces on both sides of the * in this context, but I don't have a strong preference.

I'm working on a fairly large change that touches nearly all the files in parse-tree and ten or so more in corefcn and octave-value, so if you do go ahead with this change, could you wait until after I push my changes (probably in the next day or so).

Thanks,

jwe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]