register CORD right;
register CORD left;
register char * new_right;
- register size_t right_len;
lenx = LEN(x);
if (leny <= SHORT_LIMIT/2
&& IS_CONCATENATION(x)
&& CORD_IS_STRING(right = ((CordRep *)x) -> concatenation.right)) {
+ size_t right_len;
+
/* Merge y into right part of x. */
if (!CORD_IS_STRING(left = ((CordRep *)x) -> concatenation.left)) {
right_len = lenx - LEN(left);
register char * result;
register size_t i;
char buf[SHORT_LIMIT+1];
- register char c;
for (i = 0; i < len; i++) {
- c = (*fn)(i, client_data);
+ char c = (*fn)(i, client_data);
+
if (c == '\0') goto gen_case;
buf[i] = c;
}
register struct Function * f = &(((CordRep *)x) -> function);
char buf[SUBSTR_LIMIT+1];
register char * p = buf;
- register char c;
register int j;
register int lim = i + n;
for (j = i; j < lim; j++) {
- c = (*(f -> fn))(j, f -> client_data);
+ char c = (*(f -> fn))(j, f -> client_data);
+
if (c == '\0') {
return(CORD_substr_closure(x, i, n, CORD_apply_access_fn));
}
if (x == 0) return(0);
if (CORD_IS_STRING(x)) {
register const char *p = x + i;
- register char c;
for(;;) {
- c = *p;
+ char c = *p;
+
if (c == '\0') ABORT("2nd arg to CORD_riter4 too big");
if ((*f1)(c, client_data)) return(1);
if (p == x) break;
void CORD_init_min_len(void)
{
register int i;
- register size_t last, previous, current;
+ size_t last, previous;
min_len[0] = previous = 1;
min_len[1] = last = 2;
for (i = 2; i < MAX_DEPTH; i++) {
- current = last + previous;
+ size_t current = last + previous;
+
if (current < last) /* overflow */ current = last;
min_len[i] = current;
previous = last;
{
CORD_pos xpos;
CORD_pos ypos;
- register size_t avail, yavail;
if (y == CORD_EMPTY) return(x != CORD_EMPTY);
if (x == CORD_EMPTY) return(-1);
CORD_set_pos(xpos, x, 0);
CORD_set_pos(ypos, y, 0);
for(;;) {
+ size_t avail, yavail;
+
if (!CORD_pos_valid(xpos)) {
if (CORD_pos_valid(ypos)) {
return(-1);
CORD_pos xpos;
CORD_pos ypos;
register size_t count;
- register long avail, yavail;
CORD_set_pos(xpos, x, x_start);
CORD_set_pos(ypos, y, y_start);
for(count = 0; count < len;) {
+ long avail, yavail;
+
if (!CORD_pos_valid(xpos)) {
if (CORD_pos_valid(ypos)) {
return(-1);
CORD CORD_from_file_eager(FILE * f)
{
- register int c;
CORD_ec ecord;
CORD_ec_init(ecord);
for(;;) {
- c = getc(f);
+ int c = getc(f);
+
if (c == 0) {
/* Append the right number of NULs */
/* Note that any string of NULs is represented in 4 words, */
{
CORD x = CORD_from_char_star("ab");
register int i;
- char c;
CORD y;
CORD_pos p;
i = 0;
CORD_set_pos(p, y, i);
while(CORD_pos_valid(p)) {
- c = CORD_pos_fetch(p);
+ char c = CORD_pos_fetch(p);
+
if(c != i) ABORT("Traversal of function node failed");
- CORD_next(p); i++;
+ CORD_next(p);
+ i++;
}
if (i != 13) ABORT("Bad apparent length for function node");
}
{
int j;
size_t cur;
- size_t next;
line_map map = current_map;
while (map -> line > i) map = map -> previous;
if (++j > current_map -> line) add_map(j, cur);
}
if (c != 0) {
- next = CORD_chr(current, cur, '\n');
+ size_t next = CORD_chr(current, cur, '\n');
+
if (next == CORD_NOT_FOUND) next = current_len - 1;
if (next < cur + *c) {
*c = next - cur;
/* terribly appropriate for tabs. */
void replace_line(int i, CORD s)
{
- register int c;
CORD_pos p;
# if !defined(MACINTOSH)
size_t len = CORD_len(s);
move(i, 0); clrtoeol(); move(i,0);
CORD_FOR (p, s) {
- c = CORD_pos_fetch(p) & 0x7f;
+ int c = CORD_pos_fetch(p) & 0x7f;
+
if (iscntrl(c)) {
standout(); addch(c + 0x40); standend();
} else {
GC_API void * GC_CALL GC_generate_random_heap_address(void)
{
size_t i;
- size_t size;
word heap_offset = RANDOM();
if (GC_heapsize > RAND_MAX) {
/* e.g. RAND_MAX = 1.5* GC_heapsize. But for typical cases, */
/* it's not too bad. */
for (i = 0;; ++i) {
+ size_t size;
+
if (i >= GC_n_heap_sects)
ABORT("GC_generate_random_heap_address: size inconsistency");
void GC_print_trace_inner(word gc_no)
{
int i;
- struct trace_entry *p;
for (i = GC_trace_buf_ptr-1; i != GC_trace_buf_ptr; i--) {
+ struct trace_entry *p;
+
if (i < 0) i = TRACE_ENTRIES-1;
p = GC_trace_buf + i;
if (p -> gc_no < gc_no || p -> kind == 0) {
void GC_printf(const char *format, ...)
{
- char buf[BUFSZ + 1];
-
if (!GC_quiet) {
+ char buf[BUFSZ + 1];
+
GC_PRINTF_FILLBUF(buf, format);
# ifdef NACL
(void)WRITE(GC_stdout, buf, strlen(buf));