# HG changeset patch # User Jeffrey Connelly # Date 1186807239 0 # Node ID 138e9be2f9172b7c98594454f6e1350a319e3237 # Parent 7db556e97dd173e0bdc3243990ac7a3b8291661d Always use our own msim_round() instead of checking for C99's round and using it, for consistency. diff -r 7db556e97dd1 -r 138e9be2f917 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Sat Aug 11 04:38:52 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Sat Aug 11 04:40:39 2007 +0000 @@ -172,13 +172,12 @@ static void msim_lookup_user(MsimSession *session, const gchar *user, MSIM_USER_LOOKUP_CB cb, gpointer data); -#ifndef round -double round(double round); +double msim_round(double round); /* round is part of C99, but sometimes is unavailable before then. * Based on http://forums.belution.com/en/cpp/000/050/13.shtml */ -double round(double value) +double msim_round(double value) { if (value < 0) { return -(floor(-value + 0.5)); @@ -186,7 +185,6 @@ return floor( value + 0.5); } } -#endif /** * Load the plugin. @@ -842,7 +840,7 @@ size < sizeof(_font_scale) / sizeof(_font_scale[0]); ++size) { scale = _font_scale[CLAMP(size, 1, MAX_FONT_SIZE) - 1]; - this_point = (guint)round(scale * base); + this_point = (guint)msim_round(scale * base); if (this_point >= point) { purple_debug_info("msim", "msim_point_to_purple_size: %d pt -> size=%d\n", @@ -867,7 +865,7 @@ base = purple_account_get_int(session->account, "base_font_size", MSIM_BASE_FONT_POINT_SIZE); - point = (guint)round(scale * base); + point = (guint)msim_round(scale * base); purple_debug_info("msim", "msim_purple_size_to_point: size=%d -> %d pt\n", size, point); @@ -883,7 +881,7 @@ dpi = purple_account_get_int(session->account, "port", MSIM_DEFAULT_DPI); - return (guint)round((POINTS_PER_INCH * 1. / dpi) * height); + return (guint)msim_round((POINTS_PER_INCH * 1. / dpi) * height); /* See also: libpurple/protocols/bonjour/jabber.c * _font_size_ichat_to_purple */ @@ -897,7 +895,7 @@ dpi = purple_account_get_int(session->account, "port", MSIM_DEFAULT_DPI); - return (guint)round((dpi * 1. / POINTS_PER_INCH) * point); + return (guint)msim_round((dpi * 1. / POINTS_PER_INCH) * point); } /** Convert the msim markup (font) tag into HTML. */