Esempio n. 1
0
int main() {
    describe(&cat);
    describe(&dog);

    return 0;
}
Esempio n. 2
0
Descriptor* ShapeContextGenerator::describe(const InterestPoint& point, const LaserReading& reading){
    return describe(point.getPosition(), reading);
}
Esempio n. 3
0
DbException::DbException(const char *description)
:	err_(0)
,	dbenv_(0)
{
	describe(0, description);
}
Esempio n. 4
0
void printHeapReport(const HeapGraph& g, const char* phase) {
    TRACE(2, "HG: printHeapReport %s\n", phase);
    size_t allocd = 0; // non-free nodes in the heap
    size_t freed = 0; // free in the heap
    size_t live = 0; // non-free reachable nodes
    size_t undead = 0; // free but still reachable
    auto count = [&](int n, size_t& c1, size_t& c2) {
        if (g.nodes[n].h->kind() != HeaderKind::Free) c1++;
        else c2++;
    };
    for (int i = 0; i < g.nodes.size(); i++) {
        count(i, allocd, freed);
    }
    std::vector<int> parents(g.nodes.size(), -1);
    dfs_ptrs(g, g.roots, [&](int node, int ptr) {
        parents[node] = ptr;
        count(node, live, undead);
        auto h = g.nodes[node].h;
        if (h->kind() == HeaderKind::Free) {
            reportUndead(g, node);
        }
    });
    TRACE(2, "HG: allocd %lu freed %lu live %lu undead %lu leaked %lu\n",
          allocd, freed, live, undead, allocd-live);
    auto report_cycle = [&](const char* kind, NodeRange cycle) {
        TRACE(2, "HG: %s cycle of %lu nodes:\n", kind, cycle.size());
        reportPathFromRoot(g, parents, cycle[0]);
        for (size_t i = 1; i < cycle.size(); ++i) {
            TRACE(2, "  %s\n", describe(g, cycle[i]).c_str());
        }
    };
    // Cycle analysis:
    std::vector<int> live_cycle_nodes, leaked_cycle_nodes;
    size_t num_live_cycles{0}, num_leaked_cycles{0};
    findHeapCycles(g,
    /* live */ [&](NodeRange cycle) {
        report_cycle("live", cycle);
        num_live_cycles++;
        live_cycle_nodes.insert(live_cycle_nodes.end(),
                                cycle.begin(), cycle.end());
    },
    /* leaked */ [&](NodeRange cycle) {
        report_cycle("leaked", cycle);
        num_leaked_cycles++;
        leaked_cycle_nodes.insert(leaked_cycle_nodes.end(),
                                  cycle.begin(), cycle.end());
    });
    if (!live_cycle_nodes.empty()) {
        DEBUG_ONLY auto reached = count_reached(g, live_cycle_nodes);
        TRACE(2, "HG: %ld live in %lu cycles hold %lu/%lu(%.0f)%% "
              "of live objects\n",
              live_cycle_nodes.size(), num_live_cycles, reached, live,
              100.0*reached/live);
    } else {
        TRACE(2, "HG: no live cycles found\n");
    }
    if (!leaked_cycle_nodes.empty()) {
        DEBUG_ONLY auto leaked = allocd - live;
        DEBUG_ONLY auto reached = count_reached(g, leaked_cycle_nodes);
        TRACE(2, "HG: %ld leaked in %lu cycles hold %lu/%lu(%.0f)%%"
              "of leaked objects\n",
              leaked_cycle_nodes.size(), num_leaked_cycles, reached, leaked,
              100.0*reached/leaked);
    } else {
        TRACE(2, "HG: no leaked cycles found.\n");
    }
}
Esempio n. 5
0
void _move_targeting_cursor()
{
    coord_t old_target = target_cursor_position();
    const std::string move_keys = "lkjhyubn12346789vg";
    int state = statestack_top();

    char key = io::getchar();

    if (key == 'v' && state == STATE_EXAMINE)
    {
        coord_t pos = target_cursor_position();
        creature_t* creature_at_tile = get_creature_at(current_dungeon, pos.x, pos.y);
        if (creature_at_tile)
        {
            describe(creature_at_tile);
        }

        // Print tile info after so it doesn't dissapear.
        _examine_tile(pos.x, pos.y);
    }
    else if (key == 'g' && state == STATE_EXAMINE)
    {
        coord_t pos = target_cursor_position();

        if (position_in_fov(current_dungeon, pos.x, pos.y))
        {
            statestack_pop();

            _start_travel(0, true, pos.x, pos.y);
        }
        else
        {
            append_msg_log("You can't travel where you can't see!");
        }
    }
    else if (char_in(key, "<>") && state == STATE_EXAMINE)
    {
        for (int y = 0; y < current_dungeon->height; y++)
        {
            for (int x = 0; x < current_dungeon->width; x++)
            {
                const tile_t* tile = get_tile_at(current_dungeon, x, y);
                TileType tile_type = key == '<' ? TILE_STAIRS_UP : TILE_STAIRS_DOWN;

                if (tile->id == tile_type && position_in_fov(current_dungeon, x, y))
                {
                    init_target_cursor(x, y, false);
                }
            }
        }
    }
    else if (char_in(key, move_keys))
    {
        move_target_cursor(direction_from_key(key));

        if (state == STATE_EXAMINE)
        {
            coord_t target_coord = target_cursor_position();
            _examine_tile(target_coord.x, target_coord.y);
        }
        else if (state == STATE_ZAP_WAND)
        {
            coord_t target_coord = target_cursor_position();
            const spell_t* wand_spell = get_spell_for_wand(get_current_wand());

            if (wand_spell)
            {
                if (!in_range_of_spell(wand_spell, &player, target_coord.x,
                                       target_coord.y))
                {
                    init_target_cursor(old_target.x, old_target.y, true);
                }
            }
        }
        else if (state == STATE_CAST_SPELL)
        {
            coord_t target_coord = target_cursor_position();
            if (!in_range_of_spell(current_spell, &player, target_coord.x,
                                   target_coord.y))
            {
                init_target_cursor(old_target.x, old_target.y,
                                   spell_is_ray_or_missile(current_spell));
            }
        }

        return;
    }

    if (key == '\x1B')
    {
        statestack_pop();
    }
    else if (key == ' ' || key == '\n')
    {
        // What this does depends on state.
        if (state == STATE_EXAMINE)
        {
            statestack_pop();
        }
        else if (state == STATE_ZAP_WAND)
        {
            const spell_t* wand_spell = get_spell_for_wand(get_current_wand());

            coord_t target_coord = target_cursor_position();
            if (wand_spell && in_range_of_spell(wand_spell, &player, target_coord.x,
                                                target_coord.y))
            {
                if (fov_value_at(current_dungeon, target_coord.x, target_coord.y) == LIT)
                {
                    fire_wand(get_current_wand(), &player, target_coord);

                    statestack_pop();
                }
                else
                {
                    append_msg_log("You can't fire your wand where you cannot see.");
                }
            }
            else
            {
                append_msg_log("Out of range.");
            }
        }
        else if (state == STATE_CAST_SPELL)
        {
            coord_t target_coord = target_cursor_position();
            if (in_range_of_spell(current_spell, &player, target_coord.x,
                                  target_coord.y))
            {
                if (fov_value_at(current_dungeon, target_coord.x, target_coord.y) == LIT)
                {
                    cast_spell(current_spell, &player, target_coord.x, target_coord.y);
                    statestack_pop();
                }
                else
                {
                    append_msg_log("You can't cast a spell where you cannot see.");
                }
            }
            else
            {
                append_msg_log("Out of range.");
            }
        }
    }

}
Esempio n. 6
0
////////////////////////////////////////////////////////////////////////////////
// The main function
static OfxStatus
pluginMain(const char *action,  const void *handle, OfxPropertySetHandle inArgs,  OfxPropertySetHandle outArgs)
{
  try {
  // cast to appropriate type
  OfxImageEffectHandle effect = (OfxImageEffectHandle) handle;

  if(strcmp(action, kOfxActionDescribe) == 0) {
    return describe(effect);
  }
  else if(strcmp(action, kOfxImageEffectActionDescribeInContext) == 0) {
    return describeInContext(effect, inArgs);
  }
  else if(strcmp(action, kOfxActionLoad) == 0) {
    return onLoad();
  }
  else if(strcmp(action, kOfxActionUnload) == 0) {
    return onUnLoad();
  }
  else if(strcmp(action, kOfxActionCreateInstance) == 0) {
    return createInstance(effect);
  }
  else if(strcmp(action, kOfxActionDestroyInstance) == 0) {
    return destroyInstance(effect);
  }
  else if(strcmp(action, kOfxImageEffectActionIsIdentity) == 0) {
    return isIdentity(effect, inArgs, outArgs);
  }
  else if(strcmp(action, kOfxImageEffectActionRender) == 0) {
    return render(effect, inArgs, outArgs);
  }
  else if(strcmp(action, kOfxImageEffectActionGetRegionOfDefinition) == 0) {
    return getSpatialRoD(effect, inArgs, outArgs);
  }
  else if(strcmp(action, kOfxImageEffectActionGetRegionsOfInterest) == 0) {
    return getSpatialRoI(effect, inArgs, outArgs);
  }
  else if(strcmp(action, kOfxImageEffectActionGetClipPreferences) == 0) {
    return getClipPreferences(effect, inArgs, outArgs);
  }
  else if(strcmp(action, kOfxActionInstanceChanged) == 0) {
    return instanceChanged(effect, inArgs, outArgs);
  }
  else if(strcmp(action, kOfxImageEffectActionGetTimeDomain) == 0) {
    return getTemporalDomain(effect, inArgs, outArgs);
  }
  } catch (std::bad_alloc) {
    // catch memory
    //std::cout << "OFX Plugin Memory error." << std::endl;
    return kOfxStatErrMemory;
  } catch ( const std::exception& e ) {
    // standard exceptions
    //std::cout << "OFX Plugin error: " << e.what() << std::endl;
    return kOfxStatErrUnknown;
  } catch (int err) {
    // ho hum, gone wrong somehow
    return err;
  } catch ( ... ) {
    // everything else
    //std::cout << "OFX Plugin error" << std::endl;
    return kOfxStatErrUnknown;
  }

  // other actions to take the default value
  return kOfxStatReplyDefault;
}
Esempio n. 7
0
//
// Check for equality of fmi
//
int
FontMatchInfoObject::isEqual(FontMatchInfoObject *fob)
{
	// Two fmi's are equal if their string representations ARE THE SAME
	return (!strcmp(describe(), fob->describe()));
}
Esempio n. 8
0
void GwSpawn::run()
{
  describe();
  // Working directory.
  const gchar *workingdirectory = NULL;
  if (!myworkingdirectory.empty())
    workingdirectory = myworkingdirectory.c_str();
  // Store arguments in argv.
  char *argv[myarguments.size() + 2];
  // I know these casts are ugly. To do: figure out a better way.
  argv[0] = (char *)myprogram.c_str();
  for (unsigned int i = 0; i < myarguments.size(); i++) {
    argv[i + 1] = (char *)myarguments[i].c_str();
  }
  // Terminate argv.
  argv[myarguments.size() + 1] = NULL;
  // Spawn flags.
  int flags = G_SPAWN_SEARCH_PATH;
  if (mydevnull) {
    flags |= (G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL);
  }
  // Possible pipes.
  gint standard_input_filedescriptor = 0;
  gint standard_output_filedescriptor;
  gint standard_error_filedescriptor;
  gint *standard_input_filedescriptor_pointer = NULL;
  gint *standard_output_filedescriptor_pointer = NULL;
  gint *standard_error_filedescriptor_pointer = NULL;
  gchar *standard_output = NULL;
  gchar *standard_error = NULL;
  gchar **standard_output_pointer = NULL;
  gchar **standard_error_pointer = NULL;
  if (myread) {
    standard_output_filedescriptor_pointer = &standard_output_filedescriptor;
    standard_error_filedescriptor_pointer = &standard_error_filedescriptor;
    standard_output_pointer = &standard_output;
    standard_error_pointer = &standard_error;
  }
  if (!mywrite.empty()) {
    standard_input_filedescriptor_pointer = &standard_input_filedescriptor;
  }
  // Spawn process.
  if (myasync) {
    result = g_spawn_async_with_pipes(workingdirectory, argv, NULL, (GSpawnFlags) flags, NULL, NULL, &pid, standard_input_filedescriptor_pointer, standard_output_filedescriptor_pointer, standard_error_filedescriptor_pointer, NULL);
    // Handle writing to stdin.
    if (standard_input_filedescriptor) {
      tiny_spawn_write(standard_input_filedescriptor, mywrite);
      close(standard_input_filedescriptor);
    }
  } else {
    result = g_spawn_sync(workingdirectory, argv, NULL, (GSpawnFlags) flags, NULL, NULL, standard_output_pointer, standard_error_pointer, &exitstatus, NULL);
  }
  // Handle case we didn't spawn the process.
  if (!result) {
    exitstatus = -1;
    ustring message = myprogram;
    message.append(_(" didn't spawn"));
    gw_critical(message);
    return;
  }
  // Handle progress function.
  if (myprogress || standard_input_filedescriptor) {
    ProgressWindow *progresswindow = NULL;
    if (myprogress)
      progresswindow = new ProgressWindow(mytext, myallowcancel);
    ustring filename = gw_build_filename("/proc", convert_to_string(pid));
    while (g_file_test(filename.c_str(), G_FILE_TEST_EXISTS)) {
      if (progresswindow) {
        progresswindow->pulse();
        if (progresswindow->cancel) {
          unix_kill(pid);
          cancelled = true;
        }
      }
      g_usleep(500000);
    }
    // Close pid.
    g_spawn_close_pid(pid);
    if (progresswindow) { delete progresswindow; }
  }
  // Handle reading the output.
  if (myread) {
    // In async mode we've got file descriptors, and in sync mode we have 
    // gchar * output.
    // If async mode, read the output and close the descriptors.
    if (myasync) {
      GIOChannel *channel_out = g_io_channel_unix_new(standard_output_filedescriptor);
      g_io_channel_read_to_end(channel_out, &standard_output, NULL, NULL);
      g_io_channel_shutdown(channel_out, false, NULL);
      GIOChannel *channel_err = g_io_channel_unix_new(standard_error_filedescriptor);
      g_io_channel_read_to_end(channel_err, &standard_error, NULL, NULL);
      g_io_channel_shutdown(channel_err, false, NULL);
    }
    ParseLine parse_out(standard_output);
    standardout = parse_out.lines;
    ParseLine parse_err(standard_error);
    standarderr = parse_err.lines;
    // Free data.
    if (standard_output)
      g_free(standard_output);
    if (standard_error)
      g_free(standard_error);
  }
}
Esempio n. 9
0
 void printErrorType(EventRecord<EventType::RuntimeError> const &Event) {
   Out.printMember("ErrorType",
                   describe(static_cast<seec::runtime_errors::RunErrorType>
                                       (Event.getErrorType())));
 }
