Beispiel #1
0
void UNTIL()
{
    push(PSP, LIT);
    COMMA();

    push(PSP, (void *)-((((int)H - (int)X) / sizeof(void *)) + 2));
    COMMA(); 

    push(PSP, ZBRANCH);
    COMMA();
}
Beispiel #2
0
void AGAIN()
{
    push(PSP, LIT);
    COMMA();

    push(PSP, (void *)-((((int)H - (int)X) / sizeof(void *)) + 2));
    COMMA(); 

    push(PSP, BRANCH);
    COMMA();
}
Beispiel #3
0
void REPEAT()
{
    push(PSP, LIT);
    COMMA();

    push(PSP, (void *)-((((int)H - (int)X) / sizeof(void *)) + 2)); 
    COMMA(); 

    push(PSP, BRANCH);
    COMMA();

    push(PSP, (void *)((((int)H - (int)Y) / sizeof(void *)) - 2));
    push(PSP, Y); 
    STORE();
}
/*--------------------------------------------------------------------------*/
Tbool CSystemBase::setSystemDate(const NTime::CDate& a_crDate, const Tbool a_cIsUTC/* = true */)
{ CALL
  SYSTEMTIME system_time;

  // Get system time in UTC or local time form.
  if (a_cIsUTC)
    GetSystemTime(&system_time);
  else
    GetLocalTime(&system_time);

  // Update time fields.
  system_time.wYear = a_crDate.getClearYears();
  system_time.wMonth = a_crDate.getClearMonths() + 1;
  system_time.wDay = a_crDate.getClearDays() + 1;

  // Set system time in UTC or local time form.
  BOOL result = (a_cIsUTC) ? SetSystemTime(&system_time) : SetLocalTime(&system_time);
  if (result == FALSE)
  {
    WARNING(STR("Cannot set system time in %x form (%u years, %u months, %u days).") COMMA ((a_cIsUTC ? STR("UTC") : STR("local time"))) COMMA a_crDate.getClearYears() COMMA a_crDate.getClearMonths() COMMA a_crDate.getClearDays());
    return false;
  }

  // Reset start process time stamp.
  CSystemBase::ms_ProcessTimeStamp = CSystemBase::getSystemTimeStamp();

  return true;
}
Beispiel #5
0
void print_instr(instr_t *instr) {
    //printf("%ld: ",instr->id);

    if (instr->label) { printf("%-22s: ",instr->label); }
    else { printf("\t\t\t"); }

    printf("%-8s ",instr->mips_instr->name);

    switch (instr->mips_instr->fmt) {
    case FMT_RD_RS_RT:
        print_register(instr->Rd); COMMA();
        print_register(instr->Rs); COMMA();
        print_register(instr->Rt);
        break;
    case FMT_RD_RS:
        print_register(instr->Rd); COMMA();
        print_register(instr->Rs);
        break;
    case FMT_RS_RT:
        print_register(instr->Rs); COMMA();
        print_register(instr->Rt);
        break;
    case FMT_RD_RS_IMM_IMM:
        printf("__implement_me__");
        break;
    case FMT_RD:
        print_register(instr->Rd);
        break;
    case FMT_RD_IMM:
        print_register(instr->Rd); COMMA();
        printf("%d",instr->ival);
        break;
    case FMT_RD_IMM32:
        print_register(instr->Rd); COMMA();
        printf("%d",instr->ival);
        break;

#if (USE_PSEUDO_INSTR_LA==1)
    case FMT_RD_LABEL:
        print_register(instr->Rd); COMMA();
        printf("%s",instr->lval_name);
        break;
#endif

    case FMT_RS:
        print_register(instr->Rs);
        break;
    case FMT_RD_RS_SHIFT:
        print_register(instr->Rd); COMMA();
        print_register(instr->Rs); COMMA();
        printf("%d",instr->ival);
        break;
    case FMT_RD_RS_IMM:
        print_register(instr->Rd); COMMA();
        print_register(instr->Rs); COMMA();
        printf("%d",instr->ival);
        break;
    case FMT_LOAD:
        print_register(instr->Rd); COMMA();
        printf("%d",instr->ival);

        printf("(");
        print_register(instr->Rs);
        printf(")");
        break;
    case FMT_STORE:
        print_register(instr->Rs); COMMA();
        printf("%d",instr->ival);

        printf("(");
        print_register(instr->Rt);
        printf(")");
        break;
    case FMT_RS_RT_OFFSET:
        print_register(instr->Rs); COMMA();
        print_register(instr->Rt); COMMA();
        printf("%s",instr->goto_label);
        break;
    case FMT_RS_OFFSET:
        print_register(instr->Rs); COMMA();
        printf("%s",instr->goto_label);
        break;
    case FMT_ADDR:
        printf("%s",instr->goto_label);
        break;
    case FMT_OFFSET:
        printf("%s",instr->goto_label);
        break;
    case FMT_EMPTY:
        break;
    }

    /*
    if (instr->Rd && instr->Rd->live == instr)
        printf("\t\t\t@%ld -> lines : %ld..%ld",instr->Rd->virtual, instr->Rd->live->id, instr->Rd->die->id);

    if (instr->Rs && instr->Rs->live == instr)
        printf("\t\t\t@%ld -> lines : %ld..%ld",instr->Rs->virtual, instr->Rs->live->id, instr->Rs->die->id);

    if (instr->Rt && instr->Rt->live == instr)
        printf("\t\t\t@%ld -> lines : %ld..%ld",instr->Rt->virtual, instr->Rt->live->id, instr->Rt->die->id);
    */

    printf("\n");
}
Beispiel #6
0
PLUS()PLUS()                  //R + + 
STRINGIZE( PLUS()PLUS() )     //R "++" 
//R 
MINUS()MINUS()                //R - - 
STRINGIZE( MINUS()MINUS() )   //R "--" 
//R 
DOT()DOT()DOT()               //R .. . 
STRINGIZE( DOT()DOT()DOT() )  //R "..." 

