Example #1
0
void sieve()
{
	primes = calloc(LEN, sizeof(unsigned));
	base = calloc(MAX/64, sizeof(unsigned));
	unsigned register i, j, k;
	    for(i=3; i<LMT; i+=2)
	        if(!chkC(base, i))
	            for(j=i*i, k=i<<1; j<MAX; j+=k)
	                setC(base, j);
	    for(i=3, j=0; i<MAX; i+=2)
	        if(!chkC(base, i))
	            primes[j++] = i;
}
Example #2
0
//----------------------------------------------------------
void morseC(char c)
{
  int indx;
  unsigned char i,cc;

  indx = chkC(c);

  if (0 <= indx) {
    for (i=0; i < 6; i++) {
      cc = pgm_read_byte_near(arC + i + indx*6); // get morse code

      if (cc == 1)
        mDot();
      else if (cc ==2)
        mDash();
    }
    mcSpace();
  }
}