From 2725e700b463f18baf925bcdb9b73c6b8bc74ca7 Mon Sep 17 00:00:00 2001 From: phintuka Date: Mon, 22 Sep 2008 10:24:53 +0000 Subject: Replaced exp10f with own implementation. exp10f is GNU extension and not available in OS X. (Reported by Tero Siironen) --- menuitems.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/menuitems.c b/menuitems.c index 719f221d..cd38a83e 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,12 +4,10 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c,v 1.11 2008-03-13 21:29:00 phintuka Exp $ + * $Id: menuitems.c,v 1.12 2008-09-22 10:24:53 phintuka Exp $ * */ -#include - #include "i18n.h" #include "menuitems.h" @@ -103,6 +101,13 @@ cMenuEditFpIntItem::cMenuEditFpIntItem(const char *Name, int *Value, int Min, in Set(); } +static int my_exp10(int x) +{ + int r = 1; + for (; x > 0; x--, r *= 10) ; + return r; +} + void cMenuEditFpIntItem::Set(void) { if(*value == 0 && *zeroString) @@ -112,7 +117,7 @@ void cMenuEditFpIntItem::Set(void) else if (maxString && *value == max) SetValue(maxString); else - SetValue(cString::sprintf("%1.1f", ((float)(*value)) / exp10f(decimals))); + SetValue(cString::sprintf("%1.1f", ((float)(*value)) / (float)my_exp10(decimals))); } // --- cMenuEditStraI18nItem ------------------------------------------------- -- cgit v1.2.3