Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Added -o option for producing result.mb
· 769cec10
Masahiko Sakai
authored
Apr 10, 2019
769cec10
Converted codeing system to UTF-8-unix
· 892a7d06
Masahiko Sakai
authored
Apr 10, 2019
892a7d06
Show whitespace changes
Inline
Side-by-side
init/comm.cpp
View file @
892a7d06
init/dmod.cpp
View file @
892a7d06
init/init.cpp
View file @
892a7d06
...
...
@@ -503,13 +503,30 @@ long long *allocated_flag;
int
main
(
int
argc
,
char
*
argv
[])
{
long
long
i
;
if
(
argc
!=
2
){
fprintf
(
stderr
,
"Usage: init.exe ***.bin
\n
"
);
int
opt
,
outf
=
0
;
const
char
*
usage
=
"Usage: init [-oh] ***.data
\n
"
;
while
((
opt
=
getopt
(
argc
,
argv
,
"o"
))
!=
-
1
)
{
switch
(
opt
){
case
'o'
:
outf
=
1
;
break
;
case
'h'
:
default:
fputs
(
usage
,
stderr
);
return
(
1
);
}
}
if
(
(
argc
-
optind
)
!=
1
){
fputs
(
usage
,
stderr
);
exit
(
1
);
}
char
dataFile
[
256
];
strcpy
(
dataFile
,
argv
[
1
]);
strcpy
(
dataFile
,
argv
[
optind
]);
allocated_flag
=
new
long
long
[
59049
];
//allocated_flag[n]=ALLOCATED <=> code[n][0]~code[n][59049の領域は割り当てられている
memset
(
allocated_flag
,
NOT_ALLOCATED
,
59049
);
//すべてのブロックを未割り当てにセット
...
...
@@ -563,14 +580,14 @@ int main(int argc, char* argv[]) {
}
//出力
/*
if
(
outf
==
1
){
FILE
*
fp
=
fopen
(
"result.mb"
,
"wb"
);
id
=
code_size
/
59049
;
for
(
i
=
0
;
i
<
id
;
i
++
){
fwrite
(
code
[
i
],
1
,
59049
,
fp
);
}
fwrite
(
code
[
id
],
1
,
(
code_size
%
59049
),
fp
);
*/
}
long
long
j
;
for
(
i
=
0
;
i
<
id
;
i
++
){
for
(
j
=
0
;
j
<
59049
;
j
++
){
...
...
init/init.h
View file @
892a7d06
...
...
@@ -10,6 +10,7 @@
#include
<list>
#include
<vector>
#include
<time.h>
#include
<unistd.h>
using
namespace
std
;
typedef
list
<
long
long
>
Op_List
;
...
...