From 44bc1cc31136c3e1cacd4b49e4d24c689c375918 Mon Sep 17 00:00:00 2001 From: Roman-Parise Date: Tue, 16 Jul 2019 13:19:55 -0700 Subject: [PATCH 1/2] Fixed Clang compilation errors --- src/Ylib/draw.c | 30 +++++++++++++++--------------- src/Ylib/graph.c | 8 ++++---- src/Ylib/okmalloc.c | 8 ++++---- src/Ylib/quicksort.c | 4 ++-- src/Ylib/rbtree.c | 2 +- src/Ylib/yreadpar.c | 6 +++--- src/genrows/draw.c | 2 +- src/twsc/graphics.c | 2 +- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/Ylib/draw.c b/src/Ylib/draw.c index 5928facf..d32dc700 100644 --- a/src/Ylib/draw.c +++ b/src/Ylib/draw.c @@ -1240,9 +1240,9 @@ char *label ; } else { fprintf( stderr,"Color number:%d is out of range", color ) ; } - return ; + return 0 ; } else if(!(colorOnS[color])){ - return ; + return 0 ; } if(!(colorS )){ /* set all lines to black in B&W mode */ @@ -1252,7 +1252,7 @@ char *label ; /* but we can avoid an interprocess communication if we do it ourself */ if(!(fullViewS)){ if(!(Yproject_intersect( x1, x2, y1, y2, lS, rS, bS, tS ) )){ - return ; + return 0 ; } } @@ -1297,14 +1297,14 @@ char *label ; } else { fprintf( stderr,"Color number:%d is out of range", color ) ; } - return ; + return 0 ; } else if(!(colorOnS[color])){ - return ; + return 0 ; } if(!(fullViewS)){ /* clip if necessary for speed. Avoid interprocess communication */ if(!(Yproject_intersect( x1, x2, y1, y2, lS, rS, bS, tS ) )){ - return ; + return 0 ; } } @@ -1434,9 +1434,9 @@ char *label ; } else { fprintf( stderr,"Color number:%d is out of range", color ) ; } - return ; + return 0 ; } else if(!(colorOnS[color])){ - return ; + return 0 ; } points = &(ptS[1]) ; @@ -1461,7 +1461,7 @@ char *label ; if(!(fullViewS)){ /* clip if necessary for speed. Avoid interprocess communication */ if(!(Yproject_intersect( arblS, arbrS, arbbS, arbtS, lS, rS, bS, tS ) )){ - return ; + return 0 ; } } @@ -2167,14 +2167,14 @@ char *label; INT numw ; /* number written */ if(!(colorOnS[color]) || !dirNameS ){ - return ; + return 0 ; } /* check modes call draw functions if necessary */ switch( modeS ){ case TWDRAWONLY: /* this is an error should never call this */ fprintf( stderr,"ERROR[drawWPin]:problem with mode\n" ) ; - return ; + return 0 ; case TWWRITEONLY: break ; case TWWRITENDRAW: @@ -2224,14 +2224,14 @@ char *label; INT numw ; /* number of records written */ if(!(colorOnS[color]) || !dirNameS ){ - return ; + return 0 ; } /* check modes call draw functions if necessary */ switch( modeS ){ case TWDRAWONLY: /* this is an error should never call this */ fprintf( stderr,"ERROR[drawWRect]:problem with mode\n" ) ; - return ; + return 0 ; case TWWRITEONLY: break ; case TWWRITENDRAW: @@ -2275,14 +2275,14 @@ char *label ; YBUSTBOXPTR bustptr ; if(!(colorOnS[color]) || !dirNameS ){ - return ; + return 0 ; } /* check modes call draw functions if necessary */ switch( modeS ){ case TWDRAWONLY: /* this is an error should never call this */ fprintf( stderr,"ERROR[drawWArb]:problem with mode\n" ) ; - return ; + return 0 ; case TWWRITEONLY: break ; case TWWRITENDRAW: diff --git a/src/Ylib/graph.c b/src/Ylib/graph.c index bbabd362..39a95d25 100644 --- a/src/Ylib/graph.c +++ b/src/Ylib/graph.c @@ -1326,7 +1326,7 @@ VOID Ygraph_bfs(graph,sourceNode,targetNode) if ( !sourceNode ) { M( ERRMSG, "Ygraph_bfs","BFS cannot start from a null node\n" ) ; - return; + return 0; } /* create a heap */ @@ -2555,18 +2555,18 @@ VOID Ygraph_steinerImprove(graph,steinerGraph,maxIterations) if ( ! Ygraph_nodeCount(steinerGraph) ) { M(ERRMSG,routineNameS,"aborting: steiner graph has no nodes\n"); - return; + return 0; } if ( ! Ygraph_edgeCount(steinerGraph) ) { M(ERRMSG,routineNameS,"aborting: steiner graph has no edges\n"); - return; + return 0; } if ( Ygraph_nodeCount(steinerGraph) < 3 || Ygraph_edgeCount(steinerGraph) < 2 ) { Ygraph_edgeWeights2Size(steinerGraph); - return; + return 0; } pathTree = Yrbtree_init(compare_edge); diff --git a/src/Ylib/okmalloc.c b/src/Ylib/okmalloc.c index fad6926a..b56c4814 100644 --- a/src/Ylib/okmalloc.c +++ b/src/Ylib/okmalloc.c @@ -892,14 +892,14 @@ VOID Ysafe_free(ptr) VOIDPTR ptr; { free(ptr); - return; + return 0; } VOID Ysafe_cfree(ptr) VOIDPTR ptr; { free(ptr); - return; + return 0; } /* ***********DUMMY ROUTINES TO RESOLVE GLOBALS **************** */ @@ -930,7 +930,7 @@ char *offsetPtr ; /* pointer to "next" field within structure */ VOID YdebugMemory( flag ) INT flag ; { - return ; + return 0 ; } INT YcheckDebug( where ) @@ -942,7 +942,7 @@ VOIDPTR where ; VOID Yinit_memsize( memsize ) INT memsize ; { - return ; + return 0 ; } /* end Yinit_memsize */ VOID Ydump_mem() diff --git a/src/Ylib/quicksort.c b/src/Ylib/quicksort.c index 68910565..a72f2ff5 100644 --- a/src/Ylib/quicksort.c +++ b/src/Ylib/quicksort.c @@ -67,7 +67,7 @@ VOID Yquicksort(base, n, size, compare ) char *min, *max; if (n <= 1) - return; + return 0; compare_fun = compare ; qsz = size; thresh = qsz * THRESH; @@ -97,7 +97,7 @@ VOID Yquicksort(base, n, size, compare ) } } - if (n == 2) return; + if (n == 2) return 0; /* * With our sentinel in place, we now run the following hyper-fast diff --git a/src/Ylib/rbtree.c b/src/Ylib/rbtree.c index b3ca8eff..2b8d4f5f 100644 --- a/src/Ylib/rbtree.c +++ b/src/Ylib/rbtree.c @@ -598,7 +598,7 @@ VOIDPTR data ; if(!(data)){ M( ERRMSG, "Yrbtree_insert","No data given\n" ) ; - return ; + return 0 ; } /* first perform an normal insertion into the binary tree */ diff --git a/src/Ylib/yreadpar.c b/src/Ylib/yreadpar.c index 80010db3..d3fb7857 100644 --- a/src/Ylib/yreadpar.c +++ b/src/Ylib/yreadpar.c @@ -371,18 +371,18 @@ BOOL abortFlag ; } } else { M( ERRMSG, "Yreadpar_init", "Unknown parameter file\n" ) ; - return ; + return 0 ; } /* end switch on program */ /* now that we have the file name open the par file */ if(fpS){ M( ERRMSG, "Yreadpar_init", "Only one par file may be read at the same time\n" ) ; - return ; + return 0 ; } fpS = TWOPEN( filename, "r", abortFlag ) ; if(!(fpS) ){ - return ; + return 0 ; } lineS = 0 ; rule_section = FALSE ; diff --git a/src/genrows/draw.c b/src/genrows/draw.c index 425fa0d4..27e34ffb 100644 --- a/src/genrows/draw.c +++ b/src/genrows/draw.c @@ -1209,7 +1209,7 @@ process_graphics() shortRowG = FALSE ; remakerows() ; draw_the_data() ; - if (last_chanceG) (VOID)last_chance() ; + if (last_chanceG) last_chance() ; } diff --git a/src/twsc/graphics.c b/src/twsc/graphics.c index 5757b1d1..cdf1e114 100644 --- a/src/twsc/graphics.c +++ b/src/twsc/graphics.c @@ -530,7 +530,7 @@ INT cell ; y = cptr->cycenter ; if( y == GATE_ARRAY_MAGIC_CONSTANT ){ /* don't draw these */ - return ; + return 0 ; } /* name the cell */ /* draw cell labels if requested */ From 2878c6d61b2991dada67096316d6cbaf158b8865 Mon Sep 17 00:00:00 2001 From: Roman-Parise Date: Tue, 16 Jul 2019 13:22:04 -0700 Subject: [PATCH 2/2] FreeBSD comment in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 89c2cba5..cf6b4c88 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ cmake .. make sudo make install ``` +Note: For FreeBSD, use 'gmake'. Test ----