Skip to content

Commit e349bc9

Browse files
author
Joshua Goller
committedJul 23, 2018
const correct 5.7
1 parent e8b5ce1 commit e349bc9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎ch-5/src/5.7.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ will likely not be noticeably faster.
1717
#define STORAGE_BUFFER_SIZE 5000 // number of bytes for stack buffer
1818

1919
// swap(): interchange v[i] and v[j]
20-
static void swap(char *v[], int i, int j) {
20+
static void swap(char **const v, const int i, const int j) {
2121
char *temp;
2222

2323
temp = v[i];
@@ -26,7 +26,7 @@ static void swap(char *v[], int i, int j) {
2626
}
2727

2828
// qsort(): sort v[left]...v[right] into increasing order
29-
static void qsort(char *v[], int left, int right) {
29+
static void qsort(char **const v, const int left, const int right) {
3030
int i, last;
3131

3232
if (left >= right) {
@@ -45,8 +45,9 @@ static void qsort(char *v[], int left, int right) {
4545
}
4646

4747
// bufferedreadlines(): read input lines into a supplied string buffer
48-
static int bufferedreadlines(char *lineptr_buffer[], int lineptr_buffer_size,
49-
char lines[], int lines_size) {
48+
static int bufferedreadlines(char **const lineptr_buffer,
49+
const int lineptr_buffer_size, char *const lines,
50+
const int lines_size) {
5051
int len, nlines, bufferindex;
5152
char line[MAXLEN];
5253

0 commit comments

Comments
 (0)