• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ set_defaults函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中set_defaults函数的典型用法代码示例。如果您正苦于以下问题:C++ set_defaults函数的具体用法?C++ set_defaults怎么用?C++ set_defaults使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了set_defaults函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: global_setup

static void
global_setup (void)
{
    setup_stack (&parse_stack, parse_stack_buffer,
                 sizeof (parse_stack_buffer));
    setup_display ();
    setup_sgf ();

    set_defaults();
    if (configfile_load(SETTINGS_FILENAME, config,
                        sizeof(config)/sizeof(*config),
                        SETTINGS_MIN_VERSION ) < 0)
    {
        /* If the loading failed, save a new config file (as the disk is
           already spinning) */

        /* set defaults again just in case (don't know if they can ever
         * be messed up by configfile_load, and it's basically free anyway)
         */
        set_defaults();

        configfile_save(SETTINGS_FILENAME, config,
                        sizeof(config)/sizeof(*config),
                        SETTINGS_VERSION);
    }
}
开发者ID:CrashSerious,项目名称:rockbox_psgroove,代码行数:26,代码来源:goban.c


示例2: main123

/*
 * main:
 * -----
 */
int main123(int argc, char **argv)
{
  time_t end_time;
  int raw = 0;
  int mono_from_stereo = 0;

  printf("Shine v1.08 19/06/03\n");

  time(&config.start_time);
  set_defaults();

  if (!parse_command(argc, argv, &raw, &mono_from_stereo))
    print_usage();

  wave_open(raw, mono_from_stereo); /* prints wave (input) configuration */

  check_config(); /* prints mpeg (output) configuration */

  printf("Encoding \"%s\" to \"%s\"\n", config.infile, config.outfile);

  L3_compress();

  wave_close();

  time(&end_time);
  end_time -= config.start_time;
  printf(" Finished in %2ld:%2ld:%2ld\n",
            end_time/3600,(end_time/60)%60,end_time%60);

  return 0;
}
开发者ID:Mjiulee,项目名称:jobMeetY,代码行数:35,代码来源:mp3encoder.c


示例3: main

int main(int argc, char **argv) {
  int num_iters;
#if (NUMTESTS > 0)
  int i;
  double time;
  double time_per;
#endif
  set_defaults();
  setup_indexing();
  load_default_data();
  /* Solve problem instance for the record. */
  settings.verbose = 1;
  num_iters = solve();
#ifndef ZERO_LIBRARY_MODE
#if (NUMTESTS > 0)
  /* Now solve multiple problem instances for timing purposes. */
  settings.verbose = 0;
  tic();
  for (i = 0; i < NUMTESTS; i++) {
    solve();
  }
  time = tocq();
  printf("Timed %d solves over %.3f seconds.\n", NUMTESTS, time);
  time_per = time / NUMTESTS;
  if (time_per > 1) {
    printf("Actual time taken per solve: %.3g s.\n", time_per);
  } else if (time_per > 1e-3) {
    printf("Actual time taken per solve: %.3g ms.\n", 1e3*time_per);
  } else {
    printf("Actual time taken per solve: %.3g us.\n", 1e6*time_per);
  }
#endif
#endif
  return 0;
}
开发者ID:RIVeR-Lab,项目名称:ihmc-open-robotics-software,代码行数:35,代码来源:testsolver.c


示例4: main

int main(int argc, char **argv)
{
    int i;
    char buffer[MAXBUFSIZE];
    int done=0;

    set_defaults();
    handle_args(argc, argv, 0);
    srand(time(NULL));

    if(num_clients < 1)
        FATALERR("More than 1 node is required to run\n");

    // Capture exit signals to safetly close the program
    signal(SIGINT, signal_handler);
    signal(SIGTERM, signal_handler);
    signal(SIGABRT, signal_handler);

    // If there was no ip address set in the command line, listen for a broadcast from the server
    if(server_addr.sin_addr.s_addr == 0)
    {
        setup_listen_socket();
        obtain_server();
    }

    // Attempt to create a TCP connection to the server
    if(!connectTCP())
        QUIT();

    send_data();

    signal_handler(0);
}
开发者ID:OpenEta,项目名称:SmartletSimulator,代码行数:33,代码来源:mockdevice.c


示例5: main

int main(int argc, char** argv)
{
  set_defaults();

  parse_options(argc, argv);

  if (conf.help_flag) {
    print_help();
    exit(0);
  }

  check_conf();

  unsigned int arr_width = conf.width * conf.multiplier;
  unsigned int arr_height = conf.height * conf.multiplier;
  
  printf("Creating array size of %ux%u.\n", arr_width, arr_height);
  Array* arr = new_array(arr_width, arr_height);

  printf("Initializing with side temps of %f, %f, %f, %f.\n",
          conf.top_temp, conf.right_temp, conf.bottom_temp, conf.left_temp);
  initialize_array(arr, conf.top_temp, conf.right_temp, conf.bottom_temp, conf.left_temp);

  printf("Searching for temp balance with max iterations of %d.\n", conf.max_iters);
  double mean_temp = calculate_heatconduct(arr, conf.max_iters);

  printf("Mean temperature: %f\n", mean_temp);

  return 0;
}
开发者ID:Hilzu,项目名称:HeatConduction,代码行数:30,代码来源:main.c


