[PATCH] world.c cleanups

Mostly whitespace cleanups in the world.c's, and a little one in pmovetst.c
since it's largely copied from world.c. This is mainly to keep the differences
between NQ/QW versions as small as possible.

The only (minor) code changes are a little cleanup of SV_TestEntityPosition
(should be semantically the same) and changing the "backup past 0" message to
be developer only.

diff -urN a/NQ/world.c head/NQ/world.c
--- a/NQ/world.c	2006-03-09 19:56:59.000000000 +1030
+++ head/NQ/world.c	2006-03-09 20:00:10.000000000 +1030
@@ -312,7 +312,6 @@
 	pr_global_struct->self = EDICT_TO_PROG(touch);
 	pr_global_struct->other = EDICT_TO_PROG(ent);
 	pr_global_struct->time = sv.time;
-
 	PR_ExecuteProgram(touch->v.touch);
 
 	/* the PR_ExecuteProgram above can alter the linked edicts */
@@ -401,22 +400,24 @@
     if (ent->free)
 	return;
 
-    // set the abs box
+    /* set the abs box */
     VectorAdd(ent->v.origin, ent->v.mins, ent->v.absmin);
     VectorAdd(ent->v.origin, ent->v.maxs, ent->v.absmax);
 
-    //
-    // to make items easier to pick up and allow them to be grabbed off
-    // of shelves, the abs sizes are expanded
-    //
+    /*
+     * To make items easier to pick up and allow them to be grabbed off of
+     * shelves, the abs sizes are expanded
+     */
     if ((int)ent->v.flags & FL_ITEM) {
 	ent->v.absmin[0] -= 15;
 	ent->v.absmin[1] -= 15;
 	ent->v.absmax[0] += 15;
 	ent->v.absmax[1] += 15;
     } else {
-	// because movement is clipped an epsilon away from an actual edge,
-	// we must fully check even when bounding boxes don't quite touch
+	/*
+	 * because movement is clipped an epsilon away from an actual edge, we
+	 * must fully check even when bounding boxes don't quite touch
+	 */
 	ent->v.absmin[0] -= 1;
 	ent->v.absmin[1] -= 1;
 	ent->v.absmin[2] -= 1;
@@ -425,7 +426,7 @@
 	ent->v.absmax[2] += 1;
     }
 
-    // link to PVS leafs
+    /* link to PVS leafs */
     ent->num_leafs = 0;
     if (ent->v.modelindex)
 	SV_FindTouchedLeafs(ent, sv.worldmodel->nodes);
@@ -433,7 +434,7 @@
     if (ent->v.solid == SOLID_NOT)
 	return;
 
-    // find the first node that the ent's box crosses
+    /* find the first node that the ent's box crosses */
     node = sv_areanodes;
     while (1) {
 	if (node->axis == -1)
@@ -446,14 +447,14 @@
 	    break;		// crosses the node
     }
 
-    // link it in
+    /* link it in */
     if (ent->v.solid == SOLID_TRIGGER)
 	InsertLinkBefore(&ent->area, &node->trigger_edicts);
     else
 	InsertLinkBefore(&ent->area, &node->solid_edicts);
 
-    // if touch_triggers, touch all entities at this node and decend for more
     if (touch_triggers)
+	/* touch all entities at this node and decend for more */
 	SV_TouchLinks(ent, sv_areanodes);
 }
 
@@ -545,18 +546,16 @@
 SV_TestEntityPosition(edict_t *ent)
 {
     trace_t trace;
+    entvars_t *v = &ent->v;
+    edict_t *ret = NULL;
 
-    trace =
-	SV_Move(ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, 0,
-		ent);
-
+    trace = SV_Move(v->origin, v->mins, v->maxs, v->origin, 0, ent);
     if (trace.startsolid)
-	return sv.edicts;
+	ret = sv.edicts;
 
-    return NULL;
+    return ret;
 }
 
-
 /*
 ===============================================================================
 
@@ -684,8 +683,8 @@
 	trace->plane.dist = -plane->dist;
     }
 
-    while (SV_HullPointContents(hull, hull->firstclipnode, mid)
-	   == CONTENTS_SOLID) {	// shouldn't really happen, but does occasionally
+    /* shouldn't really happen, but does occasionally */
+    while (SV_HullPointContents(hull, hull->firstclipnode, mid) == CONTENTS_SOLID) {
 	frac -= 0.1;
 	if (frac < 0) {
 	    trace->fraction = midf;
diff -urN a/QW/common/pmovetst.c head/QW/common/pmovetst.c
--- a/QW/common/pmovetst.c	2006-03-09 19:56:59.000000000 +1030
+++ head/QW/common/pmovetst.c	2006-03-09 17:59:40.000000000 +1030
@@ -308,8 +308,8 @@
 	trace->plane.dist = -plane->dist;
     }
 
-    while (PM_HullPointContents(hull, hull->firstclipnode, mid)
-	   == CONTENTS_SOLID) {	// shouldn't really happen, but does occasionally
+    /* shouldn't really happen, but does occasionally */
+    while (PM_HullPointContents(hull, hull->firstclipnode, mid) == CONTENTS_SOLID) {
 	frac -= 0.1;
 	if (frac < 0) {
 	    trace->fraction = midf;
diff -urN a/QW/server/world.c head/QW/server/world.c
--- a/QW/server/world.c	2006-03-09 19:56:59.000000000 +1030
+++ head/QW/server/world.c	2006-03-09 20:00:16.000000000 +1030
@@ -94,7 +94,6 @@
 	box_planes[i].type = i >> 1;
 	box_planes[i].normal[i >> 1] = 1;
     }
-
 }
 
 
@@ -160,8 +159,8 @@
 // calculate an offset value to center the origin
 	VectorSubtract(hull->clip_mins, mins, offset);
 	VectorAdd(offset, ent->v.origin, offset);
-    } else {			// create a temp hull from bounding box sizes
-
+    } else {
+	/* create a temp hull from bounding box sizes */
 	VectorSubtract(ent->v.mins, maxs, hullmins);
 	VectorSubtract(ent->v.maxs, mins, hullmaxs);
 	hull = SV_HullForBox(hullmins, hullmaxs);
@@ -169,7 +168,6 @@
 	VectorCopy(ent->v.origin, offset);
     }
 
-
     return hull;
 }
 
