Skip to content

Commit

Permalink
[DGFiP] Allow using -kN with N between 1 and 4 (useful for DGFiP test…
Browse files Browse the repository at this point in the history
…s) + some cleanup
  • Loading branch information
ddeclerck authored Feb 28, 2023
1 parent e84aa40 commit 7b8dec6
Show file tree
Hide file tree
Showing 471 changed files with 225 additions and 141 deletions.
4 changes: 2 additions & 2 deletions examples/dgfip_c/enchain_static.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ T_discord * err_NEGATIF(T_irdata *irdata)

double floor_g(double a)
{
if (fabs(a) <= LONG_MAX) {
if (fabs(a) <= (double)LONG_MAX) {
return floor(a);
} else {
return a;
Expand All @@ -315,7 +315,7 @@ double floor_g(double a)

double ceil_g(double a)
{
if (fabs(a) <= LONG_MAX) {
if (fabs(a) <= (double)LONG_MAX) {
return ceil(a);
} else {
return a;
Expand Down
58 changes: 49 additions & 9 deletions examples/dgfip_c/irdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
#include "conf.h"

#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include "var.h"

#define FALSE 0
#define TRUE 1

struct S_desc_var
{
char *nom;
Expand All @@ -16,24 +18,24 @@ struct S_desc_var

typedef struct S_desc_var T_desc_var;

static bool alloc_tab(double **tab, char **def_tab, int taille)
static int alloc_tab(double **tab, char **def_tab, int taille)
{
if ((tab == NULL) || (def_tab == NULL)) {
return false;
return FALSE;
}
if (taille > 0) {
*tab = (double *)malloc(taille * sizeof(double));
if (*tab == NULL) {
return false;
return FALSE;
}
*def_tab = (char *)malloc(taille * sizeof(char));
if (*def_tab == NULL) {
free(*tab);
*tab = NULL;
return false;
return FALSE;
}
}
return true;
return TRUE;
}

T_irdata * IRDATA_new_irdata(void)
Expand All @@ -49,15 +51,15 @@ T_irdata * IRDATA_new_irdata(void)
irdata->def_calculee = NULL;
irdata->base = NULL;
irdata->def_base = NULL;
if (alloc_tab(&irdata->saisie, &irdata->def_saisie, TAILLE_SAISIE) == false) {
if (alloc_tab(&irdata->saisie, &irdata->def_saisie, TAILLE_SAISIE) == FALSE) {
IRDATA_delete_irdata(irdata);
return NULL;
}
if (alloc_tab(&irdata->calculee, &irdata->def_calculee, TAILLE_CALCULEE) == false) {
if (alloc_tab(&irdata->calculee, &irdata->def_calculee, TAILLE_CALCULEE) == FALSE) {
IRDATA_delete_irdata(irdata);
return NULL;
}
if (alloc_tab(&irdata->base, &irdata->def_base, TAILLE_BASE) == false) {
if (alloc_tab(&irdata->base, &irdata->def_base, TAILLE_BASE) == FALSE) {
IRDATA_delete_irdata(irdata);
return NULL;
}
Expand Down Expand Up @@ -251,6 +253,44 @@ struct S_discord * IRDATA_range_tableau(T_irdata *irdata, T_var_irdata p_desc, i
return discord;
}

void IRDATA_efface(T_irdata *irdata, T_var_irdata p_desc)
{
T_desc_var *desc = (T_desc_var *)p_desc;
int indice = 0;
#ifdef FLG_COMPACT
indice = desc->indice;
irdata->valeurs[indice] = 0;
irdata->defs[indice] = 0;
#else
indice = desc->indice & INDICE_VAL;
if ((desc->indice & EST_MASQUE) != EST_SAISIE) {
return;
}
irdata->saisie[indice] = 0;
irdata->def_saisie[indice] = 0;
#endif /* FLG_COMPACT */
return;
}

void IRDATA_efface_tableau(T_irdata *irdata, T_var_irdata p_desc, int ind)
{
T_desc_var *desc = (T_desc_var *)p_desc;
int indice = 0;
#ifdef FLG_COMPACT
indice = desc->indice + ind;
irdata->valeurs[indice] = 0;
irdata->defs[indice] = 0;
#else
indice = (desc->indice & INDICE_VAL) + ind;
if ((desc->indice & EST_MASQUE) != EST_SAISIE) {
return;
}
irdata->saisie[indice] = 0;
irdata->def_saisie[indice] = 0;
#endif /* FLG_COMPACT */
return;
}

double * IRDATA_extrait_special(T_irdata *irdata, T_var_irdata p_desc)
{
T_desc_var *desc = (T_desc_var *)p_desc;
Expand Down
5 changes: 4 additions & 1 deletion examples/dgfip_c/irdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ extern void IRDATA_reset_erreur(T_irdata *irdata);

extern T_discord * IRDATA_range(T_irdata *irdata, T_var_irdata desc, double valeur);
extern void IRDATA_range_base(T_irdata *irdata, T_var_irdata desc, double valeur);
struct S_discord *IRDATA_range_tableau(T_irdata *irdata, T_var_irdata desc, int ind, double valeur);
struct S_discord * IRDATA_range_tableau(T_irdata *irdata, T_var_irdata desc, int ind, double valeur);

extern void IRDATA_efface(T_irdata *irdata, T_var_irdata desc);
extern void IRDATA_efface_tableau(T_irdata *irdata, T_var_irdata desc, int ind);

extern double * IRDATA_extrait_special (T_irdata *irdata, T_var_irdata desc);
double * IRDATA_extrait_tableau(T_irdata *irdata, T_var_irdata desc, int ind);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_104.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_105.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_11.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_116.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_127.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_129.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_139.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_147.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_157.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_165.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_17.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_172.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_173.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_190.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_197.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_203.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_210.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_211.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_223.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_233.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_234.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_239.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_255.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_260.m_test.tgv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_276.m_test.tgv
Binary file not shown.
Binary file modified examples/dgfip_c/ml_primitif/2020.expected/fuzzer_279.m_test.tgv
Binary file not shown.
Loading

0 comments on commit 7b8dec6

Please sign in to comment.