Esempio n. 10
0
 void printArgumentType(
         EventRecord<EventType::RuntimeErrorArgument> const &Event) {
   Out.printMember("ArgumentType",
                   describe(static_cast<seec::runtime_errors::ArgType>
                                       (Event.getArgumentType())));
 }
Esempio n. 11
0
void wrapped_describe(ea_t effective_address, const char *string) 
{
	describe(effective_address, 1, "%s", string);
}
Esempio n. 12
0
DbException::DbException(const char *description, int err)
:	err_(err)
,	env_(0)
{
	describe(0, description);
}
Esempio n. 13
0
File: parser.c Progetto: Saruta/a2c
void eat(enum tokentype expect)
{
  next();
  if (tok->type != expect)
    syntaxerror("expected %s, not %s", describe(expect), tok->val);
}
void  XAP_Win32EncodingManager::initialize()
{
	char szLocaleInfo[64];
	static char szCodepage[64];
	static char szSystemCodepage[64];
	static char szLanguage[64];
	static char szTerritory[64];

	NativeNonUnicodeEncodingName = Native8BitEncodingName = NativeSystemEncodingName = NativeEncodingName = "CP1252";
	LanguageISOName = "en";
	LanguageISOTerritory = NULL;

	XAP_EncodingManager::initialize();

	// Unicode Encoding Name
	// TODO Does NT use UCS-2BE internally on non-Intel CPUs?
	// TODO Windows 2000 and XP use UTF-16 but on 2000 it may involve a
	// TODO  registry setting
	NativeUnicodeEncodingName = getUCS2LEName();

	// Encodings
	// User Encoding (Set via Region/Locale; does not require reboot)
	if (GetLocaleInfoA(LOCALE_USER_DEFAULT,LOCALE_IDEFAULTANSICODEPAGE,szLocaleInfo,sizeof(szLocaleInfo)/sizeof(szLocaleInfo[0])))
	{
		// Windows Unicode locale?
		if (!strcmp(szLocaleInfo,"0"))
		{
			NativeEncodingName = NativeUnicodeEncodingName;
			m_bIsUnicodeLocale = true;
		}
		else
		{
			szCodepage[0] = 'C';
			szCodepage[1] = 'P';
			strcpy(szCodepage+2,szLocaleInfo);
			NativeNonUnicodeEncodingName = Native8BitEncodingName = NativeEncodingName = szCodepage;
			m_bIsUnicodeLocale = false;
		}
	}
	// System Encoding (Used by GUI,DOS; Set via Region/Default Language; requires reboot)
	if (GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT,LOCALE_IDEFAULTANSICODEPAGE,szLocaleInfo,sizeof(szLocaleInfo)/sizeof(szLocaleInfo[0])))
	{
		// Windows Unicode locale?
		if (!strcmp(szLocaleInfo,"0"))
		{
			NativeSystemEncodingName = NativeUnicodeEncodingName;
			//m_bIsUnicodeLocale = true;
		}
		else
		{
			szSystemCodepage[0] = 'C';
			szSystemCodepage[1] = 'P';
			strcpy(szSystemCodepage+2,szLocaleInfo);
			NativeSystemEncodingName = szSystemCodepage;
			//m_bIsUnicodeLocale = false;
		}
	}

    m_bIsUnicodeLocale = true;
	NativeEncodingName = "UCS-2LE";	
	NativeSystemEncodingName = "UCS-2LE";

	if (UT_getISO639Language(szLanguage))
	{
		LanguageISOName = szLanguage;
	}
	else
	{
		UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN);
	}
	if (UT_getISO3166Country(szTerritory))
	{
		LanguageISOTerritory = szTerritory;
	}

	describe();
}
Esempio n. 15
0
FontMatchInfoObject::
~FontMatchInfoObject()
{
	WF_TRACEMSG( ("NF: Destroying fmi (%s).", describe()) );
	releaseStringRepresentation();
}
static void bad_things_below_sp (void)
{
   int i;
   char *p = (char*)&i;
   describe ("1500 bytes below a local var", p-1500);
}
Esempio n. 17
0
void testParagraph(void)
{
  voice_index0 voice;
  voice_index0 leader = 0, nv = 0;
  paragraph_index0 mus;
  short extra, l, nbar;
  voice_index0 FORLIM;
  Char STR2[256];
  Char STR4[256];

  nbars = 0;
  pickup = 0;
  nleft = 0;
  if (top > bottom)
    return;
  pickup = 0;
  *multi_bar_rest = '\0';
  FORLIM = bottom;
  for (voice = top; voice <= FORLIM; voice++) {
    mus = musicLineNo(voice);
    if (mus > 0) {   /** -------------- Voice is present  ---- */
      nv++;
      line_no = orig_line_no[mus-1];
      scanMusic(voice, &l);
      if (*multi_bar_rest != '\0' && nv > 1)
	error("Multi-bar rest allows only one voice", print);
      if (!pmx_preamble_done) {
	if (voice == top)
	  pickup = l;
	else if (pickup != l)
	  error3(voice, "The same pickup must appear in all voices");
      }
      nbar = numberOfBars(voice);
      extra = ExtraLength(voice);
      if (*multi_bar_rest != '\0' && (nbar > 0 || extra > 0))
	error3(voice, "Multi-bar rest allows no other rests or notes");
      if (nbar > nbars || nbar == nbars && extra > nleft) {
	nbars = nbar;
	nleft = extra;
	leader = voice;
      }
      if (!final_paragraph && meternum > 0 && extra > 0) {
	printf("Line has %s\n", describe(STR2, nbar, extra));
	error("   Line does not end at complete bar", print);
      }
      if (pmx_preamble_done && l > 0 && meternum > 0) {
	printf("l=%d meternum=%d\n", l, meternum);
	error3(voice, "Short bar with no meter change");
      }
    }
  }
  if (!pmx_preamble_done) {
    xmtrnum0 = (double)pickup / one_beat;   /* Don't want an integer result */
    if (beVerbose())
      printf("Pickup = %d/64\n", pickup);
  }
  if (leader <= 0)
    return;
  FORLIM = bottom;
  for (voice = top; voice <= FORLIM; voice++) {
    if (musicLineNo(voice) > 0) {
      if (voice != leader) {
	mus = musicLineNo(voice);
	line_no = orig_line_no[mus-1];
	if (numberOfBars(voice) != numberOfBars(leader) ||
	    ExtraLength(voice) != ExtraLength(leader)) {
	  printf("Following line has %s\n",
		 describe(STR4, numberOfBars(voice), ExtraLength(voice)));
	  puts(musicLine(STR4, voice));
	  printf("Longest line has %s\n",
		 describe(STR2, numberOfBars(leader), ExtraLength(leader)));
	  puts(musicLine(STR2, leader));
	  error("Line duration anomaly", print);
	}
      }
    }
  }
}
Esempio n. 18
0
void GwSpawn::run()
/*
On Windows the normal routines of glib cannot be used well, because they show
a console window when running certain commands like mkdir, ping, etc.
Therefore this version of run() uses Windows specific system calls.
These calls allow one to hide the console window.
*/
{
  describe();
  // Working directory.
  const gchar *workingdirectory = NULL;
  if (!myworkingdirectory.empty())
    workingdirectory = myworkingdirectory.c_str();
  /*
     The trick to running a console window silent is in the STARTUPINFO 
     structure that we pass into the CreateProcess function. 
     STARTUPINFO specifies the main window properties. 
     There are many items in the STARTUPINFO structure that we don't care about. 
     The ones that are of interest are:
     * DWORD cb
     * DWORD dwFlags
     * WORD wShowWindow
   */
  // The STARTUPINFO is instantiated.
  STARTUPINFO StartupInfo;
  PROCESS_INFORMATION ProcessInfo;
  // The memory is cleared for the length of the structure.
  memset(&StartupInfo, 0, sizeof(StartupInfo));
  // Fill the structure with the relevant code 
  // that will tell the console window to start up without showing itself.
  StartupInfo.cb = sizeof(STARTUPINFO);
  StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
  StartupInfo.wShowWindow = SW_HIDE;

  // Arguments to the program.
  char Args[4096];
  Args[0] = 0;

  // Environment.
  char *pEnvCMD = NULL;
  char const *pDefaultCMD = "CMD.EXE";
  // gwrappers.cpp: In member function 'void GwSpawn::run()':
  // gwrappers.cpp:420:23: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  pEnvCMD = getenv("COMSPEC");

  if (pEnvCMD) {
    strcpy(Args, pEnvCMD);
  } else {
    strcpy(Args, pDefaultCMD);
  }

  // The "/c" option - Do the command then terminate the command window.
  strcat(Args, " /c ");
  // The application you would like to run from the command window.
  strcat(Args, myprogram.c_str());
  // The parameters passed to the application being run from the command window.
  // The arguments have been quoted and spaced already.
  for (unsigned int i = 0; i < myarguments.size(); i++) {
    strcat(Args, myarguments[i].c_str());
  }

  // Get the suffix for the files to be piped. It has the seconds and 
  // microseconds in them, to allow for parallel usage of these pipes.
  ustring pipe_suffix;
  if ((!mydevnull) || (!mywrite.empty())) {
    GTimeVal gtimeval;
    g_get_current_time(&gtimeval);
    pipe_suffix = convert_to_string((long unsigned int)gtimeval.tv_sec) + convert_to_string((long unsigned int)gtimeval.tv_usec);
  }
  // If there is standard input, create the file to be piped.
  // Write the text into that file. Add the file to the arguments.
  if (!mywrite.empty()) {
    ustring pipe_in = gw_build_filename(Directories->get_temp(), "stdin" + pipe_suffix);
    WriteText wt(pipe_in);
    wt.text(mywrite);
    strcat(Args, " <");
    strcat(Args, shell_quote_space(pipe_in).c_str());
  }
  // If the output is not sent to "nul", then create piped files.
  ustring pipe_out;
  ustring pipe_err;
  if (!mydevnull) {
    pipe_out = gw_build_filename(Directories->get_temp(), "stdout" + pipe_suffix);
    pipe_err = gw_build_filename(Directories->get_temp(), "stderr" + pipe_suffix);
    ustring pout = shell_quote_space(pipe_out);
    ustring perr = shell_quote_space(pipe_err);
    strcat(Args, " >");
    strcat(Args, pout.c_str());
    strcat(Args, " 2>");
    strcat(Args, perr.c_str());
  }
  // Start the process.
  result = CreateProcess(NULL, Args, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, workingdirectory, &StartupInfo, &ProcessInfo);
  if (!result) {
    exitstatus = GetLastError();
    ustring message = myprogram;
    message.append(_(" didn't spawn"));
    gw_critical(message);
    return;
  }
  // Handle progress function.
  if (myprogress) {
    ProgressWindow progresswindow(mytext, myallowcancel);
    // Time passed to WaitForSingleObject is in milliseconds.
    while ((WaitForSingleObject(ProcessInfo.hProcess, 500) >= 500)
           || (WaitForSingleObject(ProcessInfo.hThread, 500) >= 500)) {
      progresswindow.pulse();
      if (progresswindow.cancel) {
// todo        unix_kill (pid);
        cancelled = true;
      }
    }
  }
  // Handle sync mode.
  if (!myasync) {
    // Wait for it to finish.
    WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
    WaitForSingleObject(ProcessInfo.hThread, INFINITE);
  }
  // Get the exit code.
  ULONG rc;
  if (!GetExitCodeProcess(ProcessInfo.hProcess, &rc))
    rc = 0;
  exitstatus = rc;

  // Close handles.
  CloseHandle(ProcessInfo.hThread);
  CloseHandle(ProcessInfo.hProcess);

  // Read the pipe files if we don't sent the output to "nul".
  if (!mydevnull) {
    gchar *standard_output;
    g_file_get_contents(pipe_out.c_str(), &standard_output, NULL, NULL);
    gchar *standard_error;
    g_file_get_contents(pipe_err.c_str(), &standard_error, NULL, NULL);
    // Handle case we read the output. Else dump it to stdout/err.
    if (myread) {
      if (standard_output) {
        ParseLine parse_out(standard_output);
        standardout = parse_out.lines;
      }
      if (standard_error) {
        ParseLine parse_err(standard_error);
        standarderr = parse_err.lines;
      }
    } else {
      if (standard_output)
        tiny_spawn_write(1, standard_output);
      if (standard_error)
        tiny_spawn_write(2, standard_error);
    }
    // Free data.
    if (standard_output)
      g_free(standard_output);
    if (standard_error)
      g_free(standard_error);
  }
}
    describe("before_each/after_each", [&](){
      std::unique_ptr<bandit::detail::contextstack_t> context_stack;
      std::unique_ptr<bf::fake_context> context;
    
      before_each([&](){
        context = std::unique_ptr<bf::fake_context>(new bf::fake_context());
        context_stack = std::unique_ptr<bandit::detail::contextstack_t>(new bandit::detail::contextstack_t());
        context_stack->push_back(context.get());
      });
      
      describe("before_each", [&](){
        bandit::detail::voidfunc_t before_each_fn;

        before_each([&](){
          before_each_fn = [](){};
          });

        it("registers itself for the current context in the stack", [&](){
          before_each(before_each_fn, *context_stack); 
          Assert::That(context->call_log(), Has().Exactly(1).EqualTo("register_before_each"));
          });

      }); 

      describe("after_each", [&](){
          bandit::detail::voidfunc_t after_each_fn;
        
        before_each([&](){
          after_each_fn = [](){};
        });
      
        it("registers itself for the current context in the stack", [&](){
          after_each(after_each_fn, *context_stack); 
          Assert::That(context->call_log(), Has().Exactly(1).EqualTo("register_after_each"));
        });
      
      });
    });
