Esempio n. 1
0
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;
  }
}
Esempio n. 2
0
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;
	}
}
Esempio n. 3
0
int abort_(void)
#endif
{
sig_die("Fortran abort routine called", 1);
#ifdef __cplusplus
return 0;
#endif
}
Esempio n. 4
0
File: fmt.c Progetto: Sciumo/f2c
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++);
}
Esempio n. 5
0
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;
}
Esempio n. 6
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++);
}
Esempio n. 7
0
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;
}
Esempio n. 8
0
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;
}
Esempio n. 9
0
static VOID sigqdie(Sigarg)
{
Use_Sigarg;
sig_die("Quit signal", 1);
}
Esempio n. 10
0
static VOID sigidie(Sigarg)
{
Use_Sigarg;
sig_die("IOT Trap", 1);
}
Esempio n. 11
0
static VOID sigfdie(Sigarg)
{
Use_Sigarg;
sig_die("Floating Exception", 1);
}
Esempio n. 12
0
static void sigfdie(Int n)
{
sig_die("Floating Exception", 1);
}
Esempio n. 13
0
static VOID sigidie(Int n)
{
sig_die("IOT Trap", 1);
}
Esempio n. 14
0
static VOID sigtrdie(Sigarg)
{
Use_Sigarg;
sig_die("Trace trap", 1);
}
Esempio n. 15
0
static VOID sigfdie(Int n)
{
sig_die("Floating Exception", 1);
}
Esempio n. 16
0
int abort_(void)
#endif
{
sig_die("Fortran abort routine called", 1);
return 0;	/* not reached */
}
Esempio n. 17
0
static void sigtrdie(Int n)
{
sig_die("Trace trap", 1);
}
Esempio n. 18
0
static void sigtdie(Int n)
{
sig_die("Killed", 0);
}
Esempio n. 19
0
static void sigindie(Int n)
{
sig_die("Interrupt", 0);
}
Esempio n. 20
0
static void sigqdie(Int n)
{
sig_die("Quit signal", 1);
}
Esempio n. 21
0
static void sigidie(Int n)
{
sig_die("IOT Trap", 1);
}
Esempio n. 22
0
static VOID sigindie(Sigarg)
{
Use_Sigarg;
sig_die("Interrupt", 0);
}
Esempio n. 23
0
static VOID sigtdie(Sigarg)
{
Use_Sigarg;
sig_die("Killed", 0);
}
Esempio n. 24
0
static VOID sigtdie(Int n)
{
sig_die("Killed", 0);
}
Esempio n. 25
0
int
G77_abort_0 (void)
{
  sig_die ("Fortran abort routine called", 1);
  return 0;			/* not reached */
}
Esempio n. 26
0
static VOID sigindie(Int n)
{
sig_die("Interrupt", 0);
}
Esempio n. 27
0
static VOID sigqdie(Int n)
{
sig_die("Quit signal", 1);
}
Esempio n. 28
0
static VOID sigtrdie(Int n)
{
sig_die("Trace trap", 1);
}