Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

piplib, polylib: VALUE_TO_INT definitions

1 view
Skip to first unread message

Uday Kumar Reddy

unread,
Aug 8, 2010, 8:40:38 PM8/8/10
to piplib-de...@googlegroups.com, loec...@icps.u-strasbg.fr, Sven Verdoolaege
This is with the git versions of piplib and polylib.

When both polylib and piplib header files are included from a source,

.....
../piplib-1.4.0/include/piplib/piplib.h:44:1: warning: "VALUE_TO_INT" redefined
....
../polylib-5.22.5/include/polylib/arithmetique.h:138:1: warning: this
is the location of the previous definition

I assume these definitions need not be exposed to users. If they have
to be there for other reasons, can one of them be renamed?
VALUE_TO_INT -> PIPLIB_VALUE_TO_INT.

Thanks,
Uday

Sven Verdoolaege

unread,
Aug 9, 2010, 1:14:57 AM8/9/10
to Uday Kumar Reddy, piplib-de...@googlegroups.com, loec...@icps.u-strasbg.fr

Does this help?

skimo

diff --git a/include/piplib/piplib.h b/include/piplib/piplib.h
index 0123c47..aa54b8b 100644
--- a/include/piplib/piplib.h
+++ b/include/piplib/piplib.h
@@ -41,7 +41,7 @@
# define VAL_UN 1LL
# define VAL_ZERO 0LL

-#define VALUE_TO_INT(val) ((int)(val))
+#define ENTIER_TO_INT(val) ((int)(val))
#define ENTIER_TO_DOUBLE(val) ((double)(val))

#elif defined(LINEAR_VALUE_IS_INT)
@@ -51,7 +51,7 @@
# define VAL_UN 1L
# define VAL_ZERO 0L

-#define VALUE_TO_INT(val) ((int)(val))
+#define ENTIER_TO_INT(val) ((int)(val))
#define ENTIER_TO_DOUBLE(val) ((double)(val))

#elif defined(LINEAR_VALUE_IS_MP)
@@ -61,7 +61,7 @@
# define FORMAT "%d"
# define GMP_INPUT_FORMAT "%lZd"

-#define VALUE_TO_INT(val) ((int)mpz_get_si(val))
+#define ENTIER_TO_INT(val) ((int)mpz_get_si(val))
#define ENTIER_TO_DOUBLE(val) (mpz_get_d(val))

#endif
diff --git a/source/sol.c b/source/sol.c
index 584c387..16dac6d 100644
--- a/source/sol.c
+++ b/source/sol.c
@@ -540,7 +540,7 @@ PipVector * sol_vector_edit(int *i, int Bg, int Urs_p, int flags)
exit(1) ;
}
p = sol_space + (*i) ;
- n = VALUE_TO_INT(p->param1);
+ n = ENTIER_TO_INT(p->param1);
if (flags & SOL_REMOVE)
--n;
n -= Urs_p;
@@ -627,7 +627,7 @@ PipNewparm * sol_newparm_edit(int *i, int Bg, int Urs_p, int flags)
exit(1) ;
}
newparm->vector = sol_vector_edit(i, Bg, Urs_p, flags);
- newparm->rank = VALUE_TO_INT(p->param1);
+ newparm->rank = ENTIER_TO_INT(p->param1);
/* On met p a jour pour lire le denominateur (un Val de param2 UN). */
p = sol_space + (*i) ;
entier_init_set(newparm->deno, p->param1);

Uday Kumar Reddy

unread,
Aug 9, 2010, 1:19:58 AM8/9/10
to sk...@kotnet.org, piplib-de...@googlegroups.com, loec...@icps.u-strasbg.fr
Yes, this helps.
Reply all
Reply to author
Forward
0 new messages