Corrections to second (Jan. 1997) and third (June 2001) printings of C Interfaces and Implementations: Techniques for Creating Reusable Software (Addison-Wesley Professional Computing Series, 1997, ISBN 0-201-49841-3). In the list below, line +n and line -n refer to the nth line from the top and bottom of the indicated page.
Page 168, lines -13..-8: Change to
if (length == 0) FREE(array->array); else if (array->length == 0) array->array = ALLOC(length*array->size); else RESIZE(array->array, length*array->size);
(This change should also be applied to page 168, lines -11..-8 in the first printing.)
The errors below also appear in the first printing.
Page 48, line 5: char *reason;
const char *reason;
Page 49, line -11..-10: Change "next EXCEPT, ELSE, FINALLY or END_TRY" to "corresponding END_TRY".
Page 61, line 6: =
+=
Page 68, line -12: >=
>
Page 84, line -10: Change to
#define NALLOC ((4096 + sizeof (union align) - 1)/ \ (sizeof (union align)))*(sizeof (union align))
Page 169, lines 9 and 12: Change to
memcpy(copy->array, array->array, array->length*array->size); memcpy(copy->array, array->array, copy->length*array->size);
Page 241, line -8: Incidently
Incidentally
Page 249, line 1: char *suffix
const char *suffix
Page 274, line 12: 127
128
Page 277, line -2: 127
128
Page 284, lines 5 and -7: Change to
map[(unsigned char)from->str[k]] = to->str[k]; *p++ = map[(unsigned char)s.str[i]];
Page 352, line -11: x->sign == 1
x->sign == -1
Page 358, line -2: initalized
initialized
Page 366, line 2: Add
fprint all the values on the stack from the top down
Page 367, line -6: MP_T
volatile MP_T
Page 370, line -11: char *fmt;
const char *fmt;
Page 372, line 3: --n > 0
--n >= 0
Page 416, lines 15 and 16: Change to
Sem_wait(&mutex); TRY
Page 417, lines 11 and 12: Change to
Sem_wait(&tab.mutex); TRY
Page 420, line -7: Change to
i++; while (i < j && a[i] < v) i++;
Page 493, line -11: returns preempt or zero
returns one or zero