Skip to content

Commit

Permalink
Reformatted all source code files:
Browse files Browse the repository at this point in the history
 1. Removed any trailing whitespace.
 2. Removed any trailing newlines.
 3. Converted to UNIX line endings.
 4. Converted all leading spaces to tabs.
  • Loading branch information
johnsonjh committed Aug 26, 2020
1 parent 53e3b0b commit 697913d
Show file tree
Hide file tree
Showing 91 changed files with 2,640 additions and 2,608 deletions.
3 changes: 2 additions & 1 deletion comparisons/ex11/wrong1.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ int main() {
free(pI);
printf("Did you notice?\n");
return 0;
}

}
3 changes: 2 additions & 1 deletion comparisons/ex12/wrong3.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ int main() {
// valgrind reports 8, but that's ok
printf("There should be 2 errors in this run\n");
return 0;
}

}
5 changes: 3 additions & 2 deletions comparisons/ex13/wrong6.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ int main() {
printf("Let's index out of bounds \n");
ar[10].a=10;
printf("Did you notice?\n");

printf("There should be 1 error in this run\n");
return 0;
}

}
3 changes: 2 additions & 1 deletion comparisons/ex14/wrong7.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ int main() {
p[10] ^= 0x0F; /* bash after */
printf("Did you notice?\n");
free(p);
}

}
3 changes: 2 additions & 1 deletion comparisons/ex15/leak1.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ int main() {
*pI = 303;

return 0;
}

}
7 changes: 4 additions & 3 deletions comparisons/ex16/leak2.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ int main() {
printf("Let's leak a pointer to an array of 10 ints\n");
int i=0;
for (i=0; i<9; i++) {
pI[i] = 303+i;
pI[i] = 303+i;
}
int j=0;
for (j=0; j<9; j++) {
if (pI[j] != 303+j) printf(" Something strange is happening...\n");
if (pI[j] != 303+j) printf(" Something strange is happening...\n");
}

return 0;
}

}
5 changes: 3 additions & 2 deletions comparisons/ex17/ok5.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ int main() {
printf("Let's correctly delete an array of 10 objects\n");
free(ar);
printf("Done\n");

printf("There should be 0 error in this run\n");
return 0;
}

}
3 changes: 2 additions & 1 deletion comparisons/ex21/wrong1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ int main() {
delete(pI);
cerr << "Did you notice?" << endl;
return 0;
}

}
3 changes: 2 additions & 1 deletion comparisons/ex22/wrong2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ int main() {

cerr << "There should be 2 errors in this run" << endl;
return 0;
}

}
3 changes: 2 additions & 1 deletion comparisons/ex23/wrong3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ int main() {
// valgrind reports 4, but that's ok
cerr << "There should be 2 errors in this run" << endl;
return 0;
}

}
3 changes: 2 additions & 1 deletion comparisons/ex24/wrong4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ int main() {

cerr << "There should be 2 errors in this run" << endl;
return 0;
}

}
9 changes: 5 additions & 4 deletions comparisons/ex25/wrong5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class Test {
public:
int a;
string stdstr;

Test() {
a=2;
stdstr = "test";
a=2;
stdstr = "test";
}

};
Expand All @@ -36,4 +36,5 @@ int main() {

cerr << "There should be 2 errors in this run" << endl;
return 0;
}

}
13 changes: 7 additions & 6 deletions comparisons/ex26/wrong6.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class Test {
public:
int a;
string stdstr;

Test() {
a=2;
stdstr = "test";
a=2;
stdstr = "test";
}

void doNothing() {
cout << " hi!" << endl;
cout << " hi!" << endl;
};

};
Expand All @@ -29,7 +29,8 @@ int main() {
cerr << "Let's index out of bounds " << endl;
ar[10].doNothing();
cerr << "Did you notice?" << endl;

cerr << "There should be 1 error in this run" << endl;
return 0;
}

}
3 changes: 2 additions & 1 deletion comparisons/ex27/leak1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ int main() {
*pI = 303;

return 0;
}

}
7 changes: 4 additions & 3 deletions comparisons/ex28/leak2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ int main() {
int* pI = new int[10];
cerr << "Let's leak a pointer to an array of 10 ints" << endl;
for (int i=0; i<9; i++) {
pI[i] = 303+i;
pI[i] = 303+i;
}
for (int i=0; i<9; i++) {
if (pI[i] != 303+i) cerr << " Something strange is happening..." << endl;
if (pI[i] != 303+i) cerr << " Something strange is happening..." << endl;
}

return 0;
}

}
9 changes: 5 additions & 4 deletions comparisons/ex29/ok5.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class Test {
public:
int a;
string stdstr;

Test() {
a=2;
stdstr = "test";
a=2;
stdstr = "test";
}

};
Expand All @@ -29,4 +29,5 @@ int main() {

cerr << "There should be 0 errors in this run" << endl;
return 0;
}

}
1 change: 1 addition & 0 deletions comparisons/memCheckers-Dateien/boringstyle.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

SPAN.definition { font-style:italic }

a { text-decoration:underline }
1 change: 0 additions & 1 deletion comparisons/memCheckers-Dateien/jpstyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ h2 { font-size:large }
/*
body { background-color:"#D0D0D0"; color:black; background-image:url("images/stone.gif") }
*/

Loading

0 comments on commit 697913d

Please sign in to comment.