aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2016-11-17 22:14:27 +1300
committerDavid Phillips <david@sighup.nz>2016-11-17 22:15:46 +1300
commit957f01b893809e212e16b66bd77491180e618952 (patch)
treee6b12c78589331885689a33a5a3e956899059855
parent611ab4dc0994d18922b1be9070c33966f394a8e4 (diff)
downloadfractal-gen-957f01b893809e212e16b66bd77491180e618952.tar.xz
Change main argument variables from uint to ulong
-rw-r--r--fractal-gen.c8
-rw-r--r--fractal-gen.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/fractal-gen.c b/fractal-gen.c
index 8ae45d9..34d2f8e 100644
--- a/fractal-gen.c
+++ b/fractal-gen.c
@@ -171,7 +171,7 @@ main(int argc, char **argv) {
fprintf(stderr,
"Forecast resource use:\n"
- " Threads: %d\n"
+ " Threads: %lu\n"
" RAM : ~%.4f %s\n",
threads,
ram_nice,
@@ -216,7 +216,7 @@ main(int argc, char **argv) {
switch (child = fork()) {
case 0:
while(1) {
- fprintf(stderr, "Thread %d: %.4f%%\r",
+ fprintf(stderr, "Thread %lu: %.4f%%\r",
threads-1,
100.f*(double)s->idx/s->datasize);
sleep(1);
@@ -252,7 +252,7 @@ main(int argc, char **argv) {
, time_wall, time_ch, 100*(time_ch)/time_wall);
/* Output PGM Header */
- printf("P5\n%d\n%d\n255\n",size,size/clust_total);
+ printf("P5\n%lu\n%lu\n255\n",size,size/clust_total);
/* Vomit the data segments onto stdout, interlacing frames from threads
* FIXME: look at buffering if at all possible */
@@ -337,7 +337,7 @@ parse_args(int argc, char **argv)
/* Interlacing is row-based, can't have more workers than columns */
if (threads > size) {
threads = size;
- fprintf(stderr, "WARN: Capping number of threads to image size (%d)\n", threads);
+ fprintf(stderr, "WARN: Capping number of threads to image size (%lu)\n", threads);
}
if (size % clust_total != 0) {
diff --git a/fractal-gen.h b/fractal-gen.h
index fb70e58..d3c1e34 100644
--- a/fractal-gen.h
+++ b/fractal-gen.h
@@ -49,11 +49,11 @@ typedef struct data_section_s {
pthread_t thread;
} data_section;
-unsigned int threads;
-unsigned int clust_id;
-unsigned int clust_total;
-unsigned int size;
-unsigned int iterat;
+unsigned long threads;
+unsigned long clust_id;
+unsigned long clust_total;
+unsigned long size;
+unsigned long iterat;
double power;
double thread_mult; /* number to multiply available cores by to get thread count */
char *argv0;