Commit b96f1239 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Add missing const qualifier and fix warnings

parent 898c8550
...@@ -113,24 +113,24 @@ struct virtual_socket_t ...@@ -113,24 +113,24 @@ struct virtual_socket_t
}; };
#define net_Read(a,b,c,d,e,f) __net_Read(VLC_OBJECT(a),b,c,d,e,f) #define net_Read(a,b,c,d,e,f) __net_Read(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT( int, __net_Read, ( vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry ) ); VLC_EXPORT( int, __net_Read, ( vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry ) );
#define net_ReadNonBlock(a,b,c,d,e,f) __net_ReadNonBlock(VLC_OBJECT(a),b,c,d,e,f) #define net_ReadNonBlock(a,b,c,d,e,f) __net_ReadNonBlock(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT( int, __net_ReadNonBlock, ( vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait ) ); VLC_EXPORT( int, __net_ReadNonBlock, ( vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait ) );
#define net_Select(a,b,c,d,e,f,g) __net_Select(VLC_OBJECT(a),b,c,d,e,f,g) #define net_Select(a,b,c,d,e,f,g) __net_Select(VLC_OBJECT(a),b,c,d,e,f,g)
VLC_EXPORT( int, __net_Select, ( vlc_object_t *p_this, int *pi_fd, v_socket_t **, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait ) ); VLC_EXPORT( int, __net_Select, ( vlc_object_t *p_this, const int *pi_fd, const v_socket_t *const *, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait ) );
#define net_Write(a,b,c,d,e) __net_Write(VLC_OBJECT(a),b,c,d,e) #define net_Write(a,b,c,d,e) __net_Write(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT( int, __net_Write, ( vlc_object_t *p_this, int fd, v_socket_t *, const uint8_t *p_data, int i_data ) ); VLC_EXPORT( int, __net_Write, ( vlc_object_t *p_this, int fd, const v_socket_t *, const uint8_t *p_data, int i_data ) );
#define net_Gets(a,b,c) __net_Gets(VLC_OBJECT(a),b,c) #define net_Gets(a,b,c) __net_Gets(VLC_OBJECT(a),b,c)
VLC_EXPORT( char *, __net_Gets, ( vlc_object_t *p_this, int fd, v_socket_t * ) ); VLC_EXPORT( char *, __net_Gets, ( vlc_object_t *p_this, int fd, const v_socket_t * ) );
VLC_EXPORT( int, net_Printf, ( vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, ... ) ); VLC_EXPORT( int, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ... ) );
#define net_vaPrintf(a,b,c,d,e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e) #define net_vaPrintf(a,b,c,d,e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT( int, __net_vaPrintf, ( vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, va_list args ) ); VLC_EXPORT( int, __net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) );
#if !HAVE_INET_PTON #if !HAVE_INET_PTON
......
...@@ -97,13 +97,13 @@ struct module_symbols_t ...@@ -97,13 +97,13 @@ struct module_symbols_t
int (*__net_Accept_inner) (vlc_object_t *, int *, mtime_t); int (*__net_Accept_inner) (vlc_object_t *, int *, mtime_t);
int (*__net_OpenUDP_inner) (vlc_object_t *p_this, const char *psz_bind, int i_bind, const char *psz_server, int i_server); int (*__net_OpenUDP_inner) (vlc_object_t *p_this, const char *psz_bind, int i_bind, const char *psz_server, int i_server);
void (*net_Close_inner) (int fd); void (*net_Close_inner) (int fd);
int (*__net_Read_inner) (vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry); int (*__net_Read_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, vlc_bool_t b_retry);
int (*__net_ReadNonBlock_inner) (vlc_object_t *p_this, int fd, v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait); int (*__net_ReadNonBlock_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, int i_data, mtime_t i_wait);
int (*__net_Select_inner) (vlc_object_t *p_this, int *pi_fd, v_socket_t **, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait); int (*__net_Select_inner) (vlc_object_t *p_this, const int *pi_fd, const v_socket_t *const *, int i_fd, uint8_t *p_data, int i_data, mtime_t i_wait);
int (*__net_Write_inner) (vlc_object_t *p_this, int fd, v_socket_t *, const uint8_t *p_data, int i_data); int (*__net_Write_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, const uint8_t *p_data, int i_data);
char * (*__net_Gets_inner) (vlc_object_t *p_this, int fd, v_socket_t *); char * (*__net_Gets_inner) (vlc_object_t *p_this, int fd, const v_socket_t *);
int (*net_Printf_inner) (vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, ...); int (*net_Printf_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ...);
int (*__net_vaPrintf_inner) (vlc_object_t *p_this, int fd, v_socket_t *, const char *psz_fmt, va_list args); int (*__net_vaPrintf_inner) (vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args);
int (*vout_ShowTextRelative_inner) (vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t); int (*vout_ShowTextRelative_inner) (vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t);
int (*vout_ShowTextAbsolute_inner) (vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t); int (*vout_ShowTextAbsolute_inner) (vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t);
void (*__vout_OSDMessage_inner) (vlc_object_t *, int, char *, ...); void (*__vout_OSDMessage_inner) (vlc_object_t *, int, char *, ...);
......
...@@ -136,7 +136,7 @@ void net_Close( int fd ) ...@@ -136,7 +136,7 @@ void net_Close( int fd )
static int static int
net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv, net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
v_socket_t *const *restrict vsv, const v_socket_t *const *restrict vsv,
uint8_t *restrict buf, size_t buflen, uint8_t *restrict buf, size_t buflen,
int wait_ms, vlc_bool_t waitall ) int wait_ms, vlc_bool_t waitall )
{ {
...@@ -280,10 +280,11 @@ error: ...@@ -280,10 +280,11 @@ error:
* data * data
*****************************************************************************/ *****************************************************************************/
int __net_Read( vlc_object_t *restrict p_this, int fd, int __net_Read( vlc_object_t *restrict p_this, int fd,
v_socket_t *restrict p_vs, const v_socket_t *restrict p_vs,
uint8_t *restrict p_data, int i_data, vlc_bool_t b_retry ) uint8_t *restrict p_data, int i_data, vlc_bool_t b_retry )
{ {
return net_ReadInner (p_this, 1, &(int){ fd }, &(v_socket_t *){ p_vs }, return net_ReadInner (p_this, 1, &(int){ fd },
&(const v_socket_t *){ p_vs },
p_data, i_data, -1, b_retry); p_data, i_data, -1, b_retry);
} }
...@@ -294,10 +295,11 @@ int __net_Read( vlc_object_t *restrict p_this, int fd, ...@@ -294,10 +295,11 @@ int __net_Read( vlc_object_t *restrict p_this, int fd,
* Read from a network socket, non blocking mode (with timeout) * Read from a network socket, non blocking mode (with timeout)
*****************************************************************************/ *****************************************************************************/
int __net_ReadNonBlock( vlc_object_t *restrict p_this, int fd, int __net_ReadNonBlock( vlc_object_t *restrict p_this, int fd,
v_socket_t *restrict p_vs, const v_socket_t *restrict p_vs,
uint8_t *restrict p_data, int i_data, mtime_t i_wait) uint8_t *restrict p_data, int i_data, mtime_t i_wait)
{ {
return net_ReadInner (p_this, 1, &(int){ fd }, &(v_socket_t *){ p_vs }, return net_ReadInner (p_this, 1, &(int){ fd },
&(const v_socket_t *){ p_vs },
p_data, i_data, i_wait / 1000, VLC_FALSE); p_data, i_data, i_wait / 1000, VLC_FALSE);
} }
...@@ -308,8 +310,8 @@ int __net_ReadNonBlock( vlc_object_t *restrict p_this, int fd, ...@@ -308,8 +310,8 @@ int __net_ReadNonBlock( vlc_object_t *restrict p_this, int fd,
* Read from several sockets (with timeout). Takes data from the first socket * Read from several sockets (with timeout). Takes data from the first socket
* that has some. * that has some.
*****************************************************************************/ *****************************************************************************/
int __net_Select( vlc_object_t *restrict p_this, int *restrict pi_fd, int __net_Select( vlc_object_t *restrict p_this, const int *restrict pi_fd,
v_socket_t **restrict pp_vs, const v_socket_t *const *restrict pp_vs,
int i_fd, uint8_t *restrict p_data, int i_data, int i_fd, uint8_t *restrict p_data, int i_data,
mtime_t i_wait ) mtime_t i_wait )
{ {
...@@ -328,7 +330,7 @@ int __net_Select( vlc_object_t *restrict p_this, int *restrict pi_fd, ...@@ -328,7 +330,7 @@ int __net_Select( vlc_object_t *restrict p_this, int *restrict pi_fd,
/* Write exact amount requested */ /* Write exact amount requested */
int __net_Write( vlc_object_t *p_this, int fd, v_socket_t *p_vs, int __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const uint8_t *p_data, int i_data ) const uint8_t *p_data, int i_data )
{ {
struct timeval timeout; struct timeval timeout;
...@@ -388,7 +390,7 @@ int __net_Write( vlc_object_t *p_this, int fd, v_socket_t *p_vs, ...@@ -388,7 +390,7 @@ int __net_Write( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
return i_total; return i_total;
} }
char *__net_Gets( vlc_object_t *p_this, int fd, v_socket_t *p_vs ) char *__net_Gets( vlc_object_t *p_this, int fd, const v_socket_t *p_vs )
{ {
char *psz_line = NULL, *ptr = NULL; char *psz_line = NULL, *ptr = NULL;
size_t i_line = 0, i_max = 0; size_t i_line = 0, i_max = 0;
...@@ -428,7 +430,7 @@ char *__net_Gets( vlc_object_t *p_this, int fd, v_socket_t *p_vs ) ...@@ -428,7 +430,7 @@ char *__net_Gets( vlc_object_t *p_this, int fd, v_socket_t *p_vs )
return psz_line; return psz_line;
} }
int net_Printf( vlc_object_t *p_this, int fd, v_socket_t *p_vs, int net_Printf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const char *psz_fmt, ... ) const char *psz_fmt, ... )
{ {
int i_ret; int i_ret;
...@@ -440,7 +442,7 @@ int net_Printf( vlc_object_t *p_this, int fd, v_socket_t *p_vs, ...@@ -440,7 +442,7 @@ int net_Printf( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
return i_ret; return i_ret;
} }
int __net_vaPrintf( vlc_object_t *p_this, int fd, v_socket_t *p_vs, int __net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const char *psz_fmt, va_list args ) const char *psz_fmt, va_list args )
{ {
char *psz; char *psz;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment