Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2013 10:40:52 +0000 (UTC)
From:      Alexander Leidinger <netchild@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253144 - head/sys/contrib/v4l
Message-ID:  <201307101040.r6AAeqbo092475@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: netchild
Date: Wed Jul 10 10:40:52 2013
New Revision: 253144
URL: http://svnweb.freebsd.org/changeset/base/253144

Log:
  Fix build for gcc users by declaring variables for unions in structs which
  don't declare a variable. The size before/after this change of the structs
  doesn't change with gcc/clang.
  
  Noticed by:	several
  Suggested by:	Gary Jennejohn <gljennjohn@googlemail.com>

Modified:
  head/sys/contrib/v4l/videodev2.h

Modified: head/sys/contrib/v4l/videodev2.h
==============================================================================
--- head/sys/contrib/v4l/videodev2.h	Wed Jul 10 10:38:43 2013	(r253143)
+++ head/sys/contrib/v4l/videodev2.h	Wed Jul 10 10:40:52 2013	(r253144)
@@ -427,7 +427,7 @@ struct v4l2_frmsizeenum {
 	union {					/* Frame size */
 		struct v4l2_frmsize_discrete	discrete;
 		struct v4l2_frmsize_stepwise	stepwise;
-	};
+	} x;
 
 	__u32   reserved[2];			/* Reserved space for future use */
 };
@@ -457,7 +457,7 @@ struct v4l2_frmivalenum {
 	union {					/* Frame interval */
 		struct v4l2_fract		discrete;
 		struct v4l2_frmival_stepwise	stepwise;
-	};
+	} x;
 
 	__u32	reserved[2];			/* Reserved space for future use */
 };
@@ -834,7 +834,7 @@ struct v4l2_dv_timings {
 	union {
 		struct v4l2_bt_timings	bt;
 		__u32	reserved[32];
-	};
+	} x;
 } __attribute__ ((packed));
 
 /* Values for the type field */
@@ -927,7 +927,7 @@ struct v4l2_ext_control {
 		__s32 value;
 		__s64 value64;
 		char *string;
-	};
+	} x;
 } __attribute__ ((packed));
 
 struct v4l2_ext_controls {
@@ -1475,7 +1475,7 @@ struct v4l2_encoder_cmd {
 		struct {
 			__u32 data[8];
 		} raw;
-	};
+	} x;
 };
 
 #endif
@@ -1597,7 +1597,7 @@ struct v4l2_mpeg_vbi_fmt_ivtv {
 	union {
 		struct v4l2_mpeg_vbi_itv0 itv0;
 		struct v4l2_mpeg_vbi_ITV0 ITV0;
-	};
+	} x;
 } __attribute__ ((packed));
 
 /*
@@ -1648,7 +1648,7 @@ struct v4l2_dbg_match {
 	union {     /* Match this chip, meaning determined by type */
 		__u32 addr;
 		char name[32];
-	};
+	} x;
 } __attribute__ ((packed));
 
 struct v4l2_dbg_register {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307101040.r6AAeqbo092475>