Fixed a number of "-Wextra -Wdouble-promotion" warnings. (nw)

This commit is contained in:
couriersud 2015-05-18 00:38:30 +02:00
parent d99237d21a
commit a121403aa3
29 changed files with 92 additions and 83 deletions

View File

@ -180,7 +180,7 @@ typedef es5510_device::alu_op_t alu_op_t;
typedef es5510_device::op_select_t op_select_t;
typedef es5510_device::op_src_dst_t op_src_dst_t;
static inline const char * const REGNAME(UINT8 r) {
static inline const char * REGNAME(UINT8 r) {
static char rn[8];
if (r < 234) { sprintf(rn, "GPR_%02x", r); return rn; }
switch(r) {

View File

@ -192,7 +192,7 @@ static void append_immediate(UINT16 data, int is_float, int is_unsigned, char *b
else
expanded_data += ((-data & 0x0fff) << 12);
float_val = *(float *)&expanded_data;
sprintf(dst, "%8f", float_val);
sprintf(dst, "%8f", (double) float_val);
}
else if (!is_unsigned && (INT16)data < 0)
sprintf(dst, "-$%04X", -data & 0xffff);

View File

@ -601,7 +601,7 @@ public:
ATTR_HOT void update()
{
double val = INPANALOG(m_in);
nl_double val = INPANALOG(m_in);
sound_update(netlist().time());
m_cur = (stream_sample_t) (val * m_mult.Value() + m_offset.Value());
}
@ -685,7 +685,7 @@ public:
{
if (m_buffer[i] == NULL)
break; // stop, called outside of stream_update
double v = m_buffer[i][m_pos];
nl_double v = m_buffer[i][m_pos];
m_param[i]->setTo(v * m_param_mult[i].Value() + m_param_offset[i].Value());
}
m_pos++;

View File

@ -15,8 +15,8 @@
NETLIB_START(VCCS)
{
start_internal(1.0 / netlist().gmin());
m_gfac = 1.0;
start_internal(NL_FCONST(1.0) / netlist().gmin());
m_gfac = NL_FCONST(1.0);
}
void NETLIB_NAME(VCCS)::start_internal(const nl_double def_RI)
@ -48,16 +48,16 @@ void NETLIB_NAME(VCCS)::start_internal(const nl_double def_RI)
NETLIB_RESET(VCCS)
{
const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A
const nl_double GI = 1.0 / m_RI.Value();
const nl_double GI = NL_FCONST(1.0) / m_RI.Value();
m_IP.set(GI);
m_IN.set(GI);
m_OP.set(m_mult, 0.0);
m_OP1.set(-m_mult, 0.0);
m_OP.set(m_mult, NL_FCONST(0.0));
m_OP1.set(-m_mult, NL_FCONST(0.0));
m_ON.set(-m_mult, 0.0);
m_ON1.set(m_mult, 0.0);
m_ON.set(-m_mult, NL_FCONST(0.0));
m_ON1.set(m_mult, NL_FCONST(0.0));
}
NETLIB_UPDATE_PARAM(VCCS)
@ -85,7 +85,7 @@ NETLIB_UPDATE(VCCS)
NETLIB_START(CCCS)
{
start_internal(1.0);
m_gfac = 1.0 / m_RI.Value();
m_gfac = NL_FCONST(1.0) / m_RI.Value();
}
NETLIB_RESET(CCCS)
@ -125,11 +125,11 @@ NETLIB_START(VCVS)
NETLIB_RESET(VCVS)
{
m_gfac = 1.0 / m_RO.Value();
m_gfac = NL_FCONST(1.0) / m_RO.Value();
NETLIB_NAME(VCCS)::reset();
m_OP2.set(1.0 / m_RO.Value());
m_ON2.set(1.0 / m_RO.Value());
m_OP2.set(NL_FCONST(1.0) / m_RO.Value());
m_ON2.set(NL_FCONST(1.0) / m_RO.Value());
}
NETLIB_UPDATE_PARAM(VCVS)

View File

@ -106,8 +106,8 @@ ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::compute_next
n->m_h_n_m_1 = hn;
n->m_DD_n_m_1 = DD_n;
if (nl_math::abs(DD2) > 1e-50) // avoid div-by-zero
new_net_timestep = nl_math::sqrt(m_params.m_lte / nl_math::abs(0.5*DD2));
if (nl_math::abs(DD2) > NL_FCONST(1e-30)) // avoid div-by-zero
new_net_timestep = nl_math::sqrt(m_params.m_lte / nl_math::abs(NL_FCONST(0.5)*DD2));
else
new_net_timestep = m_params.m_max_timestep;
@ -312,7 +312,7 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
for (int j = i + 1; j < kN; j++)
{
const nl_double f1 = - m_A[j][i] * f;
if (f1 != 0.0)
if (f1 != NL_FCONST(0.0))
{
for (int k = i + 1; k < kN; k++)
m_A[j][k] += m_A[i][k] * f1;
@ -365,7 +365,7 @@ ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::delta(
cerr2 = (e2 > cerr2 ? e2 : cerr2);
}
// FIXME: Review
return cerr + cerr2*100000.0;
return cerr + cerr2*NL_FCONST(100000.0);
}
template <int m_N, int _storage_N>

View File

@ -138,22 +138,22 @@ ATTR_HOT inline int netlist_matrix_solver_SOR_t<m_N, _storage_N>::vsolve_non_dyn
if (USE_GABS)
{
gabs_t *= 0.95; // avoid rounding issues
gabs_t *= NL_FCONST(0.95); // avoid rounding issues
if (gabs_t <= gtot_t)
{
w[k] = ws / gtot_t;
one_m_w[k] = 1.0 - ws;
one_m_w[k] = NL_FCONST(1.0) - ws;
}
else
{
w[k] = 1.0 / (gtot_t + gabs_t);
one_m_w[k] = 1.0 - 1.0 * gtot_t / (gtot_t + gabs_t);
w[k] = NL_FCONST(1.0) / (gtot_t + gabs_t);
one_m_w[k] = NL_FCONST(1.0) - NL_FCONST(1.0) * gtot_t / (gtot_t + gabs_t);
}
}
else
{
w[k] = ws / gtot_t;
one_m_w[k] = 1.0 - ws;
one_m_w[k] = NL_FCONST(1.0) - ws;
}
}

View File

@ -113,10 +113,12 @@ ATTR_HOT nl_double netlist_matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve()
sqo += this->m_Vdelta[k] * this->m_Vdelta[k];
this->m_Vdelta[k] = nv;
}
if (sqo > 1e-90)
// FIXME: used to be 1e90, but this would not be compatible with float
if (sqo > NL_FCONST(1e-20))
m_lp_fact = std::min(nl_math::sqrt(sq/sqo), (nl_double) 2.0);
else
m_lp_fact = 0.0;
m_lp_fact = NL_FCONST(0.0);
}

View File

@ -452,7 +452,7 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
if (m_params.m_dynamic)
{
m_params.m_max_timestep *= 1000.0;
m_params.m_max_timestep *= NL_FCONST(1000.0);
}
else
{

View File

@ -140,7 +140,7 @@ public:
inline void set_R(const nl_double R)
{
set(1.0 / R, 0.0, 0.0);
set(NL_FCONST(1.0) / R, 0.0, 0.0);
}
protected:
@ -216,7 +216,7 @@ public:
{
//FIXME: Optimize cutoff case
if (nVd < -5.0 * m_Vt)
if (nVd < NL_FCONST(-5.0) * m_Vt)
{
m_Vd = nVd;
m_G = m_gmin;
@ -227,17 +227,17 @@ public:
m_Vd = nVd;
const nl_double eVDVt = nl_math::exp(m_Vd * m_VtInv);
m_Id = m_Is * (eVDVt - 1.0);
m_Id = m_Is * (eVDVt - NL_FCONST(1.0));
m_G = m_Is * m_VtInv * eVDVt + m_gmin;
}
else
{
nl_double a = (nVd - m_Vd) * m_VtInv;
if (a<1e-12 - 1.0) a = 1e-12 - 1.0;
if (a < NL_FCONST(1e-12) - NL_FCONST(1.0)) a = NL_FCONST(1e-12) - NL_FCONST(1.0);
m_Vd = m_Vd + nl_math::e_log1p(a) * m_Vt;
const nl_double eVDVt = nl_math::exp(m_Vd * m_VtInv);
m_Id = m_Is * (eVDVt - 1.0);
m_Id = m_Is * (eVDVt - NL_FCONST(1.0));
m_G = m_Is * m_VtInv * eVDVt + m_gmin;
}

View File

@ -23,21 +23,21 @@ NETLIB_RESET(4066)
NETLIB_UPDATE(4066)
{
nl_double sup = (m_supply->vdd() - m_supply->vss());
nl_double low = 0.45 * sup;
nl_double high = 0.55 * sup;
nl_double low = NL_FCONST(0.45) * sup;
nl_double high = NL_FCONST(0.55) * sup;
nl_double in = INPANALOG(m_control) - m_supply->vss();
nl_double rON = m_base_r * 5.0 / sup;
nl_double rON = m_base_r * NL_FCONST(5.0) / sup;
nl_double R = -1.0;
if (in < low)
{
R = 1.0 / netlist().gmin();
R = NL_FCONST(1.0) / netlist().gmin();
}
else if (in > high)
{
R = rON;
}
if (R > 0.0)
if (R > NL_FCONST(0.0))
{
// We only need to update the net first if this is a time stepping net
if (1) // m_R.m_P.net().as_analog().solver()->is_timestep())

View File

@ -141,11 +141,11 @@ NETLIB_UPDATE(SN74LS629)
freq += k9 * v_rng * v_freq_3;
freq += k10 * v_rng * v_freq_4;
freq *= 0.1e-6 / m_CAP.Value();
freq *= NL_FCONST(0.1e-6) / m_CAP.Value();
// FIXME: we need a possibility to remove entries from queue ...
// or an exact model ...
m_clock.m_inc = netlist_time::from_double(0.5 / freq);
m_clock.m_inc = netlist_time::from_double(0.5 / (double) freq);
//m_clock.update();
NL_VERBOSE_OUT(("%s %f %f %f\n", name().cstr(), v_freq, v_rng, freq));

View File

@ -24,7 +24,7 @@ NETLIB_RESET(log)
NETLIB_UPDATE(log)
{
fprintf(m_file, "%20.9e %e\n", netlist().time().as_double(), INPANALOG(m_I));
fprintf(m_file, "%20.9e %e\n", netlist().time().as_double(), (nl_double) INPANALOG(m_I));
}
NETLIB_NAME(log)::~NETLIB_NAME(log)()
@ -44,7 +44,7 @@ NETLIB_RESET(logD)
NETLIB_UPDATE(logD)
{
fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I) - INPANALOG(m_I2));
fprintf(m_file, "%e %e\n", netlist().time().as_double(), (nl_double) (INPANALOG(m_I) - INPANALOG(m_I2)));
}
// FIXME: Implement wav later, this must be clock triggered device where the input to be written

View File

@ -34,7 +34,7 @@ NETLIB_UPDATE_PARAM(r2r_dac)
update_dev();
nl_double V = m_VIN.Value() / (double) (1 << m_num.Value()) * (double) m_val.Value();
nl_double V = m_VIN.Value() / (nl_double) (1 << m_num.Value()) * (nl_double) m_val.Value();
this->set(1.0 / m_R.Value(), V, 0.0);
}

View File

@ -217,7 +217,7 @@ ATTR_HOT ATTR_ALIGN void nld_d_to_a_proxy::update()
{
m_RV.update_dev();
}
m_RV.set(1.0 / R, V, 0.0);
m_RV.set(NL_FCONST(1.0) / R, V, 0.0);
m_RV.m_P.schedule_after(NLTIME_FROM_NS(1));
}
}

