[vlc-commits] vdpau/instance: simplify the structure name allocation
Steve Lhomme
git at videolan.org
Wed Nov 27 12:47:01 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Nov 27 11:22:12 2019 +0100| [4f7aac3d877ecff610ddcf584bf3500aa2b5d536] | committer: Steve Lhomme
vdpau/instance: simplify the structure name allocation
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4f7aac3d877ecff610ddcf584bf3500aa2b5d536
---
modules/hw/vdpau/instance.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules/hw/vdpau/instance.c b/modules/hw/vdpau/instance.c
index ddf1177276..c55bbcb787 100644
--- a/modules/hw/vdpau/instance.c
+++ b/modules/hw/vdpau/instance.c
@@ -39,10 +39,10 @@ typedef struct vdp_instance
VdpDevice device;
int num; /**< X11 screen number */
- char *name; /**< X11 display name */
uintptr_t refs; /**< Reference count */
struct vdp_instance *next;
+ char name[]; /**< X11 display name */
} vdp_instance_t;
static VdpStatus vdp_instance_create(const char *name, int num,
@@ -62,7 +62,6 @@ static VdpStatus vdp_instance_create(const char *name, int num,
}
vi->next = NULL;
- vi->name = (void *)(vi + 1);
memcpy(vi->name, name, namelen);
if (num >= 0)
vi->num = num;
More information about the vlc-commits
mailing list