|
From: <sm...@us...> - 2009-03-19 12:10:18
|
Revision: 9757
http://plplot.svn.sourceforge.net/plplot/?rev=9757&view=rev
Author: smekal
Date: 2009-03-19 12:10:17 +0000 (Thu, 19 Mar 2009)
Log Message:
-----------
Borland C++ needs a '_' in front of a symbol. ltdl_win32 takes care of that automatically.
To get rid of Visual C++ warnings explicit type casts were added in pdfutils.c.
Modified Paths:
--------------
trunk/src/ltdl_win32.c
trunk/src/pdfutils.c
Modified: trunk/src/ltdl_win32.c
===================================================================
--- trunk/src/ltdl_win32.c 2009-03-19 12:08:53 UTC (rev 9756)
+++ trunk/src/ltdl_win32.c 2009-03-19 12:10:17 UTC (rev 9757)
@@ -89,9 +89,22 @@
/* load symbol from library */
void* lt_dlsym( lt_dlhandle dlhandle, const char* symbol )
{
- if( dlhandle->hinstLib )
+ if( dlhandle->hinstLib ) {
+#ifdef __BORLANDC__
+ unsigned int bufferLength = strlen(symbol)+2;
+ char* buffer = (char*)malloc(bufferLength);
+ void* retPointer;
+
+ buffer[0]='_';
+ strncpy( &buffer[1], symbol, bufferLength-2 );
+ buffer[bufferLength-1]='\0';
+ retPointer=GetProcAddress( dlhandle->hinstLib, buffer );
+ free(buffer);
+ return retPointer;
+#else
return GetProcAddress( dlhandle->hinstLib, symbol );
- else
+#endif
+ } else
return NULL;
}
Modified: trunk/src/pdfutils.c
===================================================================
--- trunk/src/pdfutils.c 2009-03-19 12:08:53 UTC (rev 9756)
+++ trunk/src/pdfutils.c 2009-03-19 12:10:17 UTC (rev 9757)
@@ -723,7 +723,8 @@
value = 0;
return (pdf_wr_4bytes(pdfs, value));
}
- fsgl = fdbl = f;
+ fdbl = f;
+ fsgl = (float)fdbl;
fmant = frexp(fdbl, &exp);
if (fmant < 0)
@@ -738,13 +739,13 @@
if (e_new < 1 - bias) {
e_off = e_new - (1 - bias);
e_ieee = 0;
- f_tmp = f_new * pow((double) 2.0, (double) e_off);
+ f_tmp = (float)(f_new * pow((double) 2.0, (double) e_off));
}
else {
e_ieee = e_new + bias;
- f_tmp = f_new - 1;
+ f_tmp = (float)(f_new - 1);
}
- f_ieee = f_tmp * 8388608; /* multiply by 2^23 */
+ f_ieee = (U_LONG)(f_tmp * 8388608); /* multiply by 2^23 */
if (e_ieee > 255) {
if (debug)
@@ -800,7 +801,7 @@
f_new = 1.0 + f_tmp;
}
- fsgl = f_new * pow(2.0, (double) exp);
+ fsgl = (float)(f_new * pow(2.0, (double) exp));
if (s_ieee == 1)
fsgl = -fsgl;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|