@@ -307,7 +305,6 @@
 	    Con_DPrintf("Warning: fixed up link in %s\n", __func__);
 	    next = l->next;
 	}
-
 	pr_global_struct->self = old_self;
 	pr_global_struct->other = old_other;
     }
@@ -386,21 +383,24 @@
     if (ent->free)
 	return;
 
-// set the abs box
+    /* set the abs box */
     VectorAdd(ent->v.origin, ent->v.mins, ent->v.absmin);
     VectorAdd(ent->v.origin, ent->v.maxs, ent->v.absmax);
 
-//
-// to make items easier to pick up and allow them to be grabbed off
-// of shelves, the abs sizes are expanded
-//
+    /*
+     * To make items easier to pick up and allow them to be grabbed off of
+     * shelves, the abs sizes are expanded
+     */
     if ((int)ent->v.flags & FL_ITEM) {
 	ent->v.absmin[0] -= 15;
 	ent->v.absmin[1] -= 15;
 	ent->v.absmax[0] += 15;
 	ent->v.absmax[1] += 15;
-    } else {			// because movement is clipped an epsilon away from an actual edge,
-	// we must fully check even when bounding boxes don't quite touch
+    } else {
+	/*
+	 * because movement is clipped an epsilon away from an actual edge, we
+	 * must fully check even when bounding boxes don't quite touch
+	 */
 	ent->v.absmin[0] -= 1;
 	ent->v.absmin[1] -= 1;
 	ent->v.absmin[2] -= 1;
@@ -409,7 +409,7 @@
 	ent->v.absmax[2] += 1;
     }
 
-// link to PVS leafs
+    /* link to PVS leafs */
     ent->num_leafs = 0;
     if (ent->v.modelindex)
 	SV_FindTouchedLeafs(ent, sv.worldmodel->nodes);
@@ -417,7 +417,7 @@
     if (ent->v.solid == SOLID_NOT)
 	return;
 
-// find the first node that the ent's box crosses
+    /* find the first node that the ent's box crosses */
     node = sv_areanodes;
     while (1) {
 	if (node->axis == -1)
@@ -430,15 +430,14 @@
 	    break;		// crosses the node
     }
 
-// link it in
-
+    /* link it in */
     if (ent->v.solid == SOLID_TRIGGER)
 	InsertLinkBefore(&ent->area, &node->trigger_edicts);
     else
 	InsertLinkBefore(&ent->area, &node->solid_edicts);
 
-// if touch_triggers, touch all entities at this node and decend for more
     if (touch_triggers)
+	/* touch all entities at this node and decend for more */
 	SV_TouchLinks(ent, sv_areanodes);
 }
 
@@ -447,12 +446,12 @@
 /*
 ===============================================================================
 
-POINT TESTING IN HULLS
+				POINT TESTING IN HULLS
 
 ===============================================================================
 */
 
-#if	!id386
+#if !id386
 
 /*
 ==================
@@ -520,15 +519,14 @@
 SV_TestEntityPosition(edict_t *ent)
 {
     trace_t trace;
+    entvars_t *v = &ent->v;
+    edict_t *ret = NULL;
 
-    trace =
-	SV_Move(ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, 0,
-		ent);
-
+    trace = SV_Move(v->origin, v->mins, v->maxs, v->origin, 0, ent);
     if (trace.startsolid)
-	return sv.edicts;
+	ret = sv.edicts;
 
-    return NULL;
+    return ret;
 }
 
 /*
@@ -658,13 +656,13 @@
 	trace->plane.dist = -plane->dist;
     }
 
-    while (SV_HullPointContents(hull, hull->firstclipnode, mid)
-	   == CONTENTS_SOLID) {	// shouldn't really happen, but does occasionally
+    /* shouldn't really happen, but does occasionally */
+    while (SV_HullPointContents(hull, hull->firstclipnode, mid) == CONTENTS_SOLID) {
 	frac -= 0.1;
 	if (frac < 0) {
 	    trace->fraction = midf;
 	    VectorCopy(mid, trace->endpos);
-	    Con_Printf("backup past 0\n");
+	    Con_DPrintf("backup past 0\n");
 	    return false;
 	}
 	midf = p1f + (p2f - p1f) * frac;
