Lots of const correctness.

This commit is contained in:
Bill Currie 2010-09-02 13:01:45 +09:00
parent f4bff1d3b0
commit ef7958d680
19 changed files with 121 additions and 120 deletions

View File

@ -314,20 +314,20 @@ bsp_t *LoadBSPFile (QFile *file, size_t size);
void WriteBSPFile (const bsp_t *bsp, QFile *file);
bsp_t *BSP_New (void);
void BSP_Free (bsp_t *bsp);
void BSP_AddPlane (bsp_t *bsp, dplane_t *plane);
void BSP_AddLeaf (bsp_t *bsp, dleaf_t *leaf);
void BSP_AddVertex (bsp_t *bsp, dvertex_t *vertex);
void BSP_AddNode (bsp_t *bsp, dnode_t *node);
void BSP_AddTexinfo (bsp_t *bsp, texinfo_t *texinfo);
void BSP_AddFace (bsp_t *bsp, dface_t *face);
void BSP_AddClipnode (bsp_t *bsp, dclipnode_t *clipnode);
void BSP_AddPlane (bsp_t *bsp, const dplane_t *plane);
void BSP_AddLeaf (bsp_t *bsp, const dleaf_t *leaf);
void BSP_AddVertex (bsp_t *bsp, const dvertex_t *vertex);
void BSP_AddNode (bsp_t *bsp, const dnode_t *node);
void BSP_AddTexinfo (bsp_t *bsp, const texinfo_t *texinfo);
void BSP_AddFace (bsp_t *bsp, const dface_t *face);
void BSP_AddClipnode (bsp_t *bsp, const dclipnode_t *clipnode);
void BSP_AddMarkSurface (bsp_t *bsp, int marksurface);
void BSP_AddSurfEdge (bsp_t *bsp, int surfedge);
void BSP_AddEdge (bsp_t *bsp, dedge_t *edge);
void BSP_AddModel (bsp_t *bsp, dmodel_t *model);
void BSP_AddLighting (bsp_t *bsp, byte *lightdata, size_t lightdatasize);
void BSP_AddVisibility (bsp_t *bsp, byte *visdata, size_t visdatasize);
void BSP_AddEntities (bsp_t *bsp, char *entdata, size_t entdatasize);
void BSP_AddTextures (bsp_t *bsp, byte *texdata, size_t texdatasize);
void BSP_AddEdge (bsp_t *bsp, const dedge_t *edge);
void BSP_AddModel (bsp_t *bsp, const dmodel_t *model);
void BSP_AddLighting (bsp_t *bsp, const byte *lightdata, size_t lightdatasize);
void BSP_AddVisibility (bsp_t *bsp, const byte *visdata, size_t visdatasize);
void BSP_AddEntities (bsp_t *bsp, const char *entdata, size_t entdatasize);
void BSP_AddTextures (bsp_t *bsp, const byte *texdata, size_t texdatasize);
#endif//__bspfile_h_

View File

