Bug 100778 - math.h on Solaris does not have atan2f and ceilf
Summary: math.h on Solaris does not have atan2f and ceilf
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-04 00:29 UTC by Silas De Munck
Modified: 2005-03-04 18:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Silas De Munck 2005-03-04 00:29:15 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Solaris

Solution (Solaris 2.8):

atan2f -> atan2 (atan2f uses floats, atan2 doubles)

@@ -320,7 +320,7 @@
         return;
 
     // compute angle relative to indicator (note coord transformation)
-    float angle = 0.5 + 0.5 * atan2f( -xPos, -yPos ) / M_PI;
+    float angle = 0.5 + 0.5 * atan2( -xPos, -yPos ) / M_PI;
     int pageIndex = (int)( angle * ( m_frames.count() - 1 ) + 0.5 );
 
     // go to selected page
================

ceilf -> ceil (ceilf uses floats, ceil uses doubles)

@@ -1480,7 +1480,7 @@
         // Here we find out column's width and row's height to compute a table
         // so we can place widgets 'centered in virtual cells'.
         int nCols = Settings::viewColumns(),
-            nRows = (int)ceilf( (float)pageCount / (float)nCols ),
+            nRows = (int)ceil( (float)pageCount / (float)nCols ),
             * colWidth = new int[ nCols ],
             * rowHeight = new int[ nRows ],
             cIdx = 0,
Comment 1 Albert Astals Cid 2005-03-04 18:25:06 UTC
CVS commit by aacid: 

Fix compile on Solaris. Thanks for notyfiyng, sadly is too late for KDE 3.4.0, will come with KDE 3.4.1
BUGS: 100778


  M +1 -1      pageview.cpp   1.44.2.2
  M +1 -1      presentationwidget.cpp   1.22.2.1


--- kdegraphics/kpdf/ui/pageview.cpp  #1.44.2.1:1.44.2.2
@@ -1498,5 +1498,5 @@ void PageView::slotRelayoutPages()
         // so we can place widgets 'centered in virtual cells'.
         int nCols = Settings::viewColumns(),
-            nRows = (int)ceilf( (float)pageCount / (float)nCols ),
+            nRows = (int)ceil( (float)pageCount / (float)nCols ),
             * colWidth = new int[ nCols ],
             * rowHeight = new int[ nRows ],

--- kdegraphics/kpdf/ui/presentationwidget.cpp  #1.22:1.22.2.1
@@ -321,5 +321,5 @@ void PresentationWidget::overlayClick( c
 
     // compute angle relative to indicator (note coord transformation)
-    float angle = 0.5 + 0.5 * atan2f( -xPos, -yPos ) / M_PI;
+    float angle = 0.5 + 0.5 * atan2( -xPos, -yPos ) / M_PI;
     int pageIndex = (int)( angle * ( m_frames.count() - 1 ) + 0.5 );