[Pkg-octave-devel] Sundials
Rafael Laboissiere
rafael at debian.org
Thu Jun 8 15:42:43 UTC 2006
* Thomas Weber <thomas.weber.mail at gmail.com> [2006-06-08 14:20]:
> tested on an AMD64 (unstable chroot). I attach the build log.
Thanks for trying it so quickly.
I just realized that my patch does not work because I wrongly assumed
that the config.h was included. Please, try again with the patch
attached below.
> There is one warning in kinsol.c and you missed one warning in
> cvodea_io.c (sorry, I'm currently extremely busy, so I can't patch it
> myself).
I looked at the kinsol.c warning. I think it is a programming error in
the way the va_arg macro is used. My proposed patch is the following:
--- sundials-2.2.0.orig/kinsol/source/kinsol.c
+++ sundials-2.2.0/kinsol/source/kinsol.c
@@ -1737,7 +1737,7 @@
/* If info_code = PRNT_RETVAL, decode the numeric value */
- ret = (int) (va_arg(ap, int *));
+ ret = va_arg(ap, int);
switch(ret) {
case KIN_SUCCESS:
(The above is include in the attached patch.)
--
Rafael
-------------- next part --------------
--- sundials-2.2.0.orig/cvodes/include/cvodea.h
+++ sundials-2.2.0/cvodes/include/cvodea.h
@@ -44,6 +44,13 @@
#include "cvodes.h"
#include "sundials_nvector.h"
+#include "../../config.h"
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#else
+#define intptr_t unsigned int
+#endif
+
/*
* ===============================================================
* DEFINITIONS OF CVODEA INPUTS
--- sundials-2.2.0.orig/cvodes/source/cvodea_io.c
+++ sundials-2.2.0/cvodes/source/cvodea_io.c
@@ -422,8 +422,8 @@
while (ck_mem != NULL) {
- ckpnt[i].my_addr = (unsigned int) ck_mem;
- ckpnt[i].next_addr = (unsigned int) next_;
+ ckpnt[i].my_addr = (intptr_t) ck_mem;
+ ckpnt[i].next_addr = (intptr_t) next_;
ckpnt[i].t0 = t0_;
ckpnt[i].t1 = t1_;
ckpnt[i].nstep = nst_;
@@ -445,7 +445,7 @@
* Returns the address of the 'active' check point.
*/
-int CVadjGetCurrentCheckPoint(void *cvadj_mem, unsigned int *addr)
+int CVadjGetCurrentCheckPoint(void *cvadj_mem, intptr_t *addr)
{
CVadjMem ca_mem;
@@ -455,7 +455,7 @@
}
ca_mem = (CVadjMem) cvadj_mem;
- *addr = (unsigned int) ckpntData;
+ *addr = (intptr_t) ckpntData;
return(CV_SUCCESS);
}
--- sundials-2.2.0.orig/kinsol/source/kinsol.c
+++ sundials-2.2.0/kinsol/source/kinsol.c
@@ -1737,7 +1737,7 @@
/* If info_code = PRNT_RETVAL, decode the numeric value */
- ret = (int) (va_arg(ap, int *));
+ ret = va_arg(ap, int);
switch(ret) {
case KIN_SUCCESS:
More information about the Pkg-octave-devel
mailing list