示例6: read_config

static gboolean
read_config (GtkFileChooserSettings *settings,
	     GError **error)
{
  char *filename;
  char *contents;
  gsize contents_len;
  gboolean success;

  filename = get_config_filename ();

  success = g_file_get_contents (filename, &contents, &contents_len, error);
  g_free (filename);

  if (!success)
    {
      set_defaults (settings);
      return FALSE;
    }

  success = parse_config (settings, contents, error);

  g_free (contents);

  return success;
}
开发者ID:batman52,项目名称:dingux-code,代码行数:26,代码来源:gtkfilechoosersettings.c


示例7: init

static AS3_Val init(void * self, AS3_Val args)
{
	void * ref;
	void * src;
	void * dest;
	
	AS3_ArrayValue(args, "AS3ValType, AS3ValType, AS3ValType", &ref, &src, &dest);
	
	flashErrorsRef = (AS3_Val)ref;
	
	config.wave.file	= funopen((void *)src, readByteArray, writeByteArray, seekByteArray, closeByteArray);
	config.wave.output	= funopen((void *)dest, readByteArray, writeByteArray, seekByteArray, closeByteArray);
	
	if (config.wave.file == NULL || config.wave.output == NULL) {
		ERROR("Unable to set bytes arrays");
	}
	
	wave_open();
	
	set_defaults();
    check_config();
		
	start_compress();
	
	return AS3_Int(1);
}
开发者ID:Glideh,项目名称:jfrec,代码行数:26,代码来源:main.c


示例8: mca_base_open

/*
 * Main MCA initialization.  
 */
int mca_base_open(void)
{
  int param_index;
  char *value;
  opal_output_stream_t lds;
  char hostname[64];

  if (!mca_base_opened) {
    mca_base_opened = true;
  } else {
    return OPAL_SUCCESS;
  }

  /* Register some params */
#if OMPI_WANT_HOME_CONFIG_FILES
  asprintf(&value, "%s%c%s"OPAL_PATH_SEP".openmpi"OPAL_PATH_SEP"components", opal_install_dirs.pkglibdir, OPAL_ENV_SEP, opal_home_directory() );
#else
# if defined(__WINDOWS__) && defined(_DEBUG) 
    asprintf(&value, "%s/debug", opal_install_dirs.pkglibdir);  
# else 
    asprintf(&value, "%s", opal_install_dirs.pkglibdir);  
# endif 
#endif

  mca_base_param_component_path = 
    mca_base_param_reg_string_name("mca", "component_path",
                                   "Path where to look for Open MPI and ORTE components", 
                                   false, false, value, NULL);
  free(value);
  param_index = mca_base_param_reg_string_name("mca", "verbose", 
                                               "Top-level verbosity parameter",
                                               false, false, NULL, NULL);

  mca_base_param_reg_int_name("mca", "component_show_load_errors", 
                              "Whether to show errors for components that failed to load or not", 
                              false, false, 1, NULL);

  mca_base_param_reg_int_name("mca", "component_disable_dlopen",
                              "Whether to attempt to disable opening dynamic components or not",
                              false, false, 0, NULL);

  /* What verbosity level do we want? */

  mca_base_param_lookup_string(param_index, &value);
  memset(&lds, 0, sizeof(lds));
  if (NULL != value) {
    parse_verbose(value, &lds);
    free(value);
  } else {
    set_defaults(&lds);
  }
  gethostname(hostname, 64);
  asprintf(&lds.lds_prefix, "[%s:%05d] ", hostname, getpid());
  opal_output_reopen(0, &lds);
  opal_output_verbose(5, 0, "mca: base: opening components");
  free(lds.lds_prefix);
  /* Open up the component repository */

  return mca_base_component_repository_init();
}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:63,代码来源:mca_base_open.c


示例9: sh_utmp_end

int sh_utmp_end ()
{
  struct log_user * user    = userlist;
  struct log_user * userold;

  SL_ENTER(_("sh_utmp_end"));
  while (user)
    {
      userold = user;
      user    = user->next;
      SH_FREE(userold);
    }
  userlist = NULL;
#ifdef HAVE_UTTYPE
  (void) sh_utmp_login_clean();
#endif
  /* Reset the flag, such that the module
   * can be re-enabled.
   */
  set_defaults();
  init_done          = 0;

#if defined(HAVE_PTHREAD)
  sh_inotify_remove(&inotify_watch);
#endif

  SL_RETURN( (0), _("sh_utmp_end"));
}
开发者ID:stevehanlon,项目名称:rinnegan,代码行数:28,代码来源:sh_utmp.c