View File

@ -938,7 +938,8 @@ ATTR_COLD netlist_analog_output_t::netlist_analog_output_t()
ATTR_COLD void netlist_analog_output_t::initial(const nl_double val)
{
net().as_analog().m_cur_Analog = val * 0.99;
// FIXME: Really necessary?
net().as_analog().m_cur_Analog = val * NL_FCONST(0.99);
}
// ----------------------------------------------------------------------------------------
@ -1007,7 +1008,7 @@ ATTR_COLD nl_double netlist_param_model_t::model_value(const pstring &entity, co
if (pequal < 0)
netlist().error("parameter %s misformat in model %s temp %s\n", entity.cstr(), Value().cstr(), tmp.cstr());
tmp = tmp.substr(pequal+1);
nl_double factor = 1.0;
nl_double factor = NL_FCONST(1.0);
switch (*(tmp.right(1).cstr()))
{
case 'm': factor = 1e-3; break;
@ -1018,9 +1019,9 @@ ATTR_COLD nl_double netlist_param_model_t::model_value(const pstring &entity, co
case 'a': factor = 1e-18; break;
}
if (factor != 1.0)
if (factor != NL_FCONST(1.0))
tmp = tmp.left(tmp.len() - 1);
return atof(tmp.cstr()) * factor;
return (nl_double) atof(tmp.cstr()) * factor;
}
else
{

View File

@ -75,7 +75,13 @@
#define NETLIST_GMIN_DEFAULT (1e-9)
//#define nl_double float
//#define NL_FCONST(x) (x ## f)
#define nl_double double
#define NL_FCONST(x) x
//============================================================
// Solver defines

View File

@ -72,10 +72,10 @@ static void resample_argb_bitmap_average(UINT32 *dest, UINT32 drowpixels, UINT32
UINT32 x, y;
/* precompute premultiplied R/G/B/A factors */
r = color.r * color.a * 256.0;
g = color.g * color.a * 256.0;
b = color.b * color.a * 256.0;
a = color.a * 256.0;
r = color.r * color.a * 256.0f;
g = color.g * color.a * 256.0f;
b = color.b * color.a * 256.0f;
a = color.a * 256.0f;
/* loop over the target vertically */
for (y = 0; y < dheight; y++)
@ -163,10 +163,10 @@ static void resample_argb_bitmap_bilinear(UINT32 *dest, UINT32 drowpixels, UINT3
UINT32 x, y;
/* precompute premultiplied R/G/B/A factors */
r = color.r * color.a * 256.0;
g = color.g * color.a * 256.0;
b = color.b * color.a * 256.0;
a = color.a * 256.0;
r = color.r * color.a * 256.0f;
g = color.g * color.a * 256.0f;
b = color.b * color.a * 256.0f;
a = color.a * 256.0f;
/* loop over the target vertically */
for (y = 0; y < dheight; y++)
@ -500,7 +500,7 @@ void render_line_to_quad(const render_bounds *bounds, float width, render_bounds
else
{
/* prescale unitx and unity by the half-width */
float invlength = width / sqrt(unitx * unitx + unity * unity);
float invlength = width / sqrtf(unitx * unitx + unity * unity);
unitx *= invlength;
unity *= invlength;
}

View File

@ -154,7 +154,7 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
INT32 frequency,delta,offset,pos;
INT32 cnt, voicecnt;
INT32 lastdt,prevdt,dltdt;
float pbase=(float)m_baserate*2.0 / (float)m_sample_rate;
float pbase=(float)m_baserate*2.0f / (float)m_sample_rate;
INT16 *lmix, *rmix;

View File

@ -164,7 +164,7 @@ void vector_device::device_start()
void vector_device::set_flicker(float _flicker)
{
m_flicker_correction = _flicker;
m_flicker = (int)(m_flicker_correction * 2.55);
m_flicker = (int)(m_flicker_correction * 2.55f);
}
float vector_device::get_flicker()

View File

@ -147,7 +147,7 @@ void micro3d_sound_device::noise_sh_w(UINT8 data)
if (m_vca == 255)
m_gain = 0;
else
m_gain = exp(-(float)(m_vca) / 25.0) * 10.0;
m_gain = expf(-(float)(m_vca) / 25.0f) * 10.0f;
q = 0.75/255 * (255 - m_vcq) + 0.1;
fc = 4500.0/255 * (255 - m_vcf) + 100;
@ -241,8 +241,8 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_samp
if (m_gain == 0)
return;
pan_l = (float)(255 - m_pan) / 255.0;
pan_r = (float)(m_pan) / 255.0;
pan_l = (float)(255 - m_pan) / 255.0f;
pan_r = (float)(m_pan) / 255.0f;
while (samples--)
{
@ -260,7 +260,7 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_samp
m_noise_subcount = 2000000 / MM5837_CLOCK;
}
m_noise_subcount -= step;
input = (float)m_noise_value - 0.5;
input = (float)m_noise_value - 0.5f;
white = input;
/* Pink noise filtering */
@ -296,7 +296,7 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_samp
hist1_ptr++;
hist2_ptr++;
}
output *= 3.5;
output *= 3.5f;
/* Clip */
if (output > 32767)

View File

@ -209,8 +209,8 @@ WRITE8_MEMBER(astrocde_state::seawolf2_sound_2_w)// Port 41
m_samples->set_volume(9, (data & 0x80) ? 1.0 : 0.0);
/* dive panning controlled by low 3 bits */
m_samples->set_volume(2, (float)(~data & 0x07) / 7.0);
m_samples->set_volume(7, (float)(data & 0x07) / 7.0);
m_samples->set_volume(2, (float)(~data & 0x07) / 7.0f);
m_samples->set_volume(7, (float)(data & 0x07) / 7.0f);
if (rising_bits & 0x08)
{

View File

@ -208,7 +208,7 @@ UINT32 galaxia_state::screen_update_astrowar(screen_device &screen, bitmap_ind16
float s_ratio = 256.0f / 196.0f;
float sx = x * s_ratio;
if ((int)(sx + 0.5) > cliprect.max_x)
if ((int)(sx + 0.5f) > cliprect.max_x)
break;
// copy the S2636 bitmap into the main bitmap and check collision
@ -217,11 +217,11 @@ UINT32 galaxia_state::screen_update_astrowar(screen_device &screen, bitmap_ind16
if (S2636_IS_PIXEL_DRAWN(pixel))
{
// S2636 vs. background collision detection
if ((m_temp_bitmap.pix16(y, (int)(sx)) | m_temp_bitmap.pix16(y, (int)(sx + 0.5))) & 1)
if ((m_temp_bitmap.pix16(y, (int)(sx)) | m_temp_bitmap.pix16(y, (int)(sx + 0.5f))) & 1)
m_collision_register |= 0x01;
bitmap.pix16(y, (int)(sx)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE;
bitmap.pix16(y, (int)(sx + 0.5)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE;
bitmap.pix16(y, (int)(sx + 0.5f)) = S2636_PIXEL_COLOR(pixel) | SPRITE_PEN_BASE;
}
}
}

View File

@ -2035,9 +2035,9 @@ WRITE8_MEMBER(towns_state::towns_volume_w)
case 2:
m_towns_volume[m_towns_volume_select] = data;
if(m_towns_volume_select == 4)
m_cdda->set_channel_volume(0,100.0 * (data / 64.0f));
m_cdda->set_channel_volume(0,100.0f * (data / 64.0f));
if(m_towns_volume_select == 5)
m_cdda->set_channel_volume(1,100.0 * (data / 64.0f));
m_cdda->set_channel_volume(1,100.0f * (data / 64.0f));
break;
case 3: // select channel
if(data < 8)

View File

@ -225,7 +225,7 @@ float mu100_state::lightlevel(const UINT8 *src, const UINT8 *render)
int bit = slot & 7;
int adr = (slot >> 3);
if(render[adr] & (1 << bit))
return 1-(1-(255-l)/255.0)*contrast;
return 1-(1-(255-l)/255.0f)*contrast;
return 0.95f;
}

View File

@ -900,15 +900,15 @@ void ti85_state::ti83pse_count( UINT8 timer, UINT8 data)
switch (timer)
{
case CRYSTAL_TIMER1:
m_crystal_timer1->adjust(attotime::zero, 0, attotime::from_hz( 32768.0/m_ctimer[timer].divsor));
m_crystal_timer1->adjust(attotime::zero, 0, attotime::from_hz( 32768.0f/m_ctimer[timer].divsor));
m_crystal_timer1->enable(true);
break;
case CRYSTAL_TIMER2:
m_crystal_timer2->adjust(attotime::zero, 0, attotime::from_hz( 32768.0/m_ctimer[timer].divsor));
m_crystal_timer2->adjust(attotime::zero, 0, attotime::from_hz( 32768.0f/m_ctimer[timer].divsor));
m_crystal_timer2->enable(true);
break;
case CRYSTAL_TIMER3:
m_crystal_timer3->adjust(attotime::zero, 0, attotime::from_hz( 32768.0/m_ctimer[timer].divsor));
m_crystal_timer3->adjust(attotime::zero, 0, attotime::from_hz( 32768.0f/m_ctimer[timer].divsor));
m_crystal_timer3->enable(true);
break;

View File

@ -1115,7 +1115,7 @@ static void render_editor(DView_edit *editor)
editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, NULL);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(width, 0.5);
maxwidth = MAX(width, 0.5f);
/* compute our bounds */
x1 = 0.5f - 0.5f * maxwidth;

View File

@ -110,10 +110,10 @@ public:
const render_texinfo &texinfo() const { return m_texinfo; }
render_texinfo &texinfo() { return m_texinfo; }
const HashT hash() const { return m_hash; }
const UINT32 flags() const { return m_flags; }
HashT hash() const { return m_hash; }
UINT32 flags() const { return m_flags; }
// FIXME:
const bool is_pixels_owned() const;
bool is_pixels_owned() const;
private:
Uint32 m_sdl_access;
@ -901,7 +901,7 @@ copy_info_t *texture_info::compute_size_type()
}
// FIXME:
const bool texture_info::is_pixels_owned() const
bool texture_info::is_pixels_owned() const
{ // do we own / allocated it ?
return ((m_sdl_access == SDL_TEXTUREACCESS_STATIC)
&& (m_copyinfo->blitter->m_is_passthrough));
@ -1079,8 +1079,8 @@ void quad_setup_data::compute(const render_primitive &prim, const int prescale)
fdudy = (texcoords->bl.u - texcoords->tl.u); // b a12
fdvdy = (texcoords->bl.v - texcoords->tl.v); // d a22
width = fabs(( fdudx * (float) (texwidth) + fdvdx * (float) (texheight)) ) * fscale;
height = fabs((fdudy * (float) (texwidth) + fdvdy * (float) (texheight)) ) * fscale;
width = fabsf(( fdudx * (float) (texwidth) + fdvdx * (float) (texheight)) ) * fscale;
height = fabsf((fdudy * (float) (texwidth) + fdvdy * (float) (texheight)) ) * fscale;
fdudx = signf(fdudx) / fscale;
fdvdy = signf(fdvdy) / fscale;

View File

@ -184,7 +184,7 @@ void sound_sdl::unlock_buffer(void)
void sound_sdl::att_memcpy(void *dest, const INT16 *data, int bytes_to_copy)
{
int level= (int) (pow(10.0, (float) attenuation / 20.0) * 128.0);
int level= (int) (pow(10.0, (double) attenuation / 20.0) * 128.0);
INT16 *d = (INT16 *) dest;
int count = bytes_to_copy/2;
while (count>0)

View File

@ -909,7 +909,7 @@ osd_dim sdl_window_info::pick_best_mode()
if (m_win_config.refresh)
size_score *= 1.0f / (1.0f + fabsf(m_win_config.refresh - mode.refresh_rate) / 10.0f);
osd_printf_verbose("%4dx%4d@%2d -> %f\n", (int)mode.w, (int)mode.h, (int) mode.refresh_rate, size_score);
osd_printf_verbose("%4dx%4d@%2d -> %f\n", (int)mode.w, (int)mode.h, (int) mode.refresh_rate, (double) size_score);
// best so far?
if (size_score > best_score)