Exemplo n.º 1
0
void StoryScreenComponent::skip_story()
{
  page_displayed_completly = true;
  while (pages.size() > 1)
    pages.pop_back();
  next_text();
}
Exemplo n.º 2
0
int main()
{
    unsigned aCnt = 0, eCnt = 0, iouCnt = 0;
    char ch = next_text();
    switch (ch) {
      case 'a': aCnt++;
                break;    // FIX: add break statement.
      case 'e': eCnt++;
                break;    // FIX: add break statement.
      default: iouCnt++;
    }
}
Exemplo n.º 3
0
/* 835 */
ELEMENT *
parse_texi_file (char *filename)
{
  char *linep, *line = 0;
  ELEMENT *root = new_element (ET_text_root);
  ELEMENT *preamble = 0;

  input_push_file (filename);

  /* Check for preamble. */
  do
    {
      ELEMENT *l;

      /* FIXME: _next_text isn't used in Perl. */
      line = next_text ();
      if (!line)
        abort (); /* Empty file? */

      linep = line; 
      linep += strspn (linep, whitespace_chars);
      if (*linep && !looking_at (linep, "\\input"))
        {
          /* This line is not part of the preamble.  Shove back
             into input stream. */
          input_push_text (line);
          break;
        }

      if (!preamble)
        preamble = new_element (ET_preamble);

      l = new_element (ET_preamble_text);
      text_append (&l->text, line);
      add_to_element_contents (preamble, l);
    }
  while (1);

  if (preamble)
    add_to_element_contents (root, preamble);

  root = parse_texi (root);
  return root;
} /* 916 */
Exemplo n.º 4
0
int main()
{
    //(a) - break was missing after the cases.
    unsigned aCnt = 0, eCnt = 0, iouCnt = 0;
    char ch = next_text();
    switch(ch) {
    case 'a':
        aCnt++;
        break;
    case 'e':
        eCnt++;
        break;
    default:
        iouCnt++;
    }

    //(b) - needs curly braces when declaring variables;
    unsigned index = some_value();
    switch(index) {
    case 1:
    {
        int ix = get_value();
        ivec[ix] = index;
        break;
    }
    default:
    {
        int ix = ivec.size()-1;
        ivec[ix] = index;
    }
    }


    //(c) - cannot comma separate cases.
    unsigned evenCnt =0, oddCnt=0;
    int digit = get_num() %10;
    switch(digit) {
    case 1:
    case 3:
    case 5:
    case 7:
    case 9:
        oddCnt++;
        break;
    case 2:
    case 4:
    case 6:
    case 8:
    case 10:
        evenCnt++;
        break;

    }


    //(d) - case labels must be constexprs. we cannot have variables as labels

    unsigned ival = 512, jval=1024, kval=4096;
    unsigned bufsize;
    unsigned swt = 512;
    switch(swt) {
    case 512:
        bufsize = ival * sizeof(int);
        break;
    case 1024:
        bufsize = jval * sizeof(int);
        break;
    case 4096:
        bufsize = kval * sizeof(int);
        break;
    }
}