Skip to content

Commit 793e7ca

Browse files
Start to fix compiler warnings
1 parent d7a52f4 commit 793e7ca

File tree

19 files changed

+292
-248
lines changed

19 files changed

+292
-248
lines changed

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/graphDFSUtils.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ extern void _ClearVertexVisitedFlags(graphP theGraph, int);
2626

2727
#include "lowLevelUtils/platformTime.h"
2828

29+
int _SortVertices(graphP theGraph);
30+
2931
int gp_CreateDFSTree(graphP theGraph)
3032
{
3133
stackP theStack;
@@ -376,7 +378,8 @@ int gp_LowpointAndLeastAncestor(graphP theGraph)
376378
graphs that may be designed and stored in a DFI sorted format.
377379
********************************************************************/
378380

379-
int gp_LeastAncestor(graphP theGraph)
381+
#if false
382+
static int gp_LeastAncestor(graphP theGraph)
380383
{
381384
stackP theStack = theGraph->theStack;
382385
int v, u, uneighbor, e, leastAncestor;
@@ -455,3 +458,4 @@ int gp_LeastAncestor(graphP theGraph)
455458

456459
return OK;
457460
}
461+
#endif

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/graphLib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ extern "C"
5656
}
5757
#endif
5858

59-
#endif
59+
#endif

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/graphUtils.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ void _RestoreEdge(graphP theGraph, int arcPos);
3434
int _ContractEdge(graphP theGraph, int e);
3535
int _IdentifyVertices(graphP theGraph, int u, int v, int eBefore);
3636
int _RestoreVertex(graphP theGraph);
37+
int _ClearVisitedFlagsOnPath(graphP theGraph, int u, int v, int w, int x);
38+
int _SetVisitedFlagsOnPath(graphP theGraph, int u, int v, int w, int x);
39+
int _ComputeArcType(graphP theGraph, int a, int b, int edgeType);
40+
int _SetEdgeType(graphP theGraph, int u, int v);
41+
42+
int debugNOTOK(void);
3743

3844
/********************************************************************
3945
Private functions, except exported within library
@@ -286,7 +292,7 @@ void _InitVertices(graphP theGraph)
286292
memset(theGraph->extFace, NIL_CHAR, gp_VertexIndexBound(theGraph) * sizeof(extFaceLinkRec));
287293

288294
for (v = gp_GetFirstVertex(theGraph); gp_VertexInRange(theGraph, v); v++)
289-
gp_InitVertexFlags(theGraph, v);
295+
gp_InitVertexFlags(theGraph, v);
290296
#endif
291297
// N.B. This is the legacy API-based approach to initializing the vertices
292298
// int v;
@@ -1178,7 +1184,7 @@ int _GetRandomNumber(int NMin, int NMax)
11781184
11791185
********************************************************************/
11801186