示例10: main

int
main(int argc, char *argv[])
{
  int result;
  struct fuse_args args = FUSE_ARGS_INIT(argc, argv);

  memset(&stormfs, 0, sizeof(struct stormfs));
  stormfs.progname = argv[0];
  stormfs.service = AMAZON;
  set_defaults();

  if(fuse_opt_parse(&args, &stormfs, stormfs_opts, stormfs_opt_proc) == -1) {
    fprintf(stderr, "%s: error parsing command-line options\n", stormfs.progname);
    exit(EXIT_FAILURE);
  }

  parse_config(stormfs.config);
  validate_config();
  if(stormfs.rrs)
    stormfs.storage_class = "REDUCED_REDUNDANCY";

  stormfs.virtual_url = stormfs_virtual_url(stormfs.url, stormfs.bucket);

  g_thread_init(NULL);
  result = stormfs_fuse_main(&args);

  fuse_opt_free_args(&args);

  return result;
}
开发者ID:JeremyOT,项目名称:stormfs,代码行数:30,代码来源:stormfs.c


示例11: graphdefaults

void graphdefaults()
{
    set_defaults();

   for (int i = 0; i <= MAXCOLORS; i++) { 
   	current_palette.colors[i] = i;
   	BGIpalette[i] = BGIcolor[i];
    }
    SetPaletteEntries(hPalette, BG, MAXCOLORS+1, BGIpalette);
    RealizePalette(hdc[0]);

    SetTextColor(hdc[0], PALETTEINDEX(text_color+BG));
    SetTextColor(hdc[1], PALETTEINDEX(text_color+BG));
    SetBkColor(hdc[0], PALETTEINDEX(BG));
    SetBkColor(hdc[1], PALETTEINDEX(BG));

    SelectClipRgn(hdc[0], NULL);
    SelectClipRgn(hdc[1], NULL);
    SetViewportOrgEx(hdc[0], 0, 0, NULL);
    SetViewportOrgEx(hdc[1], 0, 0, NULL);

    SelectObject(hdc[0], hBrush[fill_settings.pattern]);
    SelectObject(hdc[1], hBrush[fill_settings.pattern]);

    moveto(0,0);
}
开发者ID:kevinzhang2012,项目名称:AI,代码行数:26,代码来源:graphics.cpp


示例12: save_subset

void save_subset(ImageInfo *ii)
{
    if (g_poly->n > 0) {
        if (crosshair_line > 0 && crosshair_samp > 0) {

            // clamp crosshair to image extent, if needed
            if (crosshair_line >= ii->meta->general->line_count)
                crosshair_line = ii->meta->general->line_count - 1;
            if (crosshair_samp >= ii->meta->general->sample_count)
                crosshair_samp = ii->meta->general->sample_count - 1;

            show_save_subset_window();
            set_defaults(ii);
            
            g_poly->show_extent = TRUE;
            fill_big(ii);

            update_save_subset_info();
        } else {
            asfPrintWarning("Can't save subset: No crosshair.\n");
        }
    } else {
        // shouldn't ever get in here...
        asfPrintWarning("Can't save subset: Polygon not defined.\n");
    }
}
开发者ID:asfadmin,项目名称:ASF_MapReady,代码行数:26,代码来源:subset.c


示例13: set_defaults

JNIEXPORT void JNICALL Java_us_ihmc_commonWalkingControlModules_controlModules_nativeOptimization_CVXMomentumOptimizerWithGRFSmootherNative_initialize
  (JNIEnv * env, jclass jClass)
{
	set_defaults();
	setup_indexing();
	settings.verbose = 0;

	AByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.A, sizeof(double) * ASize));
    bByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.b, sizeof(double) * bSize));
    CByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.C, sizeof(double) * CSize));
    JsByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.Js, sizeof(double) * JsSize));
    psByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.ps, sizeof(double) * psSize));
    WsByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.Ws, sizeof(double) * WsSize));
    LambdaByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.Lambda, sizeof(double) * LambdaSize));
    QrhoByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.Qrho, sizeof(double) * QrhoSize));
    QphiByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.Qphi, sizeof(double) * QphiSize));
    cByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.c, sizeof(double) * cSize));
    rhoMinByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.rhoMin, sizeof(double) * rhoMinSize));
    phiMinByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.phiMin, sizeof(double) * phiMinSize));
    phiMaxByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.phiMax, sizeof(double) * phiMaxSize));
    WRhoByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.WRho, sizeof(double) * WRhoSize));
    WPhiByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.WPhi, sizeof(double) * WPhiSize));

    rhoPreviousByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.rhoPrevious, sizeof(double) * rhoPreviousSize));
    WRhoSmootherByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, params.WRhoSmoother, sizeof(double) * WRhoSmootherSize));

    rhoByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, vars.rho, sizeof(double) * rhoSize));
    phiByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, vars.phi, sizeof(double) * phiSize));
    vdByteBuffer = (*env)->NewGlobalRef(env, (*env)->NewDirectByteBuffer(env, vars.vd, sizeof(double) * vdSize));
}
开发者ID:RIVeR-Lab,项目名称:ihmc-open-robotics-software,代码行数:30,代码来源:CVXMomentumOptimizerWithGRFSmootherNative.c


