summaryrefslogtreecommitdiff
path: root/lib/interne.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/interne.c')
-rw-r--r--lib/interne.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/interne.c b/lib/interne.c
index 642ce16..ea532cc 100644
--- a/lib/interne.c
+++ b/lib/interne.c
@@ -54,23 +54,24 @@ Uint32 ONE(void) { return (1); }
/* Met le bit 'position' à zéro */
void ResetBit(Uint32 * i, int position) {
+ int k;
+ Uint32 maxi = ZERO();
if (position < 0 || position > 31)
exception(1, _("ResetBit: Incorrect Value"));
else {
- int k;
- Uint32 VAL_MAX = ZERO();
+
for (k = 0; k < 32; k++)
- SetBit(&VAL_MAX, k);
- * i &= VAL_MAX - (ONE() << position);
+ SetBit(&maxi, k);
+ * i &= maxi - (ONE() << position);
}
}
/* Met le bit 'position' à un */
void SetBit(Uint32 * i, int position) {
+ Uint32 aux = ONE() << position;
if (position < 0 || position > 31)
exception(1, _("SetBit: Incorrect Value"));
else {
- Uint32 aux = ONE() << position;
* i |= aux;
}
}
@@ -91,15 +92,6 @@ int Neg(Uint32 a) {
return (ValeurBit(a, 31));
}
-/* Met le flag d'overflow à zéro */
-void SetOverflow(int * o) { * o = ONE(); }
-
-/* Met le flag d'overflow à un */
-void ResetOverflow(int * o) { * o = ZERO(); }
-
-/* Donne la valeur du flag d'overflow */
-int Overflow(int o) { return (o); }
-
/* Affiche tous les bits d'un mot */
void Uint32toBin(Uint32 i) {
int k;