[PATCH] Variable sized structures cleanup

Change over a few variable sized structures to use the array[0] notation
instead of [1] or [4], etc. The ones fixed are glpoly_t, aliashdr_t and
sfxcache_t.

diff -urN -X exclude a/NQ/gl_model.h head/NQ/gl_model.h
--- a/NQ/gl_model.h	2006-05-20 17:10:37.000000000 +0930
+++ head/NQ/gl_model.h	2006-06-10 18:41:33.000000000 +0930
@@ -118,7 +118,7 @@
     struct glpoly_s *chain;
     int numverts;
     int flags;			// for SURF_UNDERWATER
-    float verts[4][VERTEXSIZE];	// variable sized (xyz s1t1 s2t2)
+    float verts[0][VERTEXSIZE];	// variable sized (xyz s1t1 s2t2)
 } glpoly_t;
 
 typedef struct msurface_s {
@@ -299,7 +299,7 @@
     int commands;		// gl command list with embedded s/t
     int gl_texturenum[MAX_SKINS][4];
     int texels[MAX_SKINS];	// only for player skins
-    maliasframedesc_t frames[1];	// variable sized
+    maliasframedesc_t frames[0];	// variable sized
 } aliashdr_t;
 
 #define	MAXALIASVERTS	2048
diff -urN -X exclude a/NQ/model.c head/NQ/model.c
--- a/NQ/model.c	2006-03-11 23:11:17.000000000 +1030
+++ head/NQ/model.c	2006-06-10 18:47:08.000000000 +0930
@@ -1445,7 +1445,7 @@
 // allocate space for a working header, plus all the data except the frames,
 // skin and group info
 //
-    size = sizeof(aliashdr_t) + (LittleLong(pinmodel->numframes) - 1) *
+    size = sizeof(aliashdr_t) + LittleLong(pinmodel->numframes) *
 	sizeof(pheader->frames[0]) +
 	sizeof(mdl_t) +
 	LittleLong(pinmodel->numverts) * sizeof(stvert_t) +
diff -urN -X exclude a/QW/client/gl_model.h head/QW/client/gl_model.h
--- a/QW/client/gl_model.h	2006-05-20 17:10:37.000000000 +0930
+++ head/QW/client/gl_model.h	2006-06-10 18:41:17.000000000 +0930
@@ -120,7 +120,7 @@
     struct glpoly_s *chain;
     int numverts;
     int flags;			// for SURF_UNDERWATER
-    float verts[4][VERTEXSIZE];	// variable sized (xyz s1t1 s2t2)
+    float verts[0][VERTEXSIZE];	// variable sized (xyz s1t1 s2t2)
 } glpoly_t;
 
 typedef struct msurface_s {
@@ -302,7 +302,7 @@
     int posedata;		// numposes*poseverts trivert_t
     int commands;		// gl command list with embedded s/t
     int gl_texturenum[MAX_SKINS][4];
-    maliasframedesc_t frames[1];	// variable sized
+    maliasframedesc_t frames[0];	// variable sized
 } aliashdr_t;
 
 #define	MAXALIASVERTS	2048
diff -urN -X exclude a/QW/client/model.c head/QW/client/model.c
--- a/QW/client/model.c	2006-03-11 23:11:17.000000000 +1030
+++ head/QW/client/model.c	2006-06-10 18:47:24.000000000 +0930
@@ -1466,7 +1466,7 @@
 // allocate space for a working header, plus all the data except the frames,
 // skin and group info
 //
-    size = sizeof(aliashdr_t) + (LittleLong(pinmodel->numframes) - 1) *
+    size = sizeof(aliashdr_t) + LittleLong(pinmodel->numframes) *
 	sizeof(pheader->frames[0]) +
 	sizeof(mdl_t) +
 	LittleLong(pinmodel->numverts) * sizeof(stvert_t) +
diff -urN -X exclude a/common/gl_model.c head/common/gl_model.c
--- a/common/gl_model.c	2005-01-29 11:16:40.000000000 +1030
+++ head/common/gl_model.c	2006-06-10 18:48:14.000000000 +0930
@@ -1606,7 +1606,7 @@
 // skin and group info
 //
     size = sizeof(aliashdr_t)
-	+ (LittleLong(pinmodel->numframes) - 1) * sizeof(pheader->frames[0]);
+	+ LittleLong(pinmodel->numframes) * sizeof(pheader->frames[0]);
     pheader = Hunk_AllocName(size, loadname);
 
     mod->flags = LittleLong(pinmodel->flags);
diff -urN -X exclude a/common/gl_rsurf.c head/common/gl_rsurf.c
--- a/common/gl_rsurf.c	2006-05-28 12:37:42.000000000 +0930
+++ head/common/gl_rsurf.c	2006-06-10 18:30:04.000000000 +0930
@@ -1214,8 +1214,7 @@
     // draw texture
     //
     poly =
-	Hunk_Alloc(sizeof(glpoly_t) +
-		   (lnumverts - 4) * VERTEXSIZE * sizeof(float));
+	Hunk_Alloc(sizeof(glpoly_t) + lnumverts * VERTEXSIZE * sizeof(float));
     poly->next = fa->polys;
     poly->flags = fa->flags;
     fa->polys = poly;
diff -urN -X exclude a/common/gl_warp.c head/common/gl_warp.c
--- a/common/gl_warp.c	2006-05-28 12:14:41.000000000 +0930
+++ head/common/gl_warp.c	2006-06-10 18:30:54.000000000 +0930
@@ -127,8 +127,7 @@
     }
 
     poly =
-	Hunk_Alloc(sizeof(glpoly_t) +
-		   (numverts - 4) * VERTEXSIZE * sizeof(float));
+	Hunk_Alloc(sizeof(glpoly_t) + numverts * VERTEXSIZE * sizeof(float));
     poly->next = warpface->polys;
     warpface->polys = poly;
     poly->numverts = numverts;
diff -urN -X exclude a/include/sound.h head/include/sound.h
--- a/include/sound.h	2004-07-25 16:00:01.000000000 +0930
+++ head/include/sound.h	2006-05-20 12:51:17.000000000 +0930
@@ -51,7 +51,7 @@
     int speed;
     int width;
     int stereo;
-    byte data[1];		// variable sized
+    byte data[0];		// variable sized
 } sfxcache_t;
 
 typedef struct {
