changeset 1932:f57779f1d93a draft

change file size type int to long long
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Sat, 01 Feb 2014 20:01:10 +0900
parents 007131fd87e8
children d7f1710e0070
files example/regex_mas/WordCount.h example/regex_mas/main.cc
diffstat 2 files changed, 7 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/example/regex_mas/WordCount.h	Fri Jan 31 17:08:58 2014 +0900
+++ b/example/regex_mas/WordCount.h	Sat Feb 01 20:01:10 2014 +0900
@@ -6,15 +6,14 @@
     int read_division_size;
     int read_task_number;
     int read_task_num;
-    int read_left_task_num;
-    int read_filesize;
-    int read_left_size;
+    long long read_filesize;
+    long long read_left_size;
     int read_task_blocks;
     char *read_text;
     CPU_TYPE read_cpu;
 
 
-    int size;             // remaining file size
+    long long size;             // remaining file size
     int division_size;    // for each word count task
     int division_out_size;
     int out_size;
@@ -26,7 +25,7 @@
     unsigned long long *o_data;
     int out_task_num;
     char *file_mmap;
-    int file_size;
+    long long file_size;
 
     /*set input Data variables*/
     int last_task_size;
--- a/example/regex_mas/main.cc	Fri Jan 31 17:08:58 2014 +0900
+++ b/example/regex_mas/main.cc	Sat Feb 01 20:01:10 2014 +0900
@@ -54,22 +54,9 @@
     off_t size;
 } st_mmap_t;
 
-typedef struct fileread {
-   struct filesize *self;
-   long fd;
-   long division_size;
-   long task_number;
-   long task_num;
-   long filesize;
-   long left_size;
-   int task_blocks;
-   char *read_text;
-   CPU_TYPE cpu;
-} Fileread, *FilereadPtr;
-
 /*与えられたsizeをfix_byte_sizeの倍数にする(丸め込むっていうのかな?)*/
-static int
-fix_byte(int size,int fix_byte_size)
+static unsigned long long
+fix_byte(unsigned long long size,int fix_byte_size)
 {
     size = (size/fix_byte_size)*fix_byte_size  + ((size%fix_byte_size)!= 0)*fix_byte_size;
 
@@ -289,7 +276,7 @@
     w->read_task_num = w->read_filesize / READ_DIVISION_SIZE;
     w->read_task_num += ((w->read_filesize % READ_DIVISION_SIZE) != 0);
 
-    printf("filesize     : %d\n",w->read_filesize);
+    printf("filesize     : %lld\n",w->read_filesize);
     printf("one_task_size: %d\n",w->read_division_size);
     printf("task_num     : %d\n",w->read_task_num);