summaryrefslogtreecommitdiff
path: root/lib/interne.c
diff options
context:
space:
mode:
authorPixel <>2001-04-17 04:05:52 +0000
committerPixel <>2001-04-17 04:05:52 +0000
commit5aed7634c8993e3366817c4b20fca1aa18eacf21 (patch)
treecfb6c00a13b8f213255ea231a3d814f61ab2964b /lib/interne.c
parent55f981c9fca048fba18d0538be4ed5dc1cc3fe11 (diff)
Indentation plus faible
Diffstat (limited to 'lib/interne.c')
-rw-r--r--lib/interne.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/interne.c b/lib/interne.c
index a8e1db5..9e59944 100644
--- a/lib/interne.c
+++ b/lib/interne.c
@@ -10,85 +10,85 @@
void Reset(Uint32 * i)
{ /* met tous les bits d'un mot à zéro */
- *i &= 0;
+ *i &= 0;
} /* Ok */
void Set(Uint32 * i)
{ /* met le bit de poids faible à 1 */
- *i &= 1;
+ *i &= 1;
} /* Ok */
/* Met le bit 'position' à zéro */
void ResetBit(Uint32 * i, int position)
{
- if (position < 0 || position > 31) {
- exception(1, _("ResetBit: Incorrect Value"));
- } else {
- Uint32 aux = VAL_MAX - (1 << position);
+ if (position < 0 || position > 31) {
+ exception(1, _("ResetBit: Incorrect Value"));
+ } else {
+ Uint32 aux = VAL_MAX - (1 << position);
- *i &= aux;
- }
+ *i &= aux;
+ }
} /* Ok */
/* Met le bit 'position' à un */
void SetBit(Uint32 * i, int position)
{
- if (position < 0 || position > 31) {
- exception(1, _("SetBit: Incorrect Value"));
- } else {
- Uint32 aux = 1 << position;
+ if (position < 0 || position > 31) {
+ exception(1, _("SetBit: Incorrect Value"));
+ } else {
+ Uint32 aux = 1 << position;
- *i |= aux;
- }
+ *i |= aux;
+ }
} /* Ok */
/* Donne la valeur du bit 'position' */
int ValeurBit(Uint32 nombre, int position)
{
- if (position < 0 || position > 31) {
- exception(1, _("ValeurBit: Incorrect Value"));
- return (-1);
- }
- return ((nombre >> position) & 1);
+ if (position < 0 || position > 31) {
+ exception(1, _("ValeurBit: Incorrect Value"));
+ return (-1);
+ }
+ return ((nombre >> position) & 1);
} /* Ok */
/* Affiche tous les bits d'un mot */
void Uint32toBin(Uint32 i)
{
- int k;
+ int k;
- for (k = 31; k >= 0; k--)
- printf("%d", ValeurBit(i, k));
- printf("\n");
+ for (k = 31; k >= 0; k--)
+ printf("%d", ValeurBit(i, k));
+ printf("\n");
} /* Ok */
/* Extrait un champ dans un mot */
Uint32 champ(Uint32 nombre, int taille)
{
- return (nombre & (taille - 1));
+ return (nombre & (taille - 1));
} /* Ok */
Uint32 Opcode(Uint32 ins)
{
- return (champ(ins >> 0, 256));
+ return (champ(ins >> 0, 256));
} /* Ok */
Uint32 Extension(Uint32 ins)
{
- return (champ(ins >> 8, 64));
+ return (champ(ins >> 8, 64));
} /* Ok */
Uint32 Champ1(Uint32 ins)
{
- return (champ(ins >> 14, 64));
+ return (champ(ins >> 14, 64));
} /* Ok */
Uint32 Champ2(Uint32 ins)
{
- return (champ(ins >> 20, 64));
+ return (champ(ins >> 20, 64));
} /* Ok */
Uint32 Champ3(Uint32 ins)
{
- return (champ(ins >> 26, 64));
+ return (champ(ins >> 26, 64));
} /* Ok */