示例#1
0
void
PDL_U_LongLong::output (FILE *file) const
{
  if (h_ () > 0)
    PDL_OS::fprintf (file, "0x%lx%0*lx", h_ (), 2 * sizeof l_ (), l_ ());
  else
    PDL_OS::fprintf (file, "0x%lx", l_ ());
}
示例#2
0
ACE_BEGIN_VERSIONED_NAMESPACE_DECL

void
ACE_U_LongLong::output (FILE *file) const
{
  if (h_ () > 0)
    ACE_OS::fprintf (file, "0x%lx%0*lx", h_ (), 2 * sizeof l_ (), l_ ());
  else
    ACE_OS::fprintf (file, "0x%lx", l_ ());
}
示例#3
0
EXIT_STATUS start(const config& game_conf, CVideo& video, const std::string& filename /* = "" */,
	bool take_screenshot /* = false */, const std::string& screenshot_filename /* = "map_screenshot.bmp" */)
{
	EXIT_STATUS e = EXIT_ERROR;
	try {
		hotkey::scope_changer h_(game_conf, "hotkey_editor");
		hotkey::deactivate_all_scopes();
		hotkey::set_scope_active(hotkey::SCOPE_GENERAL);
		hotkey::set_scope_active(hotkey::SCOPE_EDITOR);
		editor_controller editor(game_conf, video);
		if (!filename.empty()) {
			if (is_directory(filename)) {
				editor.set_default_dir(filename);
				editor.load_map_dialog(true);
			} else {
				editor.load_map(filename, false);
			}
		}
		if(take_screenshot) {
			editor.do_screenshot(screenshot_filename);
			e = EXIT_NORMAL;
		} else {
			e = editor.main_loop();
		}
	} catch (editor_exception& e) {
		ERR_ED << "Editor exception in editor::start: " << e.what() << "\n";
		throw;
	}
	if (editor_action::get_instance_count() != 0) {
		ERR_ED << "Possibly leaked " << editor_action::get_instance_count() << " action objects\n";
	}
	return e;
}
示例#4
0
文件: IAPITOOLS.c 项目: vpoughon/OTB
/*<         real function Ro_1 (Theta_i,Phi_i,Theta_e,Phi_e) >*/
doublereal ro_1__(doublereal *theta_i__, doublereal *phi_i__, doublereal *
                  theta_e__, doublereal *phi_e__)
{
    /* System generated locals */
    integer i__1;
    doublereal ret_val, d__1;

    /* Builtin functions */
    double cos(doublereal), exp(doublereal);

    /* Local variables */
    extern doublereal h_(doublereal *, doublereal *);
    integer j;
    doublereal ge, gi, ke, ki, xl;
    extern doublereal g_f__(doublereal *), geo_(doublereal *, doublereal *,
            doublereal *, doublereal *);
    doublereal xdb, xli, xmm, xrm, xmu, xmui, xtmu;
    extern doublereal gamma_f__(doublereal *, doublereal *, doublereal *,
                                doublereal *);

    /*<         common /gauss_m/xgm (20),wgm (20),n >*/
    /*<         real xgm,wgm >*/
    /*<         integer n >*/
    /*<         real G_f,Geo,h,gamma_f >*/
    /*<         common /p/xLt,Rl,Tl,Rs,c,ild >*/
    /*<         real xLt,Rl,Tl,Rs,c >*/
    /*<         integer ild >*/
    /*<         common /Ro/Ro_1_c,Ro_1_s,Ro_mult >*/
    /*<         real Ro_1_c,Ro_1_s,Ro_mult >*/
    /*<         real Theta_i,Phi_i,Theta_e,Phi_e,xmui,xmu,xtmu >*/
    /*<         real Gi,Ge,Ki,Ke,xLi >*/
    /*<         real xmm,xrm >*/
    /*<         real xL >*/
    /*<         double precision xdb >*/
    /*<         integer j >*/

    /*<         xtmu=1.E-05 >*/
    xtmu = 1e-5;
    /*<         xmui=abs(cos(Theta_i)) >*/
    xmui = (d__1 = cos(*theta_i__), abs(d__1));
    /*<         xmu=cos(Theta_e) >*/
    xmu = cos(*theta_e__);
    /*<         if (abs(xmu).lt.xtmu) xmu=xtmu >*/
    if (abs(xmu) < xtmu) {
        xmu = xtmu;
    }

    /*<         Gi=G_f (Theta_i) >*/
    gi = g_f__(theta_i__);
    /*<         Ge=G_f (Theta_e) >*/
    ge = g_f__(theta_e__);

    /*<         Ki=Gi/xmui >*/
    ki = gi / xmui;
    /*<         Ke=Ge/xmu >*/
    ke = ge / xmu;

    /*<         xmm=0.5*(xLt+0.) >*/
    xmm = (p_1.xlt + 0.) * .5;
    /*<         xrm=0.5*(xLt-0.) >*/
    xrm = (p_1.xlt + 0.) * .5;
    /*<         Ro_1_c=0. >*/
    ro_1.ro_1_c__ = 0.;
    /*<         xLi=c/Geo (Theta_i,Phi_i,Theta_e,Phi_e)  >*/
    xli = p_1.c__ / geo_(theta_i__, phi_i__, theta_e__, phi_e__);
    /*<         do j=1,n >*/
    i__1 = gauss_m__1.n;
    for (j = 1; j <= i__1; ++j) {
        /*<           xL=xmm+xrm*xgm(j) >*/
        xl = xmm + xrm * gauss_m__1.xgm[j - 1];
        /*<           xdb=(Ki+Ke*h(xL,xLi))*dble(xL) >*/
        xdb = (ki + ke * h_(&xl, &xli)) * xl;
        /*<           if (abs(xdb).lt.1.E-30) xdb=0. >*/
        if (abs(xdb) < 1e-30) {
            xdb = 0.;
        }
        /*<           if (xdb.le.20) Ro_1_c=Ro_1_c+wgm(j)*xrm*dexp(-xdb) >*/
        if (xdb <= 20.) {
            ro_1.ro_1_c__ += gauss_m__1.wgm[j - 1] * xrm * exp(-xdb);
        }
        /*<         enddo >*/
    }

    /*<    >*/
    ro_1.ro_1_c__ = ro_1.ro_1_c__ * gamma_f__(theta_i__, phi_i__, theta_e__,
                    phi_e__) / xmui / xmu;

    /*<         xdb=(Ki+Ke*h (xLt,xLi))*dble(xLt) >*/
    xdb = (ki + ke * h_(&p_1.xlt, &xli)) * p_1.xlt;
    /*<         if (abs(xdb).lt.1.E-30) xdb=0. >*/
    if (abs(xdb) < 1e-30) {
        xdb = 0.;
    }
    /*<         if (xdb.le.20) Ro_1_s=Rs*dexp(-xdb) >*/
    if (xdb <= 20.) {
        ro_1.ro_1_s__ = p_1.rs * exp(-xdb);
    }

    /*<         Ro_1=Ro_1_c+Ro_1_s >*/
    ret_val = ro_1.ro_1_c__ + ro_1.ro_1_s__;

    /*<         return >*/
    return ret_val;
    /*<         end >*/
} /* ro_1__ */