[vlc-devel] [PATCH 3/3] core: respect ODR for access_sys_t
Romain Vimont
rom1v at videolabs.io
Sun Apr 22 17:03:38 CEST 2018
See #17078 and #18033
---
include/vlc_common.h | 1 -
modules/access/attachment.c | 4 ++--
modules/access/avio.c | 4 ++--
modules/access/cdda.c | 4 ++--
modules/access/concat.c | 4 ++--
modules/access/directory.c | 4 ++--
modules/access/dshow/access.h | 37 +++++++++++++++--------------
modules/access/dtv/access.c | 4 ++--
modules/access/dv.c | 4 ++--
modules/access/dvb/access.c | 4 ++--
modules/access/file.c | 4 ++--
modules/access/ftp.c | 2 ++
modules/access/http.c | 4 ++--
modules/access/http/access.c | 4 ++--
modules/access/imem-access.c | 4 ++--
modules/access/imem.c | 2 +-
modules/access/mms/mms.c | 4 ++--
modules/access/mms/mmsh.h | 4 ++--
modules/access/mms/mmstu.h | 4 ++--
modules/access/nfs.c | 4 ++--
modules/access/samba.c | 4 ++--
modules/access/satip.c | 5 ++--
modules/access/sftp.c | 4 ++--
modules/access/udp.c | 4 ++--
modules/access/v4l2/access.c | 4 ++--
modules/access/vcd/vcd.c | 4 ++--
modules/access/vdr.c | 4 ++--
modules/services_discovery/upnp.cpp | 2 +-
28 files changed, 70 insertions(+), 67 deletions(-)
diff --git a/include/vlc_common.h b/include/vlc_common.h
index d58a3c073b..08f42e6911 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -351,7 +351,6 @@ typedef struct config_category_t config_category_t;
typedef struct input_thread_t input_thread_t;
typedef struct input_item_t input_item_t;
typedef struct input_item_node_t input_item_node_t;
-typedef struct access_sys_t access_sys_t;
typedef struct stream_t stream_t;
typedef struct stream_sys_t stream_sys_t;
typedef struct stream_t demux_t;
diff --git a/modules/access/attachment.c b/modules/access/attachment.c
index 9623f82369..06791b2db8 100644
--- a/modules/access/attachment.c
+++ b/modules/access/attachment.c
@@ -58,11 +58,11 @@ static ssize_t Read(stream_t *, void *, size_t);
static int Seek(stream_t *, uint64_t);
static int Control(stream_t *, int, va_list);
-struct access_sys_t
+typedef struct
{
input_attachment_t *attachment;
size_t offset;
-};
+} access_sys_t;
/* */
static int Open(vlc_object_t *object)
diff --git a/modules/access/avio.c b/modules/access/avio.c
index c88e812165..ec63556c66 100644
--- a/modules/access/avio.c
+++ b/modules/access/avio.c
@@ -65,11 +65,11 @@ static int UrlInterruptCallback(void *access)
return vlc_killed();
}
-struct access_sys_t
+typedef struct
{
AVIOContext *context;
int64_t size;
-};
+} access_sys_t;
struct sout_access_out_sys_t {
AVIOContext *context;
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index 266b801d78..6c1fe7d79b 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -269,7 +269,7 @@ error:
/*****************************************************************************
* Access: local prototypes
*****************************************************************************/
-struct access_sys_t
+typedef struct
{
vcddev_t *vcddev; /* vcd device descriptor */
int *p_sectors; /* Track sectors */
@@ -279,7 +279,7 @@ struct access_sys_t
#ifdef HAVE_LIBCDDB
cddb_disc_t *cddb;
#endif
-};
+} access_sys_t;
#ifdef HAVE_LIBCDDB
static cddb_disc_t *GetCDDBInfo( vlc_object_t *obj, int i_titles, int *p_sectors )
diff --git a/modules/access/concat.c b/modules/access/concat.c
index 11c5ef3cd9..d8a94c465d 100644
--- a/modules/access/concat.c
+++ b/modules/access/concat.c
@@ -35,7 +35,7 @@ struct access_entry
char mrl[1];
};
-struct access_sys_t
+typedef struct
{
stream_t *access;
struct access_entry *next;
@@ -46,7 +46,7 @@ struct access_sys_t
bool can_control_pace;
uint64_t size;
int64_t caching;
-};
+} access_sys_t;
static stream_t *GetAccess(stream_t *access)
{
diff --git a/modules/access/directory.c b/modules/access/directory.c
index 59915de767..1cc93791cf 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -42,11 +42,11 @@
#include <vlc_fs.h>
#include <vlc_url.h>
-struct access_sys_t
+typedef struct
{
char *base_uri;
DIR *dir;
-};
+} access_sys_t;
/*****************************************************************************
* DirInit: Init the directory access with a directory stream
diff --git a/modules/access/dshow/access.h b/modules/access/dshow/access.h
index 0527423c6b..b2a20ed714 100644
--- a/modules/access/dshow/access.h
+++ b/modules/access/dshow/access.h
@@ -33,27 +33,10 @@
#include <wrl/client.h>
using Microsoft::WRL::ComPtr;
-/****************************************************************************
- * Crossbar stuff
- ****************************************************************************/
-#define MAX_CROSSBAR_DEPTH 10
-
-struct CrossbarRoute
-{
- ComPtr<IAMCrossbar> pXbar;
- LONG VideoInputIndex;
- LONG VideoOutputIndex;
- LONG AudioInputIndex;
- LONG AudioOutputIndex;
-};
-
-void DeleteCrossbarRoutes( access_sys_t * );
-HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *,
- IPin *, LONG, int = 0 );
-
/****************************************************************************
* Access descriptor declaration
****************************************************************************/
+namespace { // for ODR
struct access_sys_t
{
/* These 2 must be left at the beginning */
@@ -77,4 +60,22 @@ struct access_sys_t
int i_chroma;
mtime_t i_start;
};
+} // namespace
+/****************************************************************************
+ * Crossbar stuff
+ ****************************************************************************/
+#define MAX_CROSSBAR_DEPTH 10
+
+struct CrossbarRoute
+{
+ ComPtr<IAMCrossbar> pXbar;
+ LONG VideoInputIndex;
+ LONG VideoOutputIndex;
+ LONG AudioInputIndex;
+ LONG AudioOutputIndex;
+};
+
+void DeleteCrossbarRoutes( access_sys_t * );
+HRESULT FindCrossbarRoutes( vlc_object_t *, access_sys_t *,
+ IPin *, LONG, int = 0 );
diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index e748ec6cb1..333d9b0997 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -426,12 +426,12 @@ vlc_module_begin ()
#endif
vlc_module_end ()
-struct access_sys_t
+typedef struct
{
dvb_device_t *dev;
uint8_t signal_poll;
tuner_setup_t pf_setup;
-};
+} access_sys_t;
static block_t *Read (stream_t *, bool *);
static int Control (stream_t *, int, va_list);
diff --git a/modules/access/dv.c b/modules/access/dv.c
index b15b22f490..08c7632916 100644
--- a/modules/access/dv.c
+++ b/modules/access/dv.c
@@ -92,7 +92,7 @@ static int AVCPlay( stream_t *, int );
static int AVCPause( stream_t *, int );
static int AVCStop( stream_t *, int );
-struct access_sys_t
+typedef struct
{
raw1394handle_t p_avc1394;
raw1394handle_t p_raw1394;
@@ -108,7 +108,7 @@ struct access_sys_t
event_thread_t *p_ev;
vlc_mutex_t lock;
block_t *p_frame;
-};
+} access_sys_t;
#define ISOCHRONOUS_QUEUE_LENGTH 1000
#define ISOCHRONOUS_MAX_PACKET_SIZE 4096
diff --git a/modules/access/dvb/access.c b/modules/access/dvb/access.c
index ec0f7c4002..9a1acc91af 100644
--- a/modules/access/dvb/access.c
+++ b/modules/access/dvb/access.c
@@ -47,7 +47,7 @@
#include "dvb.h"
#include "scan.h"
-struct access_sys_t
+typedef struct
{
demux_handle_t p_demux_handles[MAX_DEMUX];
dvb_sys_t dvb;
@@ -55,7 +55,7 @@ struct access_sys_t
/* Scan */
struct scan_t *scan;
bool done;
-};
+} access_sys_t;
/*****************************************************************************
* Module descriptor
diff --git a/modules/access/file.c b/modules/access/file.c
index 4a6213b73a..16b5c740cd 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -64,12 +64,12 @@
#include <vlc_url.h>
#include <vlc_interrupt.h>
-struct access_sys_t
+typedef struct
{
int fd;
bool b_pace_control;
-};
+} access_sys_t;
#if !defined (_WIN32) && !defined (__OS2__)
static bool IsRemote (int fd)
diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 8100bf8444..781d71361c 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -107,6 +107,8 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
+typedef struct access_sys_t access_sys_t;
+
static ssize_t Read( stream_t *, void *, size_t );
static int Seek( stream_t *, uint64_t );
static int Control( stream_t *, int, va_list );
diff --git a/modules/access/http.c b/modules/access/http.c
index f5b4eacbd1..a09a7ff74a 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -79,7 +79,7 @@ vlc_module_end ()
* Local prototypes
*****************************************************************************/
-struct access_sys_t
+typedef struct
{
int fd;
@@ -115,7 +115,7 @@ struct access_sys_t
bool b_reconnect;
bool b_has_size;
-};
+} access_sys_t;
/* */
static ssize_t Read( stream_t *, void *, size_t );
diff --git a/modules/access/http/access.c b/modules/access/http/access.c
index ab72107a04..24af4ce22a 100644
--- a/modules/access/http/access.c
+++ b/modules/access/http/access.c
@@ -38,11 +38,11 @@
#include "file.h"
#include "live.h"
-struct access_sys_t
+typedef struct
{
struct vlc_http_mgr *manager;
struct vlc_http_resource *resource;
-};
+} access_sys_t;
static block_t *FileRead(stream_t *access, bool *restrict eof)
{
diff --git a/modules/access/imem-access.c b/modules/access/imem-access.c
index 5649cc0603..7856c041c0 100644
--- a/modules/access/imem-access.c
+++ b/modules/access/imem-access.c
@@ -28,14 +28,14 @@
#include <vlc_access.h>
#include <vlc_plugin.h>
-struct access_sys_t
+typedef struct
{
void *opaque;
ssize_t (*read_cb)(void *, unsigned char *, size_t);
int (*seek_cb)(void *, uint64_t);
void (*close_cb)(void *);
uint64_t size;
-};
+} access_sys_t;
static ssize_t Read(stream_t *access, void *buf, size_t len)
{
diff --git a/modules/access/imem.c b/modules/access/imem.c
index 80b26a41d8..8a1a584271 100644
--- a/modules/access/imem.c
+++ b/modules/access/imem.c
@@ -306,7 +306,7 @@ static int OpenAccess(vlc_object_t *object)
access->pf_read = NULL;
access->pf_block = Block;
access->pf_seek = NULL;
- access->p_sys = (access_sys_t*)sys;
+ access->p_sys = sys;
return VLC_SUCCESS;
}
diff --git a/modules/access/mms/mms.c b/modules/access/mms/mms.c
index 87f42055ff..60b7d3effc 100644
--- a/modules/access/mms/mms.c
+++ b/modules/access/mms/mms.c
@@ -80,10 +80,10 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-struct access_sys_t
+typedef struct
{
int i_proto;
-};
+} access_sys_t;
/*****************************************************************************
* Open:
diff --git a/modules/access/mms/mmsh.h b/modules/access/mms/mmsh.h
index 27f77bacf2..a3d6bf5248 100644
--- a/modules/access/mms/mmsh.h
+++ b/modules/access/mms/mmsh.h
@@ -40,7 +40,7 @@ typedef struct
} chunk_t;
#define BUFFER_SIZE 65536
-struct access_sys_t
+typedef struct
{
int i_proto;
@@ -69,6 +69,6 @@ struct access_sys_t
asf_header_t asfh;
guid_t guid;
-};
+} access_sys_t;
#endif
diff --git a/modules/access/mms/mmstu.h b/modules/access/mms/mmstu.h
index 186f8f1a4b..9c72d1f5fc 100644
--- a/modules/access/mms/mmstu.h
+++ b/modules/access/mms/mmstu.h
@@ -34,7 +34,7 @@
#define MMS_BUFFER_SIZE 100000
-struct access_sys_t
+typedef struct
{
int i_proto; /* MMS_PROTO_TCP, MMS_PROTO_UDP */
int i_handle_tcp; /* TCP socket for communication with server */
@@ -100,6 +100,6 @@ struct access_sys_t
vlc_mutex_t lock_netwrite;
bool b_keep_alive;
vlc_thread_t keep_alive;
-};
+} access_sys_t;
#endif
diff --git a/modules/access/nfs.c b/modules/access/nfs.c
index 0d01dd8426..574d10dd4f 100644
--- a/modules/access/nfs.c
+++ b/modules/access/nfs.c
@@ -64,7 +64,7 @@ vlc_module_begin()
set_callbacks(Open, Close)
vlc_module_end()
-struct access_sys_t
+typedef struct
{
struct rpc_context * p_mount; /* used to to get exports mount point */
struct nfs_context * p_nfs;
@@ -95,7 +95,7 @@ struct access_sys_t
bool b_done;
} seek;
} res;
-};
+} access_sys_t;
static bool
nfs_check_status(stream_t *p_access, int i_status, const char *psz_error,
diff --git a/modules/access/samba.c b/modules/access/samba.c
index 83b5204dc4..7d796cc272 100644
--- a/modules/access/samba.c
+++ b/modules/access/samba.c
@@ -38,12 +38,12 @@
#include "smb_common.h"
-struct access_sys_t
+typedef struct
{
int i_smb;
uint64_t size;
vlc_url_t url;
-};
+} access_sys_t;
/* Build an SMB URI
* smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]] */
diff --git a/modules/access/satip.c b/modules/access/satip.c
index 2e173cfb81..2e5c7ad5b4 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -92,7 +92,8 @@ enum rtsp_result {
};
#define UDP_ADDRESS_LEN 16
-struct access_sys_t {
+typedef struct
+{
char *content_base;
char *control;
char session_id[64];
@@ -115,7 +116,7 @@ struct access_sys_t {
uint16_t last_seq_nr;
bool woken;
-};
+} access_sys_t;
static void parse_session(char *request_line, char *session, unsigned max, int *timeout) {
char *state;
diff --git a/modules/access/sftp.c b/modules/access/sftp.c
index 1219f573a1..e24d911341 100644
--- a/modules/access/sftp.c
+++ b/modules/access/sftp.c
@@ -82,7 +82,7 @@ static int Control( stream_t *, int, va_list );
static int DirRead( stream_t *, input_item_node_t * );
-struct access_sys_t
+typedef struct
{
int i_socket;
LIBSSH2_SESSION* ssh_session;
@@ -90,7 +90,7 @@ struct access_sys_t
LIBSSH2_SFTP_HANDLE* file;
uint64_t filesize;
char *psz_base_url;
-};
+} access_sys_t;
static int AuthKeyAgent( stream_t *p_access, const char *psz_username )
{
diff --git a/modules/access/udp.c b/modules/access/udp.c
index cf6ebb7125..f2269d3659 100644
--- a/modules/access/udp.c
+++ b/modules/access/udp.c
@@ -76,12 +76,12 @@ vlc_module_begin ()
set_callbacks( Open, Close )
vlc_module_end ()
-struct access_sys_t
+typedef struct
{
int fd;
int timeout;
size_t mtu;
-};
+} access_sys_t;
/*****************************************************************************
* Local prototypes
diff --git a/modules/access/v4l2/access.c b/modules/access/v4l2/access.c
index cb56e10955..e44a94d08d 100644
--- a/modules/access/v4l2/access.c
+++ b/modules/access/v4l2/access.c
@@ -37,7 +37,7 @@
#include "v4l2.h"
-struct access_sys_t
+typedef struct
{
int fd;
uint32_t block_flags;
@@ -48,7 +48,7 @@ struct access_sys_t
};
struct buffer_t *bufv;
vlc_v4l2_ctrl_t *controls;
-};
+} access_sys_t;
static block_t *MMapBlock (stream_t *, bool *);
static block_t *ReadBlock (stream_t *, bool *);
diff --git a/modules/access/vcd/vcd.c b/modules/access/vcd/vcd.c
index 3463ee0adf..91a331ba38 100644
--- a/modules/access/vcd/vcd.c
+++ b/modules/access/vcd/vcd.c
@@ -63,7 +63,7 @@ vlc_module_end ()
#define VCD_BLOCKS_ONCE 20
#define VCD_DATA_ONCE (VCD_BLOCKS_ONCE * VCD_DATA_SIZE)
-struct access_sys_t
+typedef struct
{
vcddev_t *vcddev; /* vcd device descriptor */
uint64_t offset;
@@ -80,7 +80,7 @@ struct access_sys_t
int i_sector; /* Current Sector */
int *p_sectors; /* Track sectors */
-};
+} access_sys_t;
static block_t *Block( stream_t *, bool * );
static int Seek( stream_t *, uint64_t );
diff --git a/modules/access/vdr.c b/modules/access/vdr.c
index cd9ee7fea6..33e570a7f4 100644
--- a/modules/access/vdr.c
+++ b/modules/access/vdr.c
@@ -106,7 +106,7 @@ vlc_module_end ()
TYPEDEF_ARRAY( uint64_t, size_array_t );
-struct access_sys_t
+typedef struct
{
/* file sizes of all parts */
size_array_t file_sizes;
@@ -128,7 +128,7 @@ struct access_sys_t
/* file format: true=TS, false=PES */
bool b_ts_format;
-};
+} access_sys_t;
#define CURRENT_FILE_SIZE ARRAY_VAL(p_sys->file_sizes, p_sys->i_current_file)
#define FILE_SIZE(pos) ARRAY_VAL(p_sys->file_sizes, pos)
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 863421141f..a3ff702087 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -87,12 +87,12 @@ struct services_discovery_sys_t
UpnpInstanceWrapper* p_upnp;
vlc_thread_t thread;
};
-} // namespace
struct access_sys_t
{
UpnpInstanceWrapper* p_upnp;
};
+} // namespace
UpnpInstanceWrapper* UpnpInstanceWrapper::s_instance;
vlc_mutex_t UpnpInstanceWrapper::s_lock = VLC_STATIC_MUTEX;
--
2.17.0
More information about the vlc-devel
mailing list