I made variables explicitily const.
authorviric@llimona
Sat, 06 May 2006 15:42:06 +0200
changeset 10 9148590f009d
parent 9 622136ed6c62
child 11 dcfe4d2d4387
child 23 e5d0f7cba122
I made variables explicitily const.
algorithm.c
general.h
map.c
os.c
--- a/algorithm.c	Sat May 06 13:24:06 2006 +0200
+++ b/algorithm.c	Sat May 06 15:42:06 2006 +0200
@@ -395,7 +395,7 @@
 	return num_box_movements;
 }
 
-static void force_move_box(struct Map *m, struct BoxMove move)
+static void force_move_box(struct Map *m, const struct BoxMove move)
 {
 	struct Position newpos;
 
--- a/general.h	Sat May 06 13:24:06 2006 +0200
+++ b/general.h	Sat May 06 15:42:06 2006 +0200
@@ -72,7 +72,7 @@
 /* Prototypes for map managing
  * map.c */
 void CopyMap (struct Map *Mdest, const struct Map *Morig);
-int is_new_map(struct Map maps[], int depth);
+int is_new_map(const struct Map maps[], const int depth);
 
 /* Prototypes for unix i/o, processes
  * os.c */
--- a/map.c	Sat May 06 13:24:06 2006 +0200
+++ b/map.c	Sat May 06 15:42:06 2006 +0200
@@ -28,13 +28,11 @@
 	return TRUE;
 }
 
-int is_new_map(struct Map maps[], int depth)
+int is_new_map(const struct Map maps[], const int depth)
 {
-	struct Map *m;
+	const struct Map *m = &maps[depth];
 	int i;
-	extern int max_depth;
-
-	m = &maps[depth];
+	extern int max_depth; 
 
 	for(i=0; i<max_depth; i++)
 	{
--- a/os.c	Sat May 06 13:24:06 2006 +0200
+++ b/os.c	Sat May 06 15:42:06 2006 +0200
@@ -129,12 +129,12 @@
 
 }
 
-void PrintMove(struct BoxMove b)
+void PrintMove(const struct BoxMove b)
 {
 	printf("Box: %i, Direction: {%i,%i}\n", b.box, b.dir.x, b.dir.y);
 }
 
-static void show_percent_callback(int parameter)
+static void show_percent_callback(const int parameter)
 {
 	fprintf(stderr, "Percent: %2.12f, depth: %i-%i\n", percent_to_show,
 		min_depth_period, max_depth_period);