Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
80b8b25a
Commit
80b8b25a
authored
Mar 31, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix in the DSD manager writing and reading.
parent
f0b67951
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/map/if/ifDsd.c
+6
-4
No files found.
src/map/if/ifDsd.c
View file @
80b8b25a
...
...
@@ -835,11 +835,12 @@ void If_DsdManSave( If_DsdMan_t * p, char * pFileName )
fwrite
(
&
Num
,
4
,
1
,
pFile
);
fwrite
(
pObj
,
sizeof
(
word
)
*
Num
,
1
,
pFile
);
}
assert
(
Vec_MemEntryNum
(
p
->
vTtMem
)
==
Vec_PtrSize
(
p
->
vTtDecs
)
);
Num
=
Vec_MemEntryNum
(
p
->
vTtMem
);
fwrite
(
&
Num
,
4
,
1
,
pFile
);
Vec_MemForEachEntry
(
p
->
vTtMem
,
pTruth
,
i
)
fwrite
(
pTruth
,
sizeof
(
word
)
*
p
->
nWords
,
1
,
pFile
);
Num
=
Vec_PtrSize
(
p
->
vTtDecs
);
fwrite
(
&
Num
,
4
,
1
,
pFile
);
Vec_PtrForEachEntry
(
Vec_Int_t
*
,
p
->
vTtDecs
,
vSets
,
i
)
{
Num
=
Vec_IntSize
(
vSets
);
...
...
@@ -856,7 +857,7 @@ If_DsdMan_t * If_DsdManLoad( char * pFileName )
char
pBuffer
[
10
];
unsigned
*
pSpot
;
word
*
pTruth
;
int
i
,
Num
,
RetValue
;
int
i
,
Num
,
Num2
,
RetValue
;
FILE
*
pFile
=
fopen
(
pFileName
,
"rb"
);
if
(
pFile
==
NULL
)
{
...
...
@@ -904,7 +905,8 @@ If_DsdMan_t * If_DsdManLoad( char * pFileName )
}
ABC_FREE
(
pTruth
);
assert
(
Num
==
Vec_MemEntryNum
(
p
->
vTtMem
)
);
for
(
i
=
0
;
i
<
Vec_MemEntryNum
(
p
->
vTtMem
);
i
++
)
RetValue
=
fread
(
&
Num2
,
4
,
1
,
pFile
);
for
(
i
=
0
;
i
<
Num2
;
i
++
)
{
RetValue
=
fread
(
&
Num
,
4
,
1
,
pFile
);
vSets
=
Vec_IntAlloc
(
Num
);
...
...
@@ -912,7 +914,7 @@ If_DsdMan_t * If_DsdManLoad( char * pFileName )
vSets
->
nSize
=
Num
;
Vec_PtrPush
(
p
->
vTtDecs
,
vSets
);
}
assert
(
Vec_MemEntryNum
(
p
->
vTtMem
)
==
Vec_PtrSize
(
p
->
vTtDecs
)
);
assert
(
Num2
==
Vec_PtrSize
(
p
->
vTtDecs
)
);
fclose
(
pFile
);
return
p
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment