diff --git a/ChangeLog b/ChangeLog index b79f715c0..5b0c9a104 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2010-09-07 Robert Larice + * src/frontend/inpcom.c , + * src/frontend/plotting/x11.c , + * src/frontend/resource.c , + * src/frontend/subckt.c , + * src/include/hash.h , + * src/main.c , + * src/misc/util.c , + * src/ngproc2mod.c , + * src/spicelib/analysis/cktterr.c , + * src/spicelib/analysis/dctran.c , + * src/spicelib/devices/ltra/ltratemp.c , + * src/spicelib/devices/ltra/ltratrun.c , + * src/winmain.c , + * src/xspice/evt/evtbackup.c , + * src/xspice/ipc/ipcaegis.c , + * src/xspice/mif/mifgetvalue.c , + * src/xspice/mif/miftrunc.c : + use for(;;) instead of while(1) to muffle some visual-C warnings + 2010-09-07 Robert Larice * examples/tclspice/tcl-testbench2/example.cir , * examples/xspice/xspice_c2.cir , diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 76b560611..df09679b1 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1100,7 +1100,7 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c #ifdef XSPICE /* First read in all lines & put them in the struct cc */ - while (1) { + for (;;) { /* If IPC is not enabled, do equivalent of what SPICE did before */ if(! g_ipc.enabled) { if ( call_depth == 0 && line_count == 0 ) { diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index cb867f0a3..500c24ac4 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -955,7 +955,7 @@ X11_Input(REQUEST *request, RESPONSE *response) ConnectionNumber(display) : fileno(request->fp); - while (1) { + for (;;) { /* first read off the queue before doing the select */ while (XtPending()) { diff --git a/src/frontend/resource.c b/src/frontend/resource.c index 34f899990..50ec85a21 100644 --- a/src/frontend/resource.c +++ b/src/frontend/resource.c @@ -639,7 +639,7 @@ baseaddr(void) orig_signal = signal(SIGSEGV, (SIGNAL_FUNCTION) fault); - do { + for (;;) { at = (char *) ((((long)low >> LOG2_PAGESIZE) + ((long)high >> LOG2_PAGESIZE)) @@ -663,7 +663,7 @@ baseaddr(void) high = at; - } while (1); + } (void) signal(SIGSEGV, (SIGNAL_FUNCTION) orig_signal); return (void *) high; diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 1e5ef413f..0864e7292 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -797,7 +797,7 @@ bxx_printf(struct bxx_buffer *t, const char *fmt, ...) { va_list ap; - while(1) { + for (;;) { int ret; int size = t->limit - t->dst; va_start(ap, fmt); @@ -967,7 +967,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, char *sub next_name = MIFgettok(&s); - while(1) { + for (;;) { /* rotate the tokens and get the the next one */ @@ -1779,7 +1779,7 @@ devmodtranslate(struct line *deck, char *subname) /* now do remainder of line. */ next_name = gettok(&t); - while(1) { + for (;;) { name = next_name; next_name = gettok(&t); @@ -2075,7 +2075,7 @@ devmodtranslate(struct line *deck, char *subname) /* now do remainder of line. */ next_name = gettok(&t); - while(1) { + for (;;) { name = next_name; next_name = gettok(&t); if((next_name == NULL) || diff --git a/src/include/hash.h b/src/include/hash.h index 95dce559b..16f0d1e62 100644 --- a/src/include/hash.h +++ b/src/include/hash.h @@ -144,7 +144,7 @@ we want to intentionally assign it. The compiler is warning unnecessarily. char *string ; \ hsum = 0 ; \ string = (char *) str ; \ - while(1) { \ + for (;;) { \ c = *string ; \ string++ ; \ if( c == 0) { \ diff --git a/src/main.c b/src/main.c index b9c06f665..7794e0a8e 100644 --- a/src/main.c +++ b/src/main.c @@ -552,7 +552,7 @@ app_rl_readlines(void) #endif /* note that we want some mechanism to detect ctrl-D and expand it to exit */ - while (1) { + for (;;) { history_set_pos(history_length); SETJMP(jbuf, 1); /* Set location to jump to after handling SIGINT (ctrl-C) */ @@ -791,7 +791,7 @@ main(int argc, char **argv) TausSeed(); /* --- Process command line options --- */ - while (1) { + for(;;) { int option_index = 0; static struct option long_options[] = { {"help", 0, 0, 'h'}, diff --git a/src/misc/util.c b/src/misc/util.c index 7a05243d8..0dbf59e95 100644 --- a/src/misc/util.c +++ b/src/misc/util.c @@ -37,7 +37,7 @@ canonicalize_pathname(char *path) /* Walk along RESULT looking for things to compact. */ i = 0; - while (1) { + for (;;) { if (!result[i]) break; diff --git a/src/ngproc2mod.c b/src/ngproc2mod.c index 4a7d1b727..76537a26e 100644 --- a/src/ngproc2mod.c +++ b/src/ngproc2mod.c @@ -95,7 +95,7 @@ main(void) { exit(1); } INPcaseFix(typeline); - while(1) { + for (;;) { while(*typeline == ' ' || *typeline == '\t' || *typeline == ',' || *typeline == '\n' ) { typeline ++; diff --git a/src/spicelib/analysis/cktterr.c b/src/spicelib/analysis/cktterr.c index 35d359948..33c43854b 100644 --- a/src/spicelib/analysis/cktterr.c +++ b/src/spicelib/analysis/cktterr.c @@ -48,7 +48,7 @@ CKTterr(int qcap, CKTcircuit *ckt, double *timeStep) deltmp[i] = ckt->CKTdeltaOld[i]; } j = ckt->CKTorder; - while(1) { + for (;;) { for(i=0;i <= j;i++) { diff[i] = (diff[i] - diff[i+1])/deltmp[i]; } diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index d883f2111..f86070056 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -598,7 +598,7 @@ resume: /* gtri - begin - wbk - Modify Breakpoint stuff */ /* Throw out any permanent breakpoint times <= current time */ - while(1) { + for (;;) { #ifdef STEPDEBUG printf(" brk_pt: %g ckt_time: %g ckt_min_break: %g\n",*(ckt->CKTbreaks), ckt->CKTtime, ckt->CKTminBreak); #endif @@ -702,7 +702,7 @@ resume: ckt->CKTstates[0] = temp; /* 600 */ - while (1) { + for (;;) { #ifdef CLUSTER redostep = 1; #endif diff --git a/src/spicelib/devices/ltra/ltratemp.c b/src/spicelib/devices/ltra/ltratemp.c index 21a2f275b..650a1ce69 100644 --- a/src/spicelib/devices/ltra/ltratemp.c +++ b/src/spicelib/devices/ltra/ltratemp.c @@ -100,7 +100,7 @@ LTRAtemp(GENmodel *inModel, CKTcircuit *ckt) y1small = LTRArlcH2Func(xsmall, model->LTRAtd, model->LTRAalpha, model->LTRAbeta); y2small = LTRArlcH3dashFunc(xsmall, model->LTRAtd, model->LTRAbeta, model->LTRAbeta); iters = 0; - while (1) { + for (;;) { iters++; y1big = LTRArlcH2Func(xbig, model->LTRAtd, model->LTRAalpha, model->LTRAbeta); diff --git a/src/spicelib/devices/ltra/ltratrun.c b/src/spicelib/devices/ltra/ltratrun.c index dc455a04d..12e6464e1 100644 --- a/src/spicelib/devices/ltra/ltratrun.c +++ b/src/spicelib/devices/ltra/ltratrun.c @@ -144,7 +144,7 @@ LTRAtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) x = ckt->CKTtime; y = current_lte; - while (1) { + for (;;) { deriv_delta = 0.01 * (x - *(ckt->CKTtimePoints + ckt->CKTtimeIndex)); diff --git a/src/winmain.c b/src/winmain.c index bab9ddc75..1745ab732 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -1023,13 +1023,13 @@ int fp_u_t_s(const char * __s, FILE * __stream) int c = SE; if (!__s) return EOF; - do { + for (;;) { if (*__s) { c = *__s++; fp_u_t_c(c, __stream); } else return c; - } while (TRUE); + } } else return fputs( __s, __stream); } diff --git a/src/xspice/evt/evtbackup.c b/src/xspice/evt/evtbackup.c index 6ddc24cc6..c32c7d8c5 100755 --- a/src/xspice/evt/evtbackup.c +++ b/src/xspice/evt/evtbackup.c @@ -163,7 +163,7 @@ static void EVTbackup_node_data( /* for tail, and splice later data into the free list */ node_ptr = node_data->last_step[node_index]; node = *node_ptr; - while(1) { + for (;;) { if((node->next == NULL) || (node->next->step > new_time)) { /* Splice rest of list, if any, into free list */ @@ -252,7 +252,7 @@ static void EVTbackup_state_data( /* for tail, and splice later data into the free list */ state_ptr = state_data->last_step[inst_index]; state = *state_ptr; - while(1) { + for (;;) { if((state->next == NULL) || (state->next->step > new_time)) { /* Splice rest of list, if any, into free list */ @@ -333,7 +333,7 @@ static void EVTbackup_msg_data( /* for tail, and splice later data into the free list */ msg_ptr = msg_data->last_step[port_index]; msg = *msg_ptr; - while(1) { + for (;;) { if((msg->next == NULL) || (msg->next->step > new_time)) { /* Splice rest of list, if any, into free list */ diff --git a/src/xspice/ipc/ipcaegis.c b/src/xspice/ipc/ipcaegis.c index da29d4bb3..607530cc5 100755 --- a/src/xspice/ipc/ipcaegis.c +++ b/src/xspice/ipc/ipcaegis.c @@ -157,7 +157,7 @@ Ipc_Status_t ipc_transport_get_line (str, len, wait) assert ((mbx_state == IPC_MBX_CONNECTED_TO_CLIENT) || (mbx_state == IPC_MBX_INITIALIZED)); - do { + for (;;) { if (wait == IPC_WAIT) { mbx_$get_rec (mbx_handle, &mbx_recieve_msg_buf, mbx_$serv_msg_max, &mbx_ret_ptr, &mbx_ret_len, &status); @@ -231,7 +231,7 @@ Ipc_Status_t ipc_transport_get_line (str, len, wait) fprintf (stderr, "ERROR: IPC: Bad message type (0x%x) recieved\n", mbx_ret_ptr->mt); } - } while (1); + } return IPC_STATUS_ERROR; } diff --git a/src/xspice/mif/mifgetvalue.c b/src/xspice/mif/mifgetvalue.c index 95480921a..e665d292e 100755 --- a/src/xspice/mif/mifgetvalue.c +++ b/src/xspice/mif/mifgetvalue.c @@ -126,7 +126,7 @@ MIFgetValue ( /* now get the values into val */ - while(1) { + for (;;) { token = MIFget_token(line, &token_type); diff --git a/src/xspice/mif/miftrunc.c b/src/xspice/mif/miftrunc.c index 0b03fcaf6..be9d212f8 100755 --- a/src/xspice/mif/miftrunc.c +++ b/src/xspice/mif/miftrunc.c @@ -193,7 +193,7 @@ static void MIFterr( deltmp[i] = ckt->CKTdeltaOld[i]; } j = ckt->CKTorder; - while(1) { + for (;;) { for(i=0;i <= j;i++) { diff[i] = (diff[i] - diff[i+1])/deltmp[i]; }