1181-
int _getUnprocessedChild(graphP theGraph, int parent)
1187+
static int _getUnprocessedChild(graphP theGraph, int parent)
11821188
{
11831189
int e = gp_GetFirstArc(theGraph, parent);
11841190
int eTwin = gp_GetTwinArc(theGraph, e);
@@ -1227,7 +1233,8 @@ int _getUnprocessedChild(graphP theGraph, int parent)
12271233
unless the given vertex has an unprocessed child.
12281234
********************************************************************/
12291235

1230-
int _hasUnprocessedChild(graphP theGraph, int parent)
1236+
#if false
1237+
static int _hasUnprocessedChild(graphP theGraph, int parent)
12311238
{
12321239
int e = gp_GetFirstArc(theGraph, parent);
12331240

@@ -1239,6 +1246,7 @@ int _hasUnprocessedChild(graphP theGraph, int parent)
12391246

12401247
return 1;
12411248
}
1249+
#endif
12421250

12431251
/********************************************************************
12441252
gp_CreateRandomGraphEx()
@@ -1821,7 +1829,7 @@ int gp_DeleteEdge(graphP theGraph, int e, int nextLink)
18211829
from the stack for restoration.
18221830
********************************************************************/
18231831

1824-
void _RestoreArc(graphP theGraph, int arc)
1832+
static void _RestoreArc(graphP theGraph, int arc)
18251833
{
18261834
int nextArc = gp_GetNextArc(theGraph, arc),
18271835
prevArc = gp_GetPrevArc(theGraph, arc);
@@ -2259,7 +2267,7 @@ int _IdentifyVertices(graphP theGraph, int u, int v, int eBefore)
22592267
Returns OK for success, NOTOK for internal failure.
22602268
********************************************************************/
22612269

2262-
int gp_RestoreVertex(graphP theGraph)
2270+
static int gp_RestoreVertex(graphP theGraph)
22632271
{
22642272
return theGraph->functions.fpRestoreVertex(theGraph);
22652273
}

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/homeomorphSearch/graphK33Search.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ extern int _AddAndMarkUnembeddedEdges(graphP theGraph);
5959

6060
extern void _K33Search_InitEdgeRec(K33SearchContext *context, int e);
6161

62+
int _MarkStraddlingBridgePath(graphP theGraph, int u_min, int u_max, int u_d, int d);
63+
6264
/* Private functions for K_{3,3} searching. */
6365

6466
int _SearchForK33InBicomp(graphP theGraph, K33SearchContext *context, int v, int R);
@@ -75,7 +77,6 @@ int _FindExternalConnectionDescendantEndpoint(graphP theGraph, int ancestor,
7577
int _SearchForMergeBlocker(graphP theGraph, K33SearchContext *context, int v, int *pMergeBlocker);
7678
int _FindK33WithMergeBlocker(graphP theGraph, K33SearchContext *context, int v, int mergeBlocker);
7779

78-
int _MarkLowestXYPath(graphP theGraph);
7980
int _TestForZtoWPath(graphP theGraph);
8081
int _TestForStraddlingBridge(graphP theGraph, K33SearchContext *context, int u_max);
8182
int _K33Search_DeleteUnmarkedEdgesInBicomp(graphP theGraph, K33SearchContext *context, int BicompRoot);
@@ -918,7 +919,7 @@ int _FindK33WithMergeBlocker(graphP theGraph, K33SearchContext *context, int v,
918919
The function returns NOTOK on internal error, OK otherwise.
919920
920921
Preconditions: The X-Y path is marked visited by a prior invocation of
921-
the meothd _MarkLowestXYPath() above.
922+
the method _MarkLowestXYPath() above.
922923
923924
So, we start a depth first search from W to find a visited vertex, except
924925
we prune the search to ignore vertices whose obstruction type is other than

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/homeomorphSearch/graphK4Search.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ int _K4_ReducePathComponent(graphP theGraph, K4SearchContext *context, int R, in
10181018
marked for isolation.
10191019
********************************************************************/
10201020

1021-
int _K4_DeleteEdge(graphP theGraph, K4SearchContext *context, int e, int nextLink)
1021+
static int _K4_DeleteEdge(graphP theGraph, K4SearchContext *context, int e, int nextLink)
10221022
{
10231023
_K4Search_InitEdgeRec(context, e);
10241024
_K4Search_InitEdgeRec(context, gp_GetTwinArc(theGraph, e));

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/io/g6-read-iterator.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ int _beginG6ReadIteration(G6ReadIterator *pG6ReadIterator)
226226

227227
int _processAndCheckHeader(strOrFileP g6Input)
228228
{
229+
char const*correctG6Header,*sparse6Header,*digraph6Header;
229230
int exitCode = OK;
230231

231232
if (g6Input == NULL)
@@ -234,9 +235,9 @@ int _processAndCheckHeader(strOrFileP g6Input)
234235
return NOTOK;
235236
}
236237

237-
char *correctG6Header = ">>graph6<<";
238-
char *sparse6Header = ">>sparse6<";
239-
char *digraph6Header = ">>digraph6";
238+
correctG6Header = ">>graph6<<";
239+
sparse6Header = ">>sparse6<";
240+
digraph6Header = ">>digraph6";
240241

241242
char headerCandidateChars[11];
242243
headerCandidateChars[0] = '\0';

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/io/strOrFile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ See the LICENSE.TXT file for licensing information.
2121
Returns the allocated string-or-file container, or NULL on error.
2222
********************************************************************/
2323

24-
strOrFileP sf_New(char *theStr, char *fileName, char *ioMode)
24+
strOrFileP sf_New(char const*theStr, char const*fileName, char const*ioMode)
2525
{
2626
strOrFileP theStrOrFile;
2727
int containerType = 0;

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/io/strOrFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C"
3030

3131
typedef strOrFile *strOrFileP;
3232

33-
strOrFileP sf_New(char *theStr, char *fileName, char *ioMode);
33+
strOrFileP sf_New(char const*theStr, char const*fileName, char const*ioMode);
3434
int sf_ValidateStrOrFile(strOrFileP theStrOrFile);
3535

3636
char sf_getc(strOrFileP theStrOrFile);

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/io/strbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void sb_ReadSkipInteger(strBufP theStrBuf)
180180
small concatenations).
181181
Returns OK on success, NOTOK on error
182182
********************************************************************/
183-
int sb_ConcatString(strBufP theStrBuf, char *s)
183+
int sb_ConcatString(strBufP theStrBuf, char const*s)
184184
{
185185
int slen = s == NULL ? 0 : strlen(s);
186186

extern/edge-addition-planarity-suite-Version_4.0.0.0/c/graphLib/io/strbuf.h

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,60 @@ See the LICENSE.TXT file for licensing information.
88
#define STRBUF_H
99

1010
#ifdef __cplusplus
11-
extern "C"
12-
{
11+
extern "C" {
1312
#endif
1413

1514
// includes mem functions like memcpy
1615
#include <string.h>
1716

18-
typedef struct
19-
{
20-
char *buf;
21-
int size, capacity, readPos;
22-
} strBuf;
17+
typedef struct {
18+
char * buf;
19+
int size, capacity, readPos;
20+
} strBuf;
2321

24-
typedef strBuf *strBufP;
22+
typedef strBuf * strBufP;
2523

26-
strBufP sb_New(int);
27-
void sb_Free(strBufP *);
24+
strBufP sb_New(int);
25+
void sb_Free(strBufP *);
2826

29-
void sb_ClearBuf(strBufP);
30-
int sb_Copy(strBufP, strBufP);
31-
strBufP sb_Duplicate(strBufP);
27+
void sb_ClearBuf(strBufP);
28+
int sb_Copy(strBufP, strBufP);
29+
strBufP sb_Duplicate(strBufP);
3230

3331
#define sb_GetFullString(theStrBuf) (theStrBuf->buf)
3432
#define sb_GetSize(theStrBuf) (theStrBuf->size)
3533
#define sb_GetCapacity(theStrBuf) (theStrBuf->capacity)
36-
#define sb_GetUnreadCharCount(theStrBuf) (theStrBuf->size - theStrBuf->readPos)
37-
#define sb_GetReadString(theStrBuf) ((theStrBuf != NULL && theStrBuf->buf != NULL) ? (theStrBuf->buf + theStrBuf->readPos) : NULL)
34+
#define sb_GetUnreadCharCount(theStrBuf) \
35+
(theStrBuf->size - theStrBuf->readPos)
36+
#define sb_GetReadString(theStrBuf) \
37+
((theStrBuf != NULL && theStrBuf->buf != NULL) \
38+
? (theStrBuf->buf + theStrBuf->readPos) \
39+
: NULL)
3840

3941
#define sb_GetReadPos(theStrBuf) (theStrBuf->readPos)
40-
#define sb_SetReadPos(theStrBuf, theReadPos) \
41-
{ \
42-
theStrBuf->readPos = theReadPos; \
43-
}
42+
#define sb_SetReadPos(theStrBuf, theReadPos) \
43+
{ \
44+
theStrBuf->readPos = theReadPos; \
45+
}
4446

45-
void sb_ReadSkipWhitespace(strBufP);
46-
void sb_ReadSkipInteger(strBufP);
47-
#define sb_ReadSkipChar(theStrBuf) \
48-
{ \
49-
theStrBuf->readPos++; \
50-
}
47+
void sb_ReadSkipWhitespace(strBufP);
48+
void sb_ReadSkipInteger(strBufP);
49+
#define sb_ReadSkipChar(theStrBuf) \
50+
{ \
51+
theStrBuf->readPos++; \
52+
}
5153

52-
int sb_ConcatString(strBufP, char *);
53-
int sb_ConcatChar(strBufP, char);
54+
int sb_ConcatString(strBufP, char const *);
55+
int sb_ConcatChar(strBufP, char);
5456

55-
char *sb_TakeString(strBufP);
57+
char * sb_TakeString(strBufP);
5658

5759
#ifndef SPEED_MACROS
58-
// Optimized SPEED_MACROS versions of larger methods are not used in this module
60+
// Optimized SPEED_MACROS versions of larger methods are not used in this
61+
// module
5962
#else
60-
// Optimized SPEED_MACROS versions of larger methods are not used in this module
63+
// Optimized SPEED_MACROS versions of larger methods are not used in this
64+
// module
6165
#endif
6266

6367
#ifdef __cplusplus

0 commit comments

Comments
 (0)