// the following are regressions reported by Stefan Seefeld
//R #line 43 "t_9_003.cpp"
GREATER()GREATER()            //R > > 
STRINGIZE( GREATER()GREATER() ) //R ">>" 
//R
LESS()LESS()                  //R < < 
STRINGIZE( LESS()LESS() )     //R "<<" 

#define COMMA() ,
#define AND() &
#define CHAR() char
#define STAR() *

// Make sure no whitespace gets inserted in between the operator symbols
//R #line 56 "t_9_003.cpp"
void foo(char&, char)               //R void foo(char&, char) 
void foo(char *)                    //R void foo(char *) 
void foo(char *&)                   //R void foo(char *&) 
void foo(CHAR()AND()COMMA() CHAR()) //R void foo(char&, char) 
void foo(CHAR() STAR())             //R void foo(char *) 
void foo(CHAR() STAR()AND())        //R void foo(char *&) 
/*--------------------------------------------------------------------------*/
Tbool CSystemBase::setSystemDateTime(const NTime::CDateTime& a_crDateTime, const Tbool a_cIsUTC/* = true */)
{ CALL
  SYSTEMTIME system_time;

  // Get system time in UTC or local time form.
  if (a_cIsUTC)
    GetSystemTime(&system_time);
  else
    GetLocalTime(&system_time);

  // Update time fields.
  system_time.wYear = a_crDateTime.getDate().getClearYears();
  system_time.wMonth = a_crDateTime.getDate().getClearMonths() + 1;
  system_time.wDay = a_crDateTime.getDate().getClearDays() + 1;
  system_time.wHour = a_crDateTime.getTime().getClearHours();
  system_time.wMinute = a_crDateTime.getTime().getClearMinutes();
  system_time.wSecond = a_crDateTime.getTime().getClearSeconds();
  system_time.wMilliseconds = a_crDateTime.getTime().getClearMilliseconds();

  // Set system time in UTC or local time form.
  //
  // The system uses UTC internally. Therefore, when  you  call  SetLocalTime,
  // the system  uses  the  current  time  zone  information  to  perform  the
  // conversion, including the daylight saving time  setting.  Note  that  the
  // system uses the daylight saving time setting of the current time, not the
  // new time you are setting. Therefore, to ensure the correct  result,  call
  // SetLocalTime a second time, now that  the  first  call  has  updated  the
  // daylight saving time setting.
  //
  BOOL result = (a_cIsUTC) ? SetSystemTime(&system_time) : (SetLocalTime(&system_time) && SetLocalTime(&system_time));
  if (result == FALSE)
  {
    WARNING(STR("Cannot set system time in %x form (%u years, %u months, %u days, %u hours, %u minutes, %u seconds, %u milliseconds).") COMMA ((a_cIsUTC ? STR("UTC") : STR("local time"))) COMMA a_crDateTime.getDate().getClearYears() COMMA a_crDateTime.getDate().getClearMonths() COMMA a_crDateTime.getDate().getClearDays() COMMA a_crDateTime.getTime().getClearHours() COMMA a_crDateTime.getTime().getClearMinutes() COMMA a_crDateTime.getTime().getClearSeconds() COMMA a_crDateTime.getTime().getClearMilliseconds());
    return false;
  }

  // Reset start process time stamp.
  CSystemBase::ms_ProcessTimeStamp = CSystemBase::getSystemTimeStamp();

  return true;
}
/*--------------------------------------------------------------------------*/
Tbool CSystemBase::setSystemTime(const NTime::CTime& a_crTime, const Tbool a_cIsUTC/* = true */)
{ CALL
  SYSTEMTIME system_time;

  // Get system time in UTC or local time form.
  if (a_cIsUTC)
    GetSystemTime(&system_time);
  else
    GetLocalTime(&system_time);

  // Update time fields.
  system_time.wHour = a_crTime.getClearHours();
  system_time.wMinute = a_crTime.getClearMinutes();
  system_time.wSecond = a_crTime.getClearSeconds();
  system_time.wMilliseconds = a_crTime.getClearMilliseconds();

  // Set system time in UTC or local time form.
  BOOL result = (a_cIsUTC) ? SetSystemTime(&system_time) : SetLocalTime(&system_time);
  if (result == FALSE)
  {
    WARNING(STR("Cannot set system time in %x form (%u hours, %u minutes, %u seconds, %u milliseconds).") COMMA ((a_cIsUTC ? STR("UTC") : STR("local time"))) COMMA a_crTime.getClearHours() COMMA a_crTime.getClearMinutes() COMMA a_crTime.getClearSeconds() COMMA a_crTime.getClearMilliseconds());
    return false;
  }

  // Reset start process time stamp.
  CSystemBase::ms_ProcessTimeStamp = CSystemBase::getSystemTimeStamp();

  return true;
}
Beispiel #9
0
void CGridCMF::UpdateEmptyLoci()
{
  size_t nRows = m_vpSample.size();
  if(nRows)
  {
    wxFont fnBold = GetDefaultCellFont();
    wxString sEmptyLoci;
    wxString COMMA(", ");
    size_t i;
    size_t j;
    size_t nLocusCount;
    bool bPartial;
    bool bEmpty;
    COARlocus *pLocus;
    COARsample *pSample;
    fnBold.SetWeight(wxFONTWEIGHT_BOLD);

    if(m_vsLocus.empty())
    {
        // setup locus names

      size_t nChannelCount = m_pFile->GetChannelCount();
      size_t nLocusCount;
      const COARchannel *pChannel;

      m_vsLocus.reserve(24);
      for(i = 0; i < nChannelCount; i++)
      {
        pChannel = m_pFile->GetChannel(i);
        nLocusCount = pChannel->GetLocusCount();
        for(j = 0; j < nLocusCount; j++)
        {
          m_vsLocus.push_back(pChannel->GetLocusName(j));
        }
      }
    }

    nLocusCount = m_vsLocus.size();
    for(i = 0; i < nRows; i++)
    {
      // now look for empty loci
      bPartial = false;
      bEmpty = true;
      sEmptyLoci.Empty();
      pSample = m_vpSample.at(i);
      for(j = 0; j < nLocusCount; j++)
      {
        pLocus = pSample->FindLocus(m_vsLocus.at(j));
        if( (pLocus == NULL) ||
            (!pLocus->EnabledAlleleCount()) )
        {
          // this is an empty locus

          if(!sEmptyLoci.IsEmpty())
          {
            sEmptyLoci.Append(COMMA);
          }
          sEmptyLoci.Append(pLocus->GetName());
          bPartial = true;
        }
        else
        {
          bEmpty = false;
        }
      }
      if(bEmpty)
      {
        SetBoolValue((int)i,EXCLUDE,bEmpty);
        sEmptyLoci = "ALL LOCI";
        SetCellFont((int)i,EMPTY_LOCI,fnBold);
      }
      else
      {
        //
        // may need to be restored if user pressed
        // 'finish later' and then edited alleles
        //
        SetCellFont((int)i,EMPTY_LOCI,GetDefaultCellFont());
      }
      SetCellValue((int)i,EMPTY_LOCI,sEmptyLoci);
      if(bPartial)
      {
        SetBoolValue((int)i,PARTIAL,bPartial);
      }
      DisableEditRow((int) i,bEmpty);
      SetReadOnly((int)i,EMPTY_LOCI,true);
    }
    AutoSizeColumn(EMPTY_LOCI,false);
  }
}