[Openvpn-devel] [PATCH] socket: make socket_* functions static

2018-07-11 Thread Antonio Quartulli
stream_buf_init(), stream_buf_close() and stream_buf_added() are only used within socket.c, therefore there is noneed to have them declared in socket.h. Make them static and remove useless declarations. This change required some re-ordering of the functions to ensure they were defined before being

[Openvpn-devel] [PATCH v2] socket: make stream_buf_* functions static

2018-07-11 Thread Antonio Quartulli
stream_buf_init(), stream_buf_close() and stream_buf_added() are only used within socket.c, therefore there is noneed to have them declared in socket.h. Make them static and remove useless declarations. This change required some re-ordering of the functions to ensure they were defined before being

Re: [Openvpn-devel] [PATCH v2] socket: make stream_buf_* functions static

2018-07-11 Thread Gert Doering
Hi, On Thu, Jul 12, 2018 at 01:00:42AM +0800, Antonio Quartulli wrote: > stream_buf_init(), stream_buf_close() and stream_buf_added() > are only used within socket.c, therefore there is noneed to > have them declared in socket.h. > > Make them static and remove useless declarations. > This change

Re: [Openvpn-devel] [PATCH v2] socket: make stream_buf_* functions static

2018-07-11 Thread Antonio Quartulli
Hi, On 12/07/18 01:49, Gert Doering wrote: > Hi, > > On Thu, Jul 12, 2018 at 01:00:42AM +0800, Antonio Quartulli wrote: >> stream_buf_init(), stream_buf_close() and stream_buf_added() >> are only used within socket.c, therefore there is noneed to >> have them declared in socket.h. >> >> Make them

Re: [Openvpn-devel] [PATCH v2] socket: make stream_buf_* functions static

2018-07-11 Thread Gert Doering
Hi, On Thu, Jul 12, 2018 at 01:56:14AM +0800, Antonio Quartulli wrote: > > Why not just add prototypes at the top? > > Because I wanted the result to be clean code :) Prototypes are clean code :-) > Imho, prototypes should be used only if really needed (i.e. when > re-ordering is not an option)

[Openvpn-devel] [PATCH v3] socket: make stream_buf_* functions static

2018-07-11 Thread Antonio Quartulli
stream_buf_init(), stream_buf_close() and stream_buf_added() are only used within socket.c, therefore there is noneed to have them declared in socket.h. Make them static and remove useless declarations. This change reuired adding function prototypes in socket.c to avoid useless code re-ordering.