This patch removes cuddled elses, as required by PDD 7.
[josh-008.patch] Index: jit.c =================================================================== RCS file: /home/perlcvs/parrot/jit.c,v retrieving revision 1.12 diff -u -r1.12 jit.c --- jit.c 29 Jan 2002 14:05:31 -0000 1.12 +++ jit.c 19 Feb 2002 04:41:13 -0000 @@ -365,12 +365,14 @@ if (address > (INTVAL *)ivalue) { address = (INTVAL *)((char *)address - (char *)ivalue); - } else if (address < (INTVAL *)ivalue) { + } + else if (address < (INTVAL *)ivalue) { address = (INTVAL *) (-(arena - (char *)address + op_assembly[*pc].size)); - } else { + } + else { address = 0; } #ifdef ALPHA @@ -423,7 +425,8 @@ if (address > (INTVAL *)arena) { address = (INTVAL *)((char *)address - (char *)ivalue); - } else { + } + else { address = (INTVAL *) (-(arena - (char *)address + @@ -468,7 +471,8 @@ { ivalue = (INTVAL)(pc - code_start) + v.info[i].number - 1; memcpy(&arena[v.info[i].position],&ivalue,sizeof(ivalue)); - } else { + } + else { address = (INTVAL *)pc; #ifdef SUN4 write_32(&arena[v.info[i].position], (ptrcast_t)address); @@ -512,7 +516,8 @@ if (*low > 32767) { *high += 1; *low -= 65536; - } else if (*low < -32767) { + } + else if (*low < -32767) { *high -= 1; *low += 65536; } Index: testparrotfuncptr.c =================================================================== RCS file: /home/perlcvs/parrot/testparrotfuncptr.c,v retrieving revision 1.1 diff -u -r1.1 testparrotfuncptr.c --- testparrotfuncptr.c 30 Jan 2002 22:13:36 -0000 1.1 +++ testparrotfuncptr.c 19 Feb 2002 04:41:13 -0000 @@ -9,7 +9,8 @@ if (some_number == 42) { printf("OK\n"); return 0; - } else { + } + else { printf("FAIL\n"); return -1; } Index: trace.c =================================================================== RCS file: /home/perlcvs/parrot/trace.c,v retrieving revision 1.9 diff -u -r1.9 trace.c --- trace.c 28 Jan 2002 06:03:16 -0000 1.9 +++ trace.c 19 Feb 2002 04:41:13 -0000 @@ -64,7 +64,8 @@ fprintf(stderr, "S%ld=\"%s\"", (long) *(pc + i), (char *) interpreter->string_reg. registers[*(pc + i)]->bufstart); - } else { + } + else { fprintf(stderr, "S%ld=(null)", (long) *(pc + i)); } break; Index: io/io_stdio.c =================================================================== RCS file: /home/perlcvs/parrot/io/io_stdio.c,v retrieving revision 1.12 diff -u -r1.12 io_stdio.c --- io/io_stdio.c 18 Feb 2002 08:26:12 -0000 1.12 +++ io/io_stdio.c 19 Feb 2002 04:41:14 -0000 @@ -211,7 +211,8 @@ else { /* FIXME: I/O Error */ } - } else { + } + else { /* Read flush */ io->b.flags &= ~PIO_BF_READBUF; io->b.next = io->b.startb; @@ -236,11 +237,13 @@ return 0; if(io->b.flags & PIO_BF_WRITEBUF) { avail = io->b.size - (io->b.next - io->b.startb); - } else if(io->b.flags & PIO_BF_READBUF) { + } + else if(io->b.flags & PIO_BF_READBUF) { io->b.flags |= ~PIO_BF_READBUF; io->b.next = io->b.startb; avail = io->b.size; - } else { + } + else { avail = io->b.size; } @@ -260,11 +263,13 @@ else { /* FIXME: Write error */ } - } else if(avail > len) { + } + else if(avail > len) { memcpy(io->b.next, buffer, len); io->b.next += len; return len; - } else { + } + else { /* Fill remainder, flush, then try to buffer more */ unsigned int diff = (int)(len - avail); memcpy(io->b.next, buffer, diff); Index: io/io.c =================================================================== RCS file: /home/perlcvs/parrot/io/io.c,v retrieving revision 1.15 diff -u -r1.15 io.c --- io/io.c 6 Feb 2002 04:14:56 -0000 1.15 +++ io/io.c 19 Feb 2002 04:41:14 -0000 @@ -194,7 +194,8 @@ new_layer->name = proto->name; new_layer->flags = proto->flags; new_layer->api = proto->api; - } else { + } + else { new_layer->name = NULL; new_layer->flags = 0; new_layer->api = NULL; @@ -244,7 +245,8 @@ io->stack = layer; if( layer->api->Pushed ) (*layer->api->Pushed)(layer, io); - } else { + } + else { ParrotIOData * d = (ParrotIOData *)interpreter->piodata; if( d->default_stack == NULL && (layer->flags & PIO_L_TERMINAL) == 0 ) { @@ -411,7 +413,8 @@ if(io) { io->stack = GET_INTERP_IO(interpreter); return io; - } else { + } + else { return NULL; } } Index: io/io_unix.c =================================================================== RCS file: /home/perlcvs/parrot/io/io_unix.c,v retrieving revision 1.9 diff -u -r1.9 io_unix.c --- io/io_unix.c 18 Feb 2002 08:26:12 -0000 1.9 +++ io/io_unix.c 19 Feb 2002 04:41:15 -0000 @@ -63,15 +63,18 @@ oflags = 0; if((flags&(PIO_F_WRITE|PIO_F_READ)) == (PIO_F_WRITE|PIO_F_READ)) { oflags |= O_RDWR|O_CREAT; - } else if( flags & PIO_F_WRITE ) { + } + else if( flags & PIO_F_WRITE ) { oflags |= O_WRONLY|O_CREAT; - } else if( flags & PIO_F_READ ) { + } + else if( flags & PIO_F_READ ) { oflags |= O_RDONLY; } if( flags & PIO_F_APPEND ) { oflags |= O_APPEND; - } else if( flags & PIO_F_TRUNC ) { + } + else if( flags & PIO_F_TRUNC ) { oflags |= O_TRUNC; } return oflags; @@ -145,7 +148,8 @@ errno = 0; close(tfd); } - } else if(oflags&O_CREAT) { + } + else if(oflags&O_CREAT) { /* O_CREAT and file doesn't exist. */ while((fd = creat(spath, PIO_DEFAULTMODE)) < 0 && errno == EINTR) @@ -159,7 +163,8 @@ mode)) < 0 && errno == EINTR ) errno = 0; } - } else { + } + else { /* File doesn't exist and O_CREAT not specified */ } @@ -196,7 +201,8 @@ if((rflags = fcntl(fd, F_GETFL, 0)) >= 0) { /*int accmode = rflags & O_ACCMODE;*/ /* Check other flags (APPEND, ASYNC, etc) */ - } else { + } + else { /* Probably invalid descriptor */ return NULL; } @@ -278,7 +284,8 @@ case EINTR: continue; default: return bytes; } - } else { + } + else { /* Read returned 0, EOF if len requested > 0 */ if( len > 0 ) io->flags |= PIO_F_EOF; @@ -308,7 +315,8 @@ ptr += err; to_write -= err; bytes += err; - } else { + } + else { switch(errno) { case EINTR: goto write_through; #ifdef EAGAIN @@ -331,7 +339,8 @@ sz = PIO_unix_write(interpreter, l, io, s, len); if( sz < len ) { return -1; - } else { + } + else { return len; } } Index: io/io_win32.c =================================================================== RCS file: /home/perlcvs/parrot/io/io_win32.c,v retrieving revision 1.10 diff -u -r1.10 io_win32.c --- io/io_win32.c 6 Feb 2002 03:11:59 -0000 1.10 +++ io/io_win32.c 19 Feb 2002 04:41:15 -0000 @@ -61,10 +61,12 @@ if((flags&(PIO_F_WRITE|PIO_F_READ)) == (PIO_F_WRITE|PIO_F_READ)) { *fdwAccess = GENERIC_WRITE|GENERIC_READ; *fdwCreate = CREATE_ALWAYS; - } else if(flags & PIO_F_WRITE) { + } + else if(flags & PIO_F_WRITE) { *fdwAccess = GENERIC_WRITE; *fdwCreate = CREATE_ALWAYS; - } else if(flags & PIO_F_READ) { + } + else if(flags & PIO_F_READ) { *fdwAccess = GENERIC_READ; *fdwCreate = OPEN_EXISTING; } @@ -86,18 +88,21 @@ HANDLE h; if((h = GetStdHandle(STD_INPUT_HANDLE)) != INVALID_HANDLE_VALUE) { PIO_STDIN(interpreter) = PIO_win32_fdopen(interpreter, layer, h, PIO_F_READ); - } else { + } + else { return -1; } if((h = GetStdHandle(STD_OUTPUT_HANDLE)) != INVALID_HANDLE_VALUE){ PIO_STDOUT(interpreter) = PIO_win32_fdopen(interpreter, layer, h, PIO_F_WRITE); - } else { + } + else { return -2; } if((h = GetStdHandle(STD_ERROR_HANDLE)) != INVALID_HANDLE_VALUE) { PIO_STDERR(interpreter) = PIO_win32_fdopen(interpreter, layer, h, PIO_F_WRITE); - } else { + } + else { return -3; } return 0; @@ -192,7 +197,8 @@ else { if(GetLastError() != NO_ERROR) { /* FIXME : An error occured */ - } else if(len > 0) { + } + else if(len > 0) { /* EOF if read 0 and bytes were requested */ io->flags |= PIO_F_EOF; } Index: classes/array.pmc =================================================================== RCS file: /home/perlcvs/parrot/classes/array.pmc,v retrieving revision 1.13 diff -u -r1.13 array.pmc --- classes/array.pmc 18 Feb 2002 08:26:08 -0000 1.13 +++ classes/array.pmc 19 Feb 2002 04:41:16 -0000 @@ -286,7 +286,8 @@ INTVAL ix = kp2int(INTERP, *((dest_key->keys)[0])); PMC* dest = ((PMC**)(SELF->data))[ix]; dest->vtable->set_pmc(INTERP, dest, src); - } else { + } + else { /* $#array = $foo[$bar] */ resize_array(interpreter, SELF, src->vtable->get_integer(INTERP, src)); }