diff dstress.c @ 439:edb0923c9159

cleanup for Linux(gcc)
author thomask
date Sun, 17 Apr 2005 10:03:34 +0000
parents 27039d5cbe81
children dc186d1266ba
line wrap: on
line diff
--- a/dstress.c	Sun Apr 17 01:24:19 2005 +0000
+++ b/dstress.c	Sun Apr 17 10:03:34 2005 +0000
@@ -101,13 +101,13 @@
 	void *p;
 	if (p < 0)
 	{
-		fprintf(stderr,"Failed to allocate %ld bytes!\n", size);
+		fprintf(stderr,"Failed to allocate %zd bytes!\n", size);
 		exit(EXIT_FAILURE);
 	}
 	p = malloc(size);
 	if (p == NULL)
 	{
-		fprintf(stderr,"Failed to allocate %ld bytes!\n", size);
+		fprintf(stderr,"Failed to allocate %zd bytes!\n", size);
 		exit(EXIT_FAILURE);
 	}
 	return p;
@@ -170,13 +170,15 @@
 	for(pos=strchr(filename, '\\'); pos; pos=strchr(filename, '\\')){
 		*pos='/';
 	}
-#else if WIN32
+#else
+#if WIN32
 	for(pos=strchr(filename, '/'); pos; pos=strchr(filename, '/')){
 		*pos='\\';
 	}
 #else
-#error no cleanPathseperator adaptation available for this system
-#endif
+#error no cleanPathSeperator available for this system
+#endif /* WIN32 else */
+#endif /* USE_POSIX else */
 	return filename;
 }
 
@@ -241,10 +243,6 @@
 	char* dmd;
 	char* gdc;
 
-	char* begin;
-	char* end1;
-	char* end2;
-
 	int back=0;
 
 	/* clean arguments */
@@ -324,8 +322,7 @@
 	char* phobosLong;
 
 	char* begin;
-	char* end1;
-	char* end2;
+	char* end;
 
 	int back=0;
 
@@ -360,8 +357,8 @@
 					begin=file;
 				}
 			}
-			end1=strrchr(file,'.');
-			strncat(phobos, begin, end1-begin);
+			end=strrchr(file,'.');
+			strncat(phobos, begin, end-begin);
 			strcat(phobos, "(");
 			strcat(phobos, line);
 			strcat(phobos, ")");
@@ -387,8 +384,8 @@
 					begin=file;
 				}
 			}
-			end1=strrchr(file,'.');
-			strncat(phobos, begin, end1-begin);
+			end=strrchr(file,'.');
+			strncat(phobos, begin, end-begin);
 			strcat(phobos, "(");
 
 			phobosLong = malloc(strlen(file)+2);