Esempio n. 20
0
int cmd_describe(int argc, const char **argv, const char *prefix)
{
	int contains = 0;
	struct option options[] = {
		OPT_BOOL(0, "contains",   &contains, N_("find the tag that comes after the commit")),
		OPT_BOOL(0, "debug",      &debug, N_("debug search strategy on stderr")),
		OPT_BOOL(0, "all",        &all, N_("use any ref")),
		OPT_BOOL(0, "tags",       &tags, N_("use any tag, even unannotated")),
		OPT_BOOL(0, "long",       &longformat, N_("always use long format")),
		OPT_BOOL(0, "first-parent", &first_parent, N_("only follow first parent")),
		OPT__ABBREV(&abbrev),
		OPT_SET_INT(0, "exact-match", &max_candidates,
			    N_("only output exact matches"), 0),
		OPT_INTEGER(0, "candidates", &max_candidates,
			    N_("consider <n> most recent tags (default: 10)")),
		OPT_STRING(0, "match",       &pattern, N_("pattern"),
			   N_("only consider tags matching <pattern>")),
		OPT_BOOL(0, "always",        &always,
			N_("show abbreviated commit object as fallback")),
		{OPTION_STRING, 0, "dirty",  &dirty, N_("mark"),
			N_("append <mark> on dirty working tree (default: \"-dirty\")"),
			PARSE_OPT_OPTARG, NULL, (intptr_t) "-dirty"},
		OPT_END(),
	};

	git_config(git_default_config, NULL);
	argc = parse_options(argc, argv, prefix, options, describe_usage, 0);
	if (abbrev < 0)
		abbrev = DEFAULT_ABBREV;

	if (max_candidates < 0)
		max_candidates = 0;
	else if (max_candidates > MAX_TAGS)
		max_candidates = MAX_TAGS;

	save_commit_buffer = 0;

	if (longformat && abbrev == 0)
		die(_("--long is incompatible with --abbrev=0"));

	if (contains) {
		struct argv_array args;

		argv_array_init(&args);
		argv_array_pushl(&args, "name-rev",
				 "--peel-tag", "--name-only", "--no-undefined",
				 NULL);
		if (always)
			argv_array_push(&args, "--always");
		if (!all) {
			argv_array_push(&args, "--tags");
			if (pattern)
				argv_array_pushf(&args, "--refs=refs/tags/%s", pattern);
		}
		if (argc)
			argv_array_pushv(&args, argv);
		else
			argv_array_push(&args, "HEAD");
		return cmd_name_rev(args.argc, args.argv, prefix);
	}

	hashmap_init(&names, (hashmap_cmp_fn) commit_name_cmp, 0);
	for_each_rawref(get_name, NULL);
	if (!names.size && !always)
		die(_("No names found, cannot describe anything."));

	if (argc == 0) {
		if (dirty) {
			static struct lock_file index_lock;
			int fd;

			read_cache_preload(NULL);
			refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED,
				      NULL, NULL, NULL);
			fd = hold_locked_index(&index_lock, 0);
			if (0 <= fd)
				update_index_if_able(&the_index, &index_lock);

			if (!cmd_diff_index(ARRAY_SIZE(diff_index_args) - 1,
					    diff_index_args, prefix))
				dirty = NULL;
		}
		describe("HEAD", 1);
	} else if (dirty) {
		die(_("--dirty is incompatible with commit-ishes"));
	} else {
		while (argc-- > 0)
			describe(*argv++, argc == 0);
	}
	return 0;
}
static void
cairo_perf_trace (cairo_perf_t			   *perf,
		  const cairo_boilerplate_target_t *target,
		  const char			   *trace)
{
    static cairo_bool_t first_run = TRUE;
    unsigned int i;
    cairo_time_t *times, *paint, *mask, *fill, *stroke, *glyphs;
    cairo_stats_t stats = {0.0, 0.0};
    struct trace args = { target };
    int low_std_dev_count;
    char *trace_cpy, *name;
    const cairo_script_interpreter_hooks_t hooks = {
	&args,
	perf->tile_size ? _tiling_surface_create : _similar_surface_create,
	NULL, /* surface_destroy */
	_context_create,
	NULL, /* context_destroy */
	NULL, /* show_page */
	NULL, /* copy_page */
	_source_image_create,
    };

    args.tile_size = perf->tile_size;
    args.observe = perf->observe;

    trace_cpy = xstrdup (trace);
    name = basename_no_ext (trace_cpy);

    if (perf->list_only) {
	printf ("%s\n", name);
	free (trace_cpy);
	return;
    }

    if (first_run) {
	if (perf->raw) {
	    printf ("[ # ] %s.%-s %s %s %s ...\n",
		    "backend", "content", "test-size", "ticks-per-ms", "time(ticks)");
	}

	if (perf->summary) {
	    if (perf->observe) {
		fprintf (perf->summary,
			 "[ # ] %8s %28s  %9s %9s %9s %9s %9s %9s %5s\n",
			 "backend", "test",
			 "total(s)", "paint(s)", "mask(s)", "fill(s)", "stroke(s)", "glyphs(s)",
			 "count");
	    } else {
		fprintf (perf->summary,
			 "[ # ] %8s %28s %8s %5s %5s %s\n",
			 "backend", "test", "min(s)", "median(s)",
			 "stddev.", "count");
	    }
	}
	first_run = FALSE;
    }

    times = perf->times;
    paint = times + perf->iterations;
    mask = paint + perf->iterations;
    stroke = mask + perf->iterations;
    fill = stroke + perf->iterations;
    glyphs = fill + perf->iterations;

    low_std_dev_count = 0;
    for (i = 0; i < perf->iterations && ! user_interrupt; i++) {
	cairo_script_interpreter_t *csi;
	cairo_status_t status;
	unsigned int line_no;

	args.surface = target->create_surface (NULL,
					       CAIRO_CONTENT_COLOR_ALPHA,
					       1, 1,
					       1, 1,
					       CAIRO_BOILERPLATE_MODE_PERF,
					       &args.closure);
	fill_surface(args.surface); /* remove any clear flags */

	if (perf->observe) {
	    cairo_surface_t *obs;
	    obs = cairo_surface_create_observer (args.surface,
						 CAIRO_SURFACE_OBSERVER_NORMAL);
	    cairo_surface_destroy (args.surface);
	    args.surface = obs;
	}
	if (cairo_surface_status (args.surface)) {
	    fprintf (stderr,
		     "Error: Failed to create target surface: %s\n",
		     target->name);
	    return;
	}

	cairo_perf_timer_set_synchronize (target->synchronize, args.closure);

	if (i == 0) {
	    describe (perf, args.closure);
	    if (perf->summary) {
		fprintf (perf->summary,
			 "[%3d] %8s %28s ",
			 perf->test_number,
			 perf->target->name,
			 name);
		fflush (perf->summary);
	    }
	}

	csi = cairo_script_interpreter_create ();
	cairo_script_interpreter_install_hooks (csi, &hooks);

	if (! perf->observe) {
	    cairo_perf_yield ();
	    cairo_perf_timer_start ();
	}

	cairo_script_interpreter_run (csi, trace);
	line_no = cairo_script_interpreter_get_line_number (csi);

	/* Finish before querying timings in case we are using an intermediate
	 * target and so need to destroy all surfaces before rendering
	 * commences.
	 */
	cairo_script_interpreter_finish (csi);

	if (perf->observe) {
	    cairo_device_t *observer = cairo_surface_get_device (args.surface);
	    times[i] = _cairo_time_from_s (1.e-9 * cairo_device_observer_elapsed (observer));
	    paint[i] = _cairo_time_from_s (1.e-9 * cairo_device_observer_paint_elapsed (observer));
	    mask[i] = _cairo_time_from_s (1.e-9 * cairo_device_observer_mask_elapsed (observer));
	    stroke[i] = _cairo_time_from_s (1.e-9 * cairo_device_observer_stroke_elapsed (observer));
	    fill[i] = _cairo_time_from_s (1.e-9 * cairo_device_observer_fill_elapsed (observer));
	    glyphs[i] = _cairo_time_from_s (1.e-9 * cairo_device_observer_glyphs_elapsed (observer));
	} else {
	    fill_surface (args.surface); /* queue a write to the sync'ed surface */
	    cairo_perf_timer_stop ();
	    times[i] = cairo_perf_timer_elapsed ();
	}

	scache_clear ();

	cairo_surface_destroy (args.surface);

	if (target->cleanup)
	    target->cleanup (args.closure);

	status = cairo_script_interpreter_destroy (csi);
	if (status) {
	    if (perf->summary) {
		fprintf (perf->summary, "Error during replay, line %d: %s\n",
			 line_no,
			 cairo_status_to_string (status));
	    }
	    goto out;
	}

	if (perf->raw) {
	    if (i == 0)
		printf ("[*] %s.%s %s.%d %g",
			perf->target->name,
			"rgba",
			name,
			0,
			_cairo_time_to_double (_cairo_time_from_s (1)) / 1000.);
	    printf (" %lld", (long long) times[i]);
	    fflush (stdout);
	} else if (! perf->exact_iterations) {
	    if (i > CAIRO_PERF_MIN_STD_DEV_COUNT) {
		_cairo_stats_compute (&stats, times, i+1);

		if (stats.std_dev <= CAIRO_PERF_LOW_STD_DEV) {
		    if (++low_std_dev_count >= CAIRO_PERF_STABLE_STD_DEV_COUNT)
			break;
		} else {
		    low_std_dev_count = 0;
		}
	    }
	}

	if (perf->summary && perf->summary_continuous) {
	    _cairo_stats_compute (&stats, times, i+1);

	    fprintf (perf->summary,
		     "\r[%3d] %8s %28s ",
		     perf->test_number,
		     perf->target->name,
		     name);
	    if (perf->observe) {
		fprintf (perf->summary,
			 " %#9.3f", _cairo_time_to_s (stats.median_ticks));

		_cairo_stats_compute (&stats, paint, i+1);
		fprintf (perf->summary,
			 " %#9.3f", _cairo_time_to_s (stats.median_ticks));

		_cairo_stats_compute (&stats, mask, i+1);
		fprintf (perf->summary,
			 " %#9.3f", _cairo_time_to_s (stats.median_ticks));

		_cairo_stats_compute (&stats, fill, i+1);
		fprintf (perf->summary,
			 " %#9.3f", _cairo_time_to_s (stats.median_ticks));

		_cairo_stats_compute (&stats, stroke, i+1);
		fprintf (perf->summary,
			 " %#9.3f", _cairo_time_to_s (stats.median_ticks));

		_cairo_stats_compute (&stats, glyphs, i+1);
		fprintf (perf->summary,
			 " %#9.3f", _cairo_time_to_s (stats.median_ticks));

		fprintf (perf->summary,
			 " %5d", i+1);
	    } else {
		fprintf (perf->summary,
			 "%#8.3f %#8.3f %#6.2f%% %4d/%d",
			 _cairo_time_to_s (stats.min_ticks),
			 _cairo_time_to_s (stats.median_ticks),
			 stats.std_dev * 100.0,
			 stats.iterations, i+1);
	    }
	    fflush (perf->summary);
	}
    }
    user_interrupt = 0;

    if (perf->summary) {
	_cairo_stats_compute (&stats, times, i);
	if (perf->summary_continuous) {
	    fprintf (perf->summary,
		     "\r[%3d] %8s %28s ",
		     perf->test_number,
		     perf->target->name,
		     name);
	}
	if (perf->observe) {
	    fprintf (perf->summary,
		     " %#9.3f", _cairo_time_to_s (stats.median_ticks));

	    _cairo_stats_compute (&stats, paint, i);
	    fprintf (perf->summary,
		     " %#9.3f", _cairo_time_to_s (stats.median_ticks));

	    _cairo_stats_compute (&stats, mask, i);
	    fprintf (perf->summary,
		     " %#9.3f", _cairo_time_to_s (stats.median_ticks));

	    _cairo_stats_compute (&stats, fill, i);
	    fprintf (perf->summary,
		     " %#9.3f", _cairo_time_to_s (stats.median_ticks));

	    _cairo_stats_compute (&stats, stroke, i);
	    fprintf (perf->summary,
		     " %#9.3f", _cairo_time_to_s (stats.median_ticks));

	    _cairo_stats_compute (&stats, glyphs, i);
	    fprintf (perf->summary,
		     " %#9.3f", _cairo_time_to_s (stats.median_ticks));

	    fprintf (perf->summary,
		     " %5d\n", i);
	} else {
	    fprintf (perf->summary,
		     "%#8.3f %#8.3f %#6.2f%% %4d/%d\n",
		     _cairo_time_to_s (stats.min_ticks),
		     _cairo_time_to_s (stats.median_ticks),
		     stats.std_dev * 100.0,
		     stats.iterations, i);
	}
	fflush (perf->summary);
    }

out:
    if (perf->raw) {
	printf ("\n");
	fflush (stdout);
    }

    perf->test_number++;
    free (trace_cpy);
}
Esempio n. 22
0
DbException::DbException(int err)
:	err_(err)
,	dbenv_(0)
{
	describe(0, 0);
}
void  XAP_CocoaEncodingManager::initialize()
{	
	const GList* lst = g_i18n_get_language_list ("LANG");
	const char* locname = (char*)lst->data;

	NativeEncodingName = "ISO-8859-1";
	Native8BitEncodingName = "ISO-8859-1";
	NativeUnicodeEncodingName = "UTF-8";
	LanguageISOName = "en";
	LanguageISOTerritory = "US";
	
	if (!*locname || !strcmp(locname,"C"))
	{ 	/* paranoic case - broken system */
		; /*already initialized*/
	}
	else
	{
		char* lang,*terr,*cs,*mod;
		lang = terr = cs = mod = NULL;
		int mask = explode_locale (locname,&lang,&terr,&cs,&mod);
		LanguageISOName = lang;
		g_free(mod);	// unneeded
		mod = NULL;
		if (mask & COMPONENT_TERRITORY)
		{
			LanguageISOTerritory = terr+1;/*yes, +1*/
		}
		if (mask & COMPONENT_CODESET)
		{
			NativeEncodingName = cs+1;
			if (!strncmp(cs+1,"ISO8859",strlen("ISO8859"))) {
				/*
			 	work around glibc bug - its iconv doesn't know
			 	ISO8859-* - ISO-8859-1 should be used (we encounter this 
			 	since locale.alias aliases en_US.ISO8859-1 to 'en'
			 	PS: This is true for my RH6.0 system - VH
				*/
				static char buf[40];
				strcpy(buf,"ISO-");
				strcat(buf,cs+1+3);
				NativeEncodingName = buf;
			}
			Native8BitEncodingName = NativeEncodingName;
			
			// need to get 8bit encoding if encoding is utf-8
			if(!strcmp(NativeEncodingName, "utf-8") || !strcmp(NativeEncodingName, "UTF-8"))
			{
				// we want to get the encoding that would be used for the given
				// language/territory if the utf-8 encoding was not specified
				// by LANG

			  std::string OLDLANG (getenv("LANG"));
#if defined(SETENV_MISSING) 
			  std::string MYLANG ("LANG=");
			  
			  MYLANG += LanguageISOName;
			  MYLANG += "_";
			  MYLANG += LanguageISOTerritory;
			  putenv(MYLANG.c_str());
#else
			  std::string MYLANG (LanguageISOName);
			  MYLANG += "_";
			  MYLANG += LanguageISOTerritory;
			  setenv ("LANG", MYLANG.c_str(), 1);
#endif
			
				const GList* my_lst = g_i18n_get_language_list ("LANG");
				const char* my_locname = (char*)my_lst->data;
				
	    		char* my_lang,*my_terr,*my_cs,*my_mod;
				my_lang = my_terr = my_cs = my_mod = NULL;
    			int my_mask = explode_locale (my_locname,&my_lang,&my_terr,&my_cs,&my_mod);
				if(my_mod) {
					g_free (my_mod);
					my_mod = NULL;
				}
				if (my_mask & COMPONENT_CODESET)
				{
					Native8BitEncodingName = my_cs+1;
					xxx_UT_DEBUGMSG(("Native8BitEncodingName (1) %s\n", Native8BitEncodingName));
					if (!strncmp(my_cs+1,"ISO8859",strlen("ISO8859")))
					{
						static char buf[40];
						strcpy(buf,"ISO-");
						strcat(buf,my_cs+1+3);
						Native8BitEncodingName = buf;
					}
					xxx_UT_DEBUGMSG(("Native8BitEncodingName (2) %s\n", Native8BitEncodingName));
				
				}

#if defined(SETENV_MISSING)
				MYLANG = "LANG=";
				MYLANG += OLDLANG;
				putenv(MYLANG.c_str());
#else
				setenv("LANG", OLDLANG.c_str(), 1);
#endif			
			}
		}
	};	
	XAP_EncodingManager::initialize();
	describe();
};
Esempio n. 24
0
DbException::DbException(const char *prefix, const char *description, int err)
:	err_(err)
,	dbenv_(0)
{
	describe(prefix, description);
}
Esempio n. 25
0
	describe("Maximum Adjacency Orderings", [](){
		it("should calculate exactly all MAOs", [](){
			for (int N = 4; N <= 8; N++){
				std::cout << "    " << "Busy with graphs that have " << N << " nodes." << std::endl;
				Graph P;
				emptyGraph(P, N);
				MaxAdjOrdering perms;
				ListPure<ListPure<node>> allPerms;
				perms.calcAll(&P,&allPerms);

				for (int i = 1; i < 10; i++){
					Graph G;
					randomSimpleGraph(G,N,1*N);

					//make an instance for the MAOs
					MaxAdjOrdering m;

					//make structures for saving all MAOs of G
					ListPure<ListPure<node>> MAOs;

					//calculate them
					m.calcAll(&G,&MAOs);

					AssertThat(m.testIfAllMAOs(&G,&MAOs,&allPerms), IsTrue());
				}
			}
		});
		it("should calculate MAOs with correct lex-bfs tie breaking", [](){
			for (int N = 10; N <= 20; N++){
				std::cout << "    " << "Busy with graphs that have " << N << " nodes." << std::endl;

				for (int i = 1; i < 10; i++){
					Graph G;
					randomSimpleGraph(G, N, (N*(N-4))/2);

					//make an instance for the MAOs
					MaxAdjOrdering m;

					//make structures for saving all MAOs of G
					ListPure<node> MAO;

					//calculate them
					m.calcBfs(&G,&MAO);

					AssertThat(m.testIfMAO(&G,&MAO), IsTrue());
					AssertThat(m.testIfMAOBfs(&G,&MAO), IsTrue());
				}
			}
		});
	});