@ -402,49 +402,49 @@ BSP_Free (bsp_t *bsp)
} while (0)
VISIBLE void
BSP_AddPlane (bsp_t *bsp, dplane_t *plane)
BSP_AddPlane (bsp_t *bsp, const dplane_t *plane)
{
REALLOC (planes);
bsp->planes[bsp->numplanes++] = *plane;
}
VISIBLE void
BSP_AddLeaf (bsp_t *bsp, dleaf_t *leaf)
BSP_AddLeaf (bsp_t *bsp, const dleaf_t *leaf)
{
REALLOC (leafs);
bsp->leafs[bsp->numleafs++] = *leaf;
}
VISIBLE void
BSP_AddVertex (bsp_t *bsp, dvertex_t *vertex)
BSP_AddVertex (bsp_t *bsp, const dvertex_t *vertex)
{
REALLOC (vertexes);
bsp->vertexes[bsp->numvertexes++] = *vertex;
}
VISIBLE void
BSP_AddNode (bsp_t *bsp, dnode_t *node)
BSP_AddNode (bsp_t *bsp, const dnode_t *node)
{
REALLOC (nodes);
bsp->nodes[bsp->numnodes++] = *node;
}
VISIBLE void
BSP_AddTexinfo (bsp_t *bsp, texinfo_t *texinfo)
BSP_AddTexinfo (bsp_t *bsp, const texinfo_t *texinfo)
{
REALLOC (texinfo);
bsp->texinfo[bsp->numtexinfo++] = *texinfo;
}
VISIBLE void
BSP_AddFace (bsp_t *bsp, dface_t *face)
BSP_AddFace (bsp_t *bsp, const dface_t *face)
{
REALLOC (faces);
bsp->faces[bsp->numfaces++] = *face;
}
VISIBLE void
BSP_AddClipnode (bsp_t *bsp, dclipnode_t *clipnode)
BSP_AddClipnode (bsp_t *bsp, const dclipnode_t *clipnode)
{
REALLOC (clipnodes);
bsp->clipnodes[bsp->numclipnodes++] = *clipnode;
@ -465,14 +465,14 @@ BSP_AddSurfEdge (bsp_t *bsp, int surfedge)
}
VISIBLE void
BSP_AddEdge (bsp_t *bsp, dedge_t *edge)
BSP_AddEdge (bsp_t *bsp, const dedge_t *edge)
{
REALLOC (edges);
bsp->edges[bsp->numedges++] = *edge;
}
VISIBLE void
BSP_AddModel (bsp_t *bsp, dmodel_t *model)
BSP_AddModel (bsp_t *bsp, const dmodel_t *model)
{
REALLOC (models);
bsp->models[bsp->nummodels++] = *model;
@ -485,7 +485,7 @@ BSP_AddModel (bsp_t *bsp, dmodel_t *model)
} while (0)
VISIBLE void
BSP_AddLighting (bsp_t *bsp, byte *lightdata, size_t lightdatasize)
BSP_AddLighting (bsp_t *bsp, const byte *lightdata, size_t lightdatasize)
{
OWN (lightdata);
bsp->lightdatasize = lightdatasize;
@ -494,7 +494,7 @@ BSP_AddLighting (bsp_t *bsp, byte *lightdata, size_t lightdatasize)
}
VISIBLE void
BSP_AddVisibility (bsp_t *bsp, byte *visdata, size_t visdatasize)
BSP_AddVisibility (bsp_t *bsp, const byte *visdata, size_t visdatasize)
{
OWN (visdata);
bsp->visdatasize = visdatasize;
@ -503,7 +503,7 @@ BSP_AddVisibility (bsp_t *bsp, byte *visdata, size_t visdatasize)
}
VISIBLE void
BSP_AddEntities (bsp_t *bsp, char *entdata, size_t entdatasize)
BSP_AddEntities (bsp_t *bsp, const char *entdata, size_t entdatasize)
{
OWN (entdata);
bsp->entdatasize = entdatasize;
@ -512,7 +512,7 @@ BSP_AddEntities (bsp_t *bsp, char *entdata, size_t entdatasize)
}
VISIBLE void
BSP_AddTextures (bsp_t *bsp, byte *texdata, size_t texdatasize)
BSP_AddTextures (bsp_t *bsp, const byte *texdata, size_t texdatasize)
{
OWN (texdata);
bsp->texdatasize = texdatasize;

View File

@ -77,7 +77,7 @@ int PlaneTypeForNormal (const vec3_t normal);
\param side The side of the plane that will be front.
\return global plane number.
*/
int FindPlane (plane_t *dplane, int *side);
int FindPlane (const plane_t *dplane, int *side);
//@}

View File

@ -37,22 +37,22 @@ struct brush_s;
struct winding_s;
void Draw_ClearBounds (void);
void Draw_AddToBounds (vec3_t v);
void Draw_DrawFace (struct visfacet_s *f);
void Draw_AddToBounds (const vec3_t v);
void Draw_DrawFace (const struct visfacet_s *f);
void Draw_ClearWindow (void);
void Draw_SetRed (void);
void Draw_SetGrey (void);
void Draw_SetBlack (void);
void DrawPoint (vec3_t v);
void DrawPoint (const vec3_t v);
void Draw_SetColor (int c);
void SetColor (int c);
void DrawPortal (struct portal_s *p);
void DrawLeaf (struct node_s *l, int color);
void DrawBrush (struct brush_s *b);
void DrawPortal (const struct portal_s *p);
void DrawLeaf (const struct node_s *l, int color);
void DrawBrush (const struct brush_s *b);
void DrawWinding (struct winding_s *w);
void DrawTri (vec3_t p1, vec3_t p2, vec3_t p3);
void DrawWinding (const struct winding_s *w);
void DrawTri (const vec3_t p1, const vec3_t p2, const vec3_t p3);
//@}

View File

@ -89,7 +89,7 @@ int FindMiptex (const char *name);
\param ent The entity to dump.
*/
void PrintEntity (entity_t *ent);
void PrintEntity (const entity_t *ent);
/** Get the value for the specified key from an entity.
@ -98,7 +98,7 @@ void PrintEntity (entity_t *ent);
\return The value for the key, or the empty string if the key
does not exist in this entity.
*/
const char *ValueForKey (entity_t *ent, const char *key);
const char *ValueForKey (const entity_t *ent, const char *key);
/** Set the value of the entity's key.
If the key does not exist, one will be added.
@ -114,7 +114,7 @@ void SetKeyValue (entity_t *ent, const char *key, const char *value);
\param key The key of wich to parse the vector value.
\param vec The destination of the vector value.
*/
void GetVectorForKey (entity_t *ent, const char *key, vec3_t vec);
void GetVectorForKey (const entity_t *ent, const char *key, vec3_t vec);
/** Write all valid entities to the bsp file.

View File

@ -45,7 +45,7 @@ typedef struct winding_s {
\return The new winding.
\note It is the caller's responsibiltiy to free the new winding.
*/
winding_t *BaseWindingForPlane (struct plane_s *p);
winding_t *BaseWindingForPlane (const struct plane_s *p);
/** Create a new, empty winding with.
@ -67,7 +67,7 @@ void FreeWinding (winding_t *w);
\return The new winding.
\note It is the caller's responsibiltiy to free the new winding.
*/
winding_t *CopyWinding (winding_t *w);
winding_t *CopyWinding (const winding_t *w);
/** Create a new winding with the reverse points of the given winding.
@ -75,7 +75,7 @@ winding_t *CopyWinding (winding_t *w);
\return The new winding.
\note It is the caller's responsibiltiy to free the new winding.
*/
winding_t *CopyWindingReverse (winding_t *w);
winding_t *CopyWindingReverse (const winding_t *w);
/** Clip the winding to the plain.

View File

@ -48,7 +48,7 @@ void WriteClipNodes (struct node_s *headnode);
\param headnode The root of the map bsp.
*/
void WriteDrawNodes (struct node_s *headnode);
void WriteDrawNodes (const struct node_s *headnode);
/** Write the model information for the clipping hull.
@ -64,7 +64,7 @@ void BumpModel (int hullnum);
\param p The plane to add to the bsp.
\return The plane number within the bsp.
*/
int FindFinalPlane (dplane_t *p);
int FindFinalPlane (const dplane_t *p);
/** Prepare the bsp file for writing.

View File

@ -67,7 +67,7 @@ AllocBrush (void)
Note: this will not catch 0 area polygons
*/
static void
CheckFace (face_t *f)
CheckFace (const face_t *f)
{
int i, j;
vec_t *p1, *p2;
@ -91,8 +91,7 @@ CheckFace (face_t *f)
j = i + 1 == f->points->numpoints ? 0 : i + 1;
// check the point is on the face plane
d = DotProduct (p1, planes[f->planenum].normal)
- planes[f->planenum].dist;
d = PlaneDiff (p1, &planes[f->planenum]);
// point off plane autofix
if (d < -ON_EPSILON || d > ON_EPSILON)
@ -137,7 +136,7 @@ ClearBounds (brushset_t *bs)
}
static void
AddToBounds (brushset_t *bs, vec3_t v)
AddToBounds (brushset_t *bs, const vec3_t v)
{
int i;
@ -245,7 +244,7 @@ NormalizePlane (plane_t *dp)
}
int
FindPlane (plane_t *dplane, int *side)
FindPlane (const plane_t *dplane, int *side)
{
int i;
plane_t *dp, pl;
@ -437,7 +436,7 @@ int num_hull_edges;
int hull_edges[MAX_HULL_EDGES][2];
static void
AddBrushPlane (plane_t *plane)
AddBrushPlane (const plane_t *plane)
{
float l;
int i;
@ -467,7 +466,7 @@ AddBrushPlane (plane_t *plane)
vertexes can be put on the front side
*/
static void
TestAddPlane (plane_t *plane)
TestAddPlane (const plane_t *plane)
{
int c, i;
int counts[3];
@ -523,7 +522,7 @@ TestAddPlane (plane_t *plane)
Doesn't add if duplicated
*/
static int
AddHullPoint (vec3_t p, int hullnum)
AddHullPoint (const vec3_t p, int hullnum)
{
int i, x, y, z;
vec_t *c;
@ -559,7 +558,7 @@ AddHullPoint (vec3_t p, int hullnum)
Creates all of the hull planes around the given edge, if not done already
*/
static void
AddHullEdge (vec3_t p1, vec3_t p2, int hullnum)
AddHullEdge (const vec3_t p1, const vec3_t p2, int hullnum)
{
int pt1, pt2, a, b, c, d, e, i;
plane_t plane;
@ -662,12 +661,12 @@ ExpandBrush (int hullnum)
Converts a mapbrush to a bsp brush
*/
static brush_t *
LoadBrush (mbrush_t *mb, int hullnum)
LoadBrush (const mbrush_t *mb, int hullnum)
{
brush_t *b;
char *name;
const char *name;
int contents;
mface_t *f;
const mface_t *f;
// check texture name for attributes
if (mb->faces->texinfo < 0) {
@ -738,7 +737,7 @@ LoadBrush (mbrush_t *mb, int hullnum)
}
static void
Brush_DrawAll (brushset_t *bs)
Brush_DrawAll (const brushset_t *bs)
{
brush_t *b;
face_t *f;

View File

@ -516,9 +516,9 @@ LoadMapFile (const char *filename)
}
void
PrintEntity (entity_t *ent)
PrintEntity (const entity_t *ent)
{
epair_t *ep;
const epair_t *ep;
for (ep = ent->epairs; ep; ep = ep->next)
printf ("%20s : %s\n", ep->key, ep->value);
@ -526,9 +526,9 @@ PrintEntity (entity_t *ent)
const char *
ValueForKey (entity_t *ent, const char *key)
ValueForKey (const entity_t *ent, const char *key)
{
epair_t *ep;
const epair_t *ep;
for (ep = ent->epairs; ep; ep = ep->next)
if (!strcmp (ep->key, key))
@ -555,7 +555,7 @@ SetKeyValue (entity_t *ent, const char *key, const char *value)
}
void
GetVectorForKey (entity_t *ent, const char *key, vec3_t vec)
GetVectorForKey (const entity_t *ent, const char *key, vec3_t vec)
{
const char *k;
double v1, v2, v3;
@ -573,7 +573,7 @@ void
WriteEntitiesToString (void)
{
dstring_t *buf;
epair_t *ep;
const epair_t *ep;
int i;
buf = dstring_newstr ();

View File

@ -220,7 +220,7 @@ MergePlaneFaces (surface_t *plane)
}
void
MergeAll (surface_t * surfhead)
MergeAll (surface_t *surfhead)
{
face_t *f;
int mergefaces;

View File

@ -37,12 +37,12 @@ Draw_ClearBounds (void)
}
void
Draw_AddToBounds (vec3_t v)
Draw_AddToBounds (const vec3_t v)
{
}
void
Draw_DrawFace (struct visfacet_s *f)
Draw_DrawFace (const struct visfacet_s *f)
{
}
@ -67,32 +67,32 @@ Draw_SetBlack (void)
}
void
DrawPoint (vec3_t v)
DrawPoint (const vec3_t v)
{
}
void
DrawLeaf (struct node_s *l, int color)
DrawLeaf (const struct node_s *l, int color)
{
}
void
DrawBrush (struct brush_s *b)
DrawBrush (const struct brush_s *b)
{
}
void
DrawWinding (struct winding_s *w)
DrawWinding (const struct winding_s *w)
{
}
void
DrawTri (vec3_t p1, vec3_t p2, vec3_t p3)
DrawTri (const vec3_t p1, const vec3_t p2, const vec3_t p3)
{
}
void
DrawPortal (struct portal_s *portal)
DrawPortal (const struct portal_s *portal)
{
}

View File

@ -46,7 +46,7 @@ int outleafs;
\return The leaf node in which the point is.
*/
static node_t *
PointInLeaf (node_t *node, vec3_t point)
PointInLeaf (node_t *node, const vec3_t point)
{
vec_t d;
@ -98,7 +98,7 @@ FloodEntDist_r (node_t *n, int dist)
\return true if the entity could be placed, false otherwise.
*/
static qboolean
PlaceOccupant (int num, vec3_t point, node_t *headnode)
PlaceOccupant (int num, const vec3_t point, node_t *headnode)
{
node_t *n;
@ -112,7 +112,7 @@ PlaceOccupant (int num, vec3_t point, node_t *headnode)
return true;
}
portal_t *prevleaknode;
const portal_t *prevleaknode;
FILE *leakfile;
/** Write the coords for points joining two portals to the point file.
@ -121,11 +121,11 @@ FILE *leakfile;
\note The first portal is set by the preceeding call.
*/
static void
MarkLeakTrail (portal_t *n2)
MarkLeakTrail (const portal_t *n2)
{
float len;
int i, j;
portal_t *n1;
const portal_t *n1;
vec3_t p1, p2, dir;
n1 = prevleaknode;
@ -172,10 +172,10 @@ MarkLeakTrail2 (void)
{
int i;
int next, side;
node_t *n, *nextnode;
portal_t *p, *p2;
const node_t *n, *nextnode;
const portal_t *p, *p2;
vec3_t wc;
vec_t *v;
const vec_t *v;
leakfile = fopen (options.pointfile, "w");
if (!leakfile)
@ -238,7 +238,7 @@ RecursiveFillOutside (node_t *l, qboolean fill)
return false;
if (l->occupied) {
vec_t *v;
const vec_t *v;
hit_occupied = l->occupied;
v = entities[hit_occupied].origin;
qprintf ("reached occupant at: (%4.0f,%4.0f,%4.0f) %s\n", v[0], v[1],

View File

@ -237,7 +237,7 @@ MakeHeadnodePortals (node_t *node)
\param plane The plane to set.
*/
static void
PlaneFromWinding (winding_t *w, plane_t *plane)
PlaneFromWinding (const winding_t *w, plane_t *plane)
{
vec3_t v1, v2;
@ -432,7 +432,7 @@ int num_realleafs;
\return 1 if the node has the specified contents, otherwise 0.
*/
static int
HasContents (node_t *n, int cont)
HasContents (const node_t *n, int cont)
{
if (n->contents == cont)
return 1;
@ -449,7 +449,7 @@ HasContents (node_t *n, int cont)
\param n2 The second node to check.
*/
static int
ShareContents (node_t *n1, node_t *n2)
ShareContents (const node_t *n1, const node_t *n2)
{
if (n1->contents) {
if (n1->contents == CONTENTS_SOLID)
@ -471,7 +471,7 @@ ShareContents (node_t *n1, node_t *n2)
\param n2 The second node to check.
*/
static int
SameContents (node_t *n1, node_t *n2)
SameContents (const node_t *n1, const node_t *n2)
{
if (n1->contents == CONTENTS_SOLID || n2->contents == CONTENTS_SOLID)
return 0;
@ -494,12 +494,13 @@ SameContents (node_t *n1, node_t *n2)
\param node The current node of the bsp. Call with the root node.
*/
static void
WritePortalFile_r (node_t *node)
WritePortalFile_r (const node_t *node)
{
int i;
plane_t *pl, plane2;
portal_t *p;
winding_t *w;
const plane_t *pl;
plane_t plane2;
const portal_t *p;
const winding_t *w;
if (!node->contents && !node->detail) {
WritePortalFile_r (node->children[0]);
@ -547,7 +548,7 @@ WritePortalFile_r (node_t *node)
\param n The current node of the bsp. Call with the root node.
*/
static void
WritePortalLeafs_r (node_t *n)
WritePortalLeafs_r (const node_t *n)
{
if (!n->contents) {
WritePortalLeafs_r (n->children[0]);

View File

@ -104,7 +104,7 @@ load_edges (void)
static void
load_planes (void)
{
dplane_t *p;
const dplane_t *p;
int i;
memset (planes, 0, sizeof (planes));
@ -126,7 +126,7 @@ load_marksurfaces (void)
static void
load_faces (void)
{
dface_t *f;
const dface_t *f;
int i, j;
winding_t *points;
@ -164,7 +164,7 @@ load_vertices (void)
static void
load_leafs (void)
{
dleaf_t *l;
const dleaf_t *l;
int i, j;
leafs = calloc (bsp->numleafs, sizeof (node_t));
@ -186,7 +186,7 @@ load_leafs (void)
static void
load_nodes (void)
{
dnode_t *n;
const dnode_t *n;
face_t *f;
int i, j;
@ -373,10 +373,10 @@ unique_name (wad_t *wad, const char *name)
void
extract_textures (void)
{
dmiptexlump_t *miptexlump = (dmiptexlump_t *) bsp->texdata;
const dmiptexlump_t *miptexlump = (dmiptexlump_t *) bsp->texdata;
miptex_t *miptex;
int i, mtsize, pixels;
char *wadfile;
const char *wadfile;
wad_t *wad;
const char *uname;
@ -409,7 +409,7 @@ extract_textures (void)
void
extract_entities (void)
{
char *entfile;
const char *entfile;
int i;
QFile *ef;
@ -431,7 +431,7 @@ void
extract_hull (void)
{
// hullfile = output_file (".c");
char *hullfile;
const char *hullfile;
int i, j;
QFile *hf;

View File

@ -66,12 +66,12 @@ qboolean usemidsplit;
</dl>
*/
static int
FaceSide (face_t *in, plane_t *split)
FaceSide (const face_t *in, const plane_t *split)
{
int frontcount, backcount, i;
vec_t dot;
vec_t *p;
winding_t *inp = in->points;
const vec_t *p;
const winding_t *inp = in->points;
frontcount = backcount = 0;
@ -126,7 +126,8 @@ FaceSide (face_t *in, plane_t *split)
\return The chosen surface.
*/
static surface_t *
ChooseMidPlaneFromList (surface_t *surfaces, vec3_t mins, vec3_t maxs)
ChooseMidPlaneFromList (surface_t *surfaces,
const vec3_t mins, const vec3_t maxs)
{
int j, l;
plane_t *plane;
@ -190,7 +191,7 @@ ChooseMidPlaneFromList (surface_t *surfaces, vec3_t mins, vec3_t maxs)
not be found.
*/
static surface_t *
ChoosePlaneFromList (surface_t *surfaces, vec3_t mins, vec3_t maxs,
ChoosePlaneFromList (surface_t *surfaces, const vec3_t mins, const vec3_t maxs,
qboolean usefloors, qboolean usedetail)
{
face_t *f;

View File

@ -252,7 +252,7 @@ InitHash (void)
\return The hash value of the vector.
*/
static unsigned
HashVec (vec3_t vec)
HashVec (const vec3_t vec)
{
unsigned h;
@ -269,7 +269,7 @@ HashVec (vec3_t vec)
\param planenum The plane on which this vertex is.
*/
static int
GetVertex (vec3_t in, int planenum)
GetVertex (const vec3_t in, int planenum)
{
hashvert_t *hv;
int h, i;
@ -343,7 +343,7 @@ int c_tryedges;
be negative, indicating the ends of the edge are reversed.
*/
static int
GetEdge (vec3_t p1, vec3_t p2, face_t *f)
GetEdge (const vec3_t p1, const vec3_t p2, face_t *f)
{
dedge_t edge;
int v1, v2, i;

View File

@ -77,7 +77,7 @@ static vec3_t hash_min, hash_scale;
\param maxs The maximum of the bounding box in which the edges reside.
*/
static void
InitHash (vec3_t mins, vec3_t maxs)
InitHash (const vec3_t mins, const vec3_t maxs)
{
int newsize[2];
vec3_t size;
@ -106,7 +106,7 @@ InitHash (vec3_t mins, vec3_t maxs)
\return The hash value of the vector.
*/
static unsigned
HashVec (vec3_t vec)
HashVec (const vec3_t vec)
{
unsigned h;
@ -178,7 +178,7 @@ CanonicalVector (vec3_t vec)
point is represented by t1 and t2.
*/
static wedge_t *
FindEdge (vec3_t p1, vec3_t p2, vec_t *t1, vec_t *t2)
FindEdge (const vec3_t p1, const vec3_t p2, vec_t *t1, vec_t *t2)
{
int h;
vec3_t dir, origin;
@ -276,7 +276,7 @@ AddVert (wedge_t *w, vec_t t)
\param p2 The second point of the face's edge.
*/
static void
AddEdge (vec3_t p1, vec3_t p2)
AddEdge (const vec3_t p1, const vec3_t p2)
{
wedge_t *w;
vec_t t1, t2;
@ -292,7 +292,7 @@ AddEdge (vec3_t p1, vec3_t p2)
\param f The face from which to add the faces.
*/
static void
AddFaceEdges (face_t *f)
AddFaceEdges (const face_t *f)
{
int i, j;

View File

@ -47,7 +47,7 @@ static __attribute__ ((used)) const char rcsid[] =
int c_activewindings, c_peakwindings;
winding_t *
BaseWindingForPlane (plane_t *p)
BaseWindingForPlane (const plane_t *p)
{
int i, x;
vec_t max, v;
@ -111,7 +111,7 @@ BaseWindingForPlane (plane_t *p)
}
winding_t *
CopyWinding (winding_t *w)
CopyWinding (const winding_t *w)
{
size_t size;
winding_t *c;
@ -123,7 +123,7 @@ CopyWinding (winding_t *w)
}
winding_t *
CopyWindingReverse (winding_t *w)
CopyWindingReverse (const winding_t *w)
{
int i;
size_t size;

View File

@ -54,9 +54,9 @@ int firstface;
int
FindFinalPlane (dplane_t *p)
FindFinalPlane (const dplane_t *p)
{
dplane_t *dplane;
const dplane_t *dplane;
int i;
for (i = 0, dplane = bsp->planes; i < bsp->numplanes; i++, dplane++) {
@ -160,7 +160,7 @@ WriteClipNodes (node_t *nodes)
\param node The leaf node to be written to the bsp file.
*/
static void
WriteLeaf (node_t *node)
WriteLeaf (const node_t *node)
{
dleaf_t leaf_p;
face_t **fp, *f;
@ -201,7 +201,7 @@ WriteLeaf (node_t *node)
\param node The current node to be written.
*/
static void
WriteDrawNodes_r (node_t *node)
WriteDrawNodes_r (const node_t *node)
{
static dnode_t dummy;
dnode_t *n;
@ -239,7 +239,7 @@ WriteDrawNodes_r (node_t *node)
}
void
WriteDrawNodes (node_t *headnode)
WriteDrawNodes (const node_t *headnode)
{
dmodel_t bm;
int start, i;
@ -299,7 +299,7 @@ wadlist_t *wadlist;
\param path The path to the wad file.
*/
static int
TEX_InitFromWad (char *path)
TEX_InitFromWad (const char *path)
{
wadlist_t *wl;
wad_t *wad;
@ -334,7 +334,7 @@ TEX_InitFromWad (char *path)
found.
*/
static int
LoadLump (char *name, dstring_t *dest)
LoadLump (const char *name, dstring_t *dest)
{
int r;
int ofs = dest->size;