示例14: sh_utmp_reconf

int sh_utmp_reconf()
{
  set_defaults();
#if defined(HAVE_PTHREAD)
  sh_inotify_remove(&inotify_watch);
#endif
  return 0;
}
开发者ID:stevehanlon,项目名称:rinnegan,代码行数:8,代码来源:sh_utmp.c


示例15: __attribute__

__attribute__((constructor)) static void _liblogfaf_init(void) {
    DBG(("liblogfaf: init()\n"));
    init_progname(&shared_data);
    init_hostname(&shared_data);
    init_connection(&shared_data);
    pthread_mutex_init(&shared_data.lock, NULL);
    set_defaults(&shared_data);
}
开发者ID:MaheedharGunturu,项目名称:liblogfaf,代码行数:8,代码来源:liblogfaf.c


示例16: rotor_window_base

enigma_rotor_window::enigma_rotor_window(int pos_x, int pos_y, bool orient)
    : rotor_window_base(pos_x, pos_y)
{ 
    screw_orientation = orient;
    upper = new screw(0, 0, screw_orientation);
    lower = new screw(0, 0, !screw_orientation);
    set_defaults();
}
开发者ID:rmsk2,项目名称:rmsk2,代码行数:8,代码来源:rotor_window.cpp


示例17: set_defaults

user_midi_bus::user_midi_bus (const std::string & name)
 :
    m_is_valid          (false),
    m_channel_count     (0),
    m_midi_bus_def      ()
{
    set_defaults();
    set_name(name);
}
开发者ID:0rel,项目名称:sequencer64,代码行数:9,代码来源:user_midi_bus.cpp


示例18: set_defaults

//----TEventWindow class member definitions---------------------
TEventWindow::TEventWindow(pchar caption, TWin *parent, dword style)
//-----------------------------------------------------------------
{
  set_defaults();
  if (style) m_style |= style;
  create_window(caption, parent);
  get_dc()->set_text_align(TA_TOP | TA_LEFT);
  enable_resize(true);
}
开发者ID:Artorios,项目名称:rootkit.com,代码行数:10,代码来源:twl.cpp


示例19: Entity

	Sprite::Sprite(Renderer* renderer, const String& TextureFile) : Entity(renderer)
	{
		set_defaults();
		if (TextureFile.length() > 0)
		{
			ManagedResources::ManagedTexturePtr texture = m_renderer->resources().get_texture(TextureFile);
			change_texture(texture, true);
		}
	}
开发者ID:RonenNess,项目名称:ness-engine,代码行数:9,代码来源:sprite.cpp


示例20: main

/* MAIN */
int main( int argc, char ** argv ) {
	struct opdis_options opts = {0}; // TODO: defaults
	struct job_options_t job_opts;

	set_defaults( &opts );

	argp_parse( &argp_cfg, argc, argv, 0, 0, &opts );

	if ( opts.list_arch ) {
		list_arch();
		return 0;
	}

	if ( opts.list_disasm_opt ) {
		list_disasm_opts();
		return 0;
	}

	if ( opts.list_syntax ) {
		list_syntax();
		return 0;
	}

	if ( opts.list_format ) {
		list_format();
		return 0;
	}

	if (! opts.jobs->num_items ) {
		/* if no jobs were requested, do a linear disasm of all */
		int i;
		for ( i = 0; i < opts.targets->num_items; i++ ) {
			job_list_add( opts.jobs, job_linear, "(default)", 
				      i + 1, 0, OPDIS_INVALID_ADDR, 0 );
		}
	}

	load_bfd_targets( & opts );

	if ( opts.dry_run ) {
		dry_run( & opts );
		return 0;
	}

	if (! opts.targets->num_items ) {
		fprintf( stderr, "No targets specified! Use -? for help.\n" );
		return 1;
	}

	configure_opdis( & opts );
	set_job_opts( &opts, &job_opts );
	job_list_perform_all( opts.jobs, &job_opts );

	output_disassembly( & opts );

	return 0;
}
开发者ID:grugq,项目名称:tg-community,代码行数:58,代码来源:main.c



注:本文中的set_defaults函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ set_difference函数代码示例发布时间:2022-05-30
下一篇:
C++ set_default_env函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap