On Mar 4, 2014, at 5:43 AM, François-Xavier Le Bail wrote:
> Is it not better to add const in the propotype ?
In what cases, if any, are parameters that are const (rather than non-const
parameters that point to a const object) useful?
C is pass-by-value, so it's not as if the caller will see
"François-Xavier Le Bail" wrote:
Is it not better to add const in the propotype ?
Comparing to other print-function with a 'len' as last parameter,
I think not. Looking through interface.h for *_print() functions, only these
have a 'const u_int' as last arg:
openflow_print, ahcp_print.
IMHO
> From: Gisle Vanem
> The prototype and implementation of 'zmtp1_print_datagram()'
> is slightly different; the prototype has a 'const u_int len' as the last
> parameter. Whereas the implementation has no 'const'. Hence
> I get a warning from MSVC. Hence:
>
> diff -u3 Git-Latest/print-zeromq.c .
The prototype and implementation of 'zmtp1_print_datagram()'
is slightly different; the prototype has a 'const u_int len' as the last
parameter. Whereas the implementation has no 'const'. Hence
I get a warning from MSVC. Hence:
diff -u3 Git-Latest/print-zeromq.c ./print-zeromq.c
--- Git-Latest/pr