Skip to content

Commit

Permalink
fixed errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
codeholic committed Jul 23, 2014
1 parent 1af0cd7 commit 3ed0ef2
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O3
CFLAGS = -O3 -m64
NEEDED = gen.o rmo.o file.o analyze.o components.o lifelist.o gen2x2.o

gen: genmain.o $(NEEDED)
Expand Down
4 changes: 2 additions & 2 deletions analyze.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>
#include <assert.h>

OscillatorDesc oscillation(LifeList *cells, LifeList *working, int testUpTo) {
Expand Down Expand Up @@ -136,7 +136,7 @@ void makeWorkSpace(int n) {

}

initMatchList(PartialOscillatorDesc *osc, int nmatches) {
void initMatchList(PartialOscillatorDesc *osc, int nmatches) {

int i;

Expand Down
1 change: 0 additions & 1 deletion components.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>

int initLabels(Cell *cells, int n) {

Expand Down
9 changes: 5 additions & 4 deletions gen.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* All code copyright Paul Callahan 1996 (callahan@inf.ethz.ch) */

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>
#include <assert.h>

int hexNeighborhood=0;
Expand Down Expand Up @@ -154,7 +154,7 @@ int initTransitionTable() {
int i;
FILE *rulefile;

if (rulefile=fopen("hex.rules", "r")) {
if ((rulefile=fopen("hex.rules", "r"))) {

for (i=0; i<13; i++) {
fscanf(rulefile, "%d%d", hexTable[0]+i, hexTable[1]+i);
Expand All @@ -165,7 +165,7 @@ FILE *rulefile;
initHexNeighborhoodTable();

} else {
if (rulefile=fopen("totalistic.rules", "r")) {
if ((rulefile=fopen("totalistic.rules", "r"))) {

for (i=0; i<18; i++) {
fscanf(rulefile, "%d", rules+i);
Expand All @@ -179,7 +179,7 @@ FILE *rulefile;

}

if (rulefile=fopen("exceptions.rules", "r")) {
if ((rulefile=fopen("exceptions.rules", "r"))) {

int i, value;

Expand All @@ -191,6 +191,7 @@ FILE *rulefile;
fclose(rulefile);
}

return 0;
}

void initNeighborhoodTable() {
Expand Down
6 changes: 6 additions & 0 deletions gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,9 @@ int quiescent(LifeList *cells, int stopPeriod, int matchesNeeded,
void countMoving(int *gliders, int *spaceships);

void outPostScript(LifeList *cells, float cellsize, int spacing);

int uniqCells(Cell *list, int n);
void intersectLifeLists(LifeList *cells1, LifeList *cells2, int transl);
int intersectLists(Cell *list1, int n1, Cell *list2, int n2, Cell *list3);
int restored(LifeList *pattern, LifeList *perturb, int transl, int steps);
int removeIfEquals(Cell *list, int n, int value);
1 change: 1 addition & 0 deletions gen2x2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "gen.h"

#ifdef COUNTLOOKUPS
Expand Down
1 change: 0 additions & 1 deletion lifelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <stdio.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>
#include <assert.h>


Expand Down
7 changes: 3 additions & 4 deletions ptb2.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>
#include <assert.h>

char out[90000];
Expand All @@ -10,15 +9,15 @@ Cell aligns[10000];
int naligns=0;

LifeList ptb[10000];
LifeList nb1, nb2, exp, orig;
LifeList nb1, nb2, orig;
LifeList tmp;


extern Cell *convolution, *scratch1, *scratch2, *oldAlignments;
void makeWorkSpace(int n);


main(int argc, char *argv[]) {
int main(int argc, char *argv[]) {
int i, nconv, nol;
int gens, thisgen, nptb;
int iptb;
Expand All @@ -27,7 +26,7 @@ int maxgen=50;
int mingen=0;
int maxvanish=0;

if (argc<3) return;
if (argc<3) return 1;

readCellsColor(&orig, argv[1], 1);
nptb=readPatList(ptb, argv[2]);
Expand Down
1 change: 0 additions & 1 deletion ptbsearch2.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>
#include <assert.h>

#define MAXDEPTH 10
Expand Down
1 change: 0 additions & 1 deletion rmo.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <stdio.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>
#include <assert.h>

int combineLists(Cell *list1, int n1, Cell *list2, int n2, Cell *list3) {
Expand Down
4 changes: 2 additions & 2 deletions survive.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include <stdio.h>
#include <limits.h>
#include "gen.h"
#include <malloc.h>

main(int argc, char *argv[]) {
int main(int argc, char *argv[]) {

static LifeList cells;
static LifeList matchcells;
Expand Down Expand Up @@ -95,5 +94,6 @@ main(int argc, char *argv[]) {
}

}
return 0;
}

0 comments on commit 3ed0ef2

Please sign in to comment.