Ben Bass avatar Ben Bass committed cdcc3ed

and fix it :-)

Comments (0)

Files changed (3)

 	which pnmtopng > /dev/null && pnmtopng out.ppm > out_image || ppm2tiff out.ppm out_image
 
 out.ppm: make_ppm mandel.dat
-	./make_ppm
+	./make_ppm mandel.dat
   
 mandel.dat: brotmap
-	time ./brotmap
+	rm -f x.dat && time ./brotmap mandel.dat 10
 
 make_ppm: make_ppm.cc brotmap.h
 	g++ make_ppm.cc -o make_ppm
   
-brotmap: brotmap.cc brotmap.h
+brotmap: brotmap.cc worker.cc evaluate.cc brotmap.h
 	g++ brotmap.cc worker.cc evaluate.cc -Werror -O3 -o brotmap -lc -lpthread
 	
 clean:
-	rm -f brotmap make_ppm out.ppm out_image
+	rm -f brotmap mandel.dat make_ppm out.ppm out_image
 
 superclean: clean
-	rm -f mandel_*.dat
+	rm -f mandel*.dat
 #define MAP_NOCACHE 0
 #endif
 
-#ifdef ftruncate64
-#define ftruncate ftruncate64
+#ifndef ftruncate64
+#define ftruncate64 ftruncate
 #endif
 
+#ifndef mmap64
+#define mmap64 mmap
+#endif
 
 long inside_points = 0;
 
 
 int BINARY_DIGITS = 10;
 
-pinfo* FPTR_START;
-FLOAT STEP_SIZE;
-
 
 int main(int argc, char* argv[])
 {
         printf("DATA_FILENAME could not be opened\n");
         return 1;
     }
-    if (ftruncate(fd, mapsize) != 0) {
+    if (ftruncate64(fd, mapsize) != 0) {
         printf("ftruncate failed\n");
         return 1;
     }
 
     // we will use mmap to write to the data file. It makes things wonderful.
     void* mapping;
-    if (NULL == (mapping = mmap(0, mapsize,
+    if (NULL == (mapping = mmap64(0, mapsize,
             PROT_READ|PROT_WRITE,
             MAP_FILE|MAP_SHARED|MAP_NOCACHE,
             fd, 0)))
 #include <stddef.h>
 #include <pthread.h>
 
-extern int MIN_X, MIN_Y, MAX_X, MAX_Y;
-extern float STEP_SIZE;
-extern pinfo* FPTR_START;
-extern unsigned long inside_points;
+extern FLOAT MIN_X, MIN_Y, MAX_X, MAX_Y;
+extern long inside_points;
+
+pinfo* FPTR_START;
+FLOAT STEP_SIZE;
 
 pthread_mutex_t acc_lock;
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.