Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
5ca18390
Commit
5ca18390
authored
Feb 28, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ModSim: Minor bug fix in assignment 2.7
parent
5e94d2c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
modsim/ass2/Makefile
modsim/ass2/Makefile
+1
-0
modsim/ass2/q7.c
modsim/ass2/q7.c
+2
-3
No files found.
modsim/ass2/Makefile
View file @
5ca18390
...
...
@@ -10,6 +10,7 @@ q%: q%.o
%.o
:
%.c
$(CC)
$(CFLAGS)
-o
$@
-c
$^
.PHONY
:
clean
clean
:
for
i
in
`
seq
7
`
;
do
\
rm
-vf
q
$$
i
;
\
...
...
modsim/ass2/q7.c
View file @
5ca18390
...
...
@@ -7,7 +7,7 @@
#include <assert.h>
typedef
struct
rabbit
{
in
t
age
;
unsigned
shor
t
age
;
struct
rabbit
*
prev
,
*
next
;
}
rabbit
;
...
...
@@ -38,7 +38,7 @@ void rabbit_die(rabbit **ptr) {
r
->
next
->
prev
=
r
->
prev
;
if
(
r
==
rabbits
)
rabbits
=
NULL
;
rabbits
=
r
->
next
;
*
ptr
=
NULL
;
rabbit_count
--
;
...
...
@@ -69,7 +69,6 @@ void sequence(int generations, int max_age) {
puts
(
""
);
// This does not free() all rabbits
while
(
rabbits
)
rabbit_die
(
&
rabbits
);
}
...
...
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