Esempio n. 26
0
void maketree()
{
    /* tree construction recursively by branch and bound */
    long i, j, k;
    node2 *dummy;

    fullset = (1L << (bits + 1)) - (1L << 1);
    if (progress) {
        printf("\nHow many\n");
        printf("trees looked                                       Approximate\n");
        printf("at so far      Length of        How many           percentage\n");
        printf("(multiples     shortest tree    trees this long    searched\n");
        printf("of %4ld):      found so far     found so far       so far\n",
               howoften);
        printf("----------     ------------     ------------       ------------\n");
#ifdef WIN32
        phyFillScreenColor();
#endif
    }
    done = false;
    mults = 0;
    examined = 0;
    nextree = 1;
    root = treenode[0];
    firsttime = true;
    for (i = 0; i < (spp); i++)
        added[i] = false;
    added[0] = true;
    order[0] = 1;
    k = 2;
    fracdone = 0.0;
    fracinc = 1.0;
    bestyet = -1.0;
    addit(k);
    if (done) {
        if (progress) {
            printf("Search broken off!  Not guaranteed to\n");
            printf(" have found the most parsimonious trees.\n");
        }
        if (treeprint) {
            fprintf(outfile, "Search broken off!  Not guaranteed to\n");
            fprintf(outfile, " have found the most parsimonious\n");
            fprintf(outfile, " trees, but here is what we found:\n");
        }
    }
    if (treeprint) {
        fprintf(outfile, "\nrequires a total of %18.3f\n\n", bestyet);
        if (nextree == 2)
            fprintf(outfile, "One most parsimonious tree found:\n");
        else
            fprintf(outfile, "%5ld trees in all found\n", nextree - 1);
    }
    if (nextree > maxtrees + 1) {
        if (treeprint)
            fprintf(outfile, "here are the first%4ld of them\n", (long)maxtrees);
        nextree = maxtrees + 1;
    }
    if (treeprint)
        putc('\n', outfile);
    for (i = 0; i < (spp); i++)
        added[i] = true;
    for (i = 0; i <= (nextree - 2); i++) {
        for (j = k; j <= (spp); j++)
            add3(treenode[bestrees[i][j - 1] - 1],
                 treenode[bestorders[i][j - 1] - 1], treenode[spp + j - 2],
                 &root, treenode);
        if (noroot)
            reroot(treenode[outgrno - 1]);
        didreroot = (outgropt && noroot);
        evaluate(root);
        printree(treeprint, noroot, didreroot, root);
        describe();
        for (j = k - 1; j < (spp); j++)
            re_move3(&treenode[bestorders[i][j] - 1], &dummy, &root, treenode);
    }
    if (progress) {
        printf("\nOutput written to file \"%s\"\n\n", outfilename);
        if (trout)
            printf("Trees also written onto file \"%s\"\n\n", outtreename);
    }
    if (ancseq)
        freegarbage(&garbage);
}  /* maketree */
Esempio n. 27
0
#include "test_bit_iterator_copy.hpp"

go_bandit([] {
    using types = test_copy_iterator_types;
    describe("copying from a std::reverse_iterator<bit_iterator>",
             &test_copy_fixed_itti<types::reverse_bit_iterator>);
});

int main(int argc, char** argv)
{
    return bandit::run(argc, argv);
}