void c_div(complex *c, complex *a, complex *b) #endif { double ratio, den; double abr, abi; if ((abr = b->r) < 0.) abr = - abr; if ((abi = b->i) < 0.) abi = - abi; if (abr <= abi) { if (abi == 0) sig_die("complex division by zero", 1); ratio = (double)b->r / b->i ; den = b->i * (1 + ratio * ratio); c->r = (a->r * ratio + a->i) / den; c->i = (a->i * ratio - a->r) / den; } else { ratio = (double)b->i / b->r ; den = b->r * (1 + ratio * ratio); c->r = (a->r + a->i * ratio) / den; c->i = (a->i - a->r * ratio) / den; } }
void sig_handler (int signal) { switch (signal) { case SIGABRT: sig_die ("Abort received. Shutting down.\n"); break; case SIGFPE: debug ("Floating point exception (SIGFPE) received\n"); handle_error (signal); break; case SIGILL: debug ("Illegal Instruction exception (SIGILL) received\n"); handle_error (signal); break; case SIGQUIT: sig_cleanexit ("Quit character received. Shutting down.\n"); break; case SIGSEGV: debug ("Segmentation violation (SIGSEV) received\n"); handle_error (signal); break; case SIGBUS: debug ("Bus error (SIGBUS) received\n"); handle_error (signal); break; case SIGTERM: sig_cleanexit ("Software termination signal received. Shutting down.\n"); break; } }
int abort_(void) #endif { sig_die("Fortran abort routine called", 1); #ifdef __cplusplus return 0; #endif }
static int op_gen(int a, int b, int c, int d) { struct syl *p= &f__syl[f__pc]; if(f__pc>=SYLMX) { fprintf(stderr,"format too complicated:\n"); sig_die(f__fmtbuf, 1); } p->op=a; p->p1=b; p->p2.i[0]=c; p->p2.i[1]=d; return(f__pc++); }
integer s_rnge(char *varn, ftnint offset, char *procn, ftnint line) #endif { register int i; fprintf(stderr, "Subscript out of range on file line %ld, procedure ", line); while((i = *procn) && i != '_' && i != ' ') putc(*procn++, stderr); fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1); while((i = *varn) && i != ' ') putc(*varn++, stderr); sig_die(".", 1); return 0; }
op_gen(int a, int b, int c, int d) #endif { struct f__syl *p = &f__syl[f__pc]; if (f__pc >= SYLMX) { fprintf(stderr, "format too complicated:\n"); sig_die(f__fmtbuf, 1); } p->op = a; p->p1 = b; p->p2 = c; p->p3 = d; return(f__pc++); }
void c_div (complex * c, complex * a, complex * b) { double ratio, den; double abr, abi, cr; if ((abr = b->r) < 0.) abr = -abr; if ((abi = b->i) < 0.) abi = -abi; if (abr <= abi) { if (abi == 0) { #ifdef IEEE_COMPLEX_DIVIDE float af, bf; af = bf = abr; if (a->i != 0 || a->r != 0) af = 1.; c->i = c->r = af / bf; return; #else sig_die ("complex division by zero", 1); #endif } ratio = (double) b->r / b->i; den = b->i * (1 + ratio * ratio); cr = (a->r * ratio + a->i) / den; c->i = (a->i * ratio - a->r) / den; } else { ratio = (double) b->i / b->r; den = b->r * (1 + ratio * ratio); cr = (a->r + a->i * ratio) / den; c->i = (a->i - a->r * ratio) / den; } c->r = cr; }
int domultitask_( long *sleepTime ) { extern Boolean SIOUXQuitting; EventRecord myEvent; if( TickCount() > gNextCheck ) /* Time to check for events again? */ { if( WaitNextEvent( everyEvent, &myEvent, *sleepTime, NULL ) ) { /* Restore arrow while we're handling a real event */ SetCursor( &(qd.arrow) ); /* Need to do something with the event if we got one */ /* Add additional event handling code here if you need it */ SIOUXHandleOneEvent( &myEvent ); if( SIOUXQuitting ) sig_die("User interrupt; execution stopped", 1); /* Graceful quit */ } SpinMyCursor(); /* Spin the cursor */ gNextCheck = TickCount() + gTickSlice; /* Reset the tick count */ } return 1; }
static VOID sigqdie(Sigarg) { Use_Sigarg; sig_die("Quit signal", 1); }
static VOID sigidie(Sigarg) { Use_Sigarg; sig_die("IOT Trap", 1); }
static VOID sigfdie(Sigarg) { Use_Sigarg; sig_die("Floating Exception", 1); }
static void sigfdie(Int n) { sig_die("Floating Exception", 1); }
static VOID sigidie(Int n) { sig_die("IOT Trap", 1); }
static VOID sigtrdie(Sigarg) { Use_Sigarg; sig_die("Trace trap", 1); }
static VOID sigfdie(Int n) { sig_die("Floating Exception", 1); }
int abort_(void) #endif { sig_die("Fortran abort routine called", 1); return 0; /* not reached */ }
static void sigtrdie(Int n) { sig_die("Trace trap", 1); }
static void sigtdie(Int n) { sig_die("Killed", 0); }
static void sigindie(Int n) { sig_die("Interrupt", 0); }
static void sigqdie(Int n) { sig_die("Quit signal", 1); }
static void sigidie(Int n) { sig_die("IOT Trap", 1); }
static VOID sigindie(Sigarg) { Use_Sigarg; sig_die("Interrupt", 0); }
static VOID sigtdie(Sigarg) { Use_Sigarg; sig_die("Killed", 0); }
static VOID sigtdie(Int n) { sig_die("Killed", 0); }
int G77_abort_0 (void) { sig_die ("Fortran abort routine called", 1); return 0; /* not reached */ }
static VOID sigindie(Int n) { sig_die("Interrupt", 0); }
static VOID sigqdie(Int n) { sig_die("Quit signal", 1); }
static VOID sigtrdie(Int n) { sig_die("Trace trap", 1); }