From 0a07b8dab4d207dc2f72f2e1c01fa806c6ef3ba7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?FEL=C5=A0=C3=96CI=20Marek?= <marek.felsoci@inria.fr>
Date: Mon, 6 Nov 2023 00:27:18 +0100
Subject: [PATCH] Remove useless definitions

---
 include/main.h | 11 -----------
 include/util.h |  4 ----
 src/main.c     | 12 ------------
 src/util.c     | 38 ++++++++++++++------------------------
 4 files changed, 14 insertions(+), 51 deletions(-)

diff --git a/include/main.h b/include/main.h
index 884788d..0b4422d 100644
--- a/include/main.h
+++ b/include/main.h
@@ -1,16 +1,5 @@
 #pragma once
 #include "config.h"
-
-/* ================================================================================= */
-/*! \brief  Flag allowing unique global data declaration
-
-  \sa  ___TEST_FEMBEM___ */
-#ifdef ___TEST_FEMBEM___
-#define _EXTERN_TEST_FEMBEM_
-#else
-#define _EXTERN_TEST_FEMBEM_ extern
-#endif
-/* ================================================================================= */
 #include <math.h>
 #include <complex.h>
 #include "hmat/hmat.h"
diff --git a/include/util.h b/include/util.h
index a135ef9..f3b9efe 100644
--- a/include/util.h
+++ b/include/util.h
@@ -28,16 +28,12 @@
 #include <ctype.h>
 #include <limits.h>
 #include <float.h>
-#include <stdbool.h>
-
-typedef enum { MPF_FALSE, MPF_TRUE } Logical;
 
 struct mpf_hmat_create_compression_args_t {
   int method;
   double threshold;
   const void * output;
 };
-int hmat_get_sync_exec(void) ;
 
 #if !(defined (_WIN32)) /* It's a UNIX system, I know this ! */
 /* Try to detect a debugger. This relies on the fact that GDB and IDB
diff --git a/src/main.c b/src/main.c
index 7bd3e77..be84883 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,24 +1,12 @@
-#define ___TEST_FEMBEM___ 1
-
 #include "main.h"
 
 hmat_interface_t * interface = NULL;
 double epsilon = 1e-3;
 hmat_progress_t progress;
-
-// instantiation of globales defined in main.h
 int nbRHS = 1;
 int sparseRHS;
 int nbPts = 16000;
 void *rhs = NULL;
-void *solFMMfar = NULL;
-void *solCLAfar = NULL;
-void *solFMMnear = NULL;
-void *solCLAnear = NULL;
-int nbPtsPerLeaf = 50;
-int nbAlgoRuns = 1;
-char *sTYPE_ELEMENT_ARRAY_test_fembem[] = {NULL};
-int coupled = 0;
 double lambda;
 
 void update_progress(hmat_progress_t * ctx) {
diff --git a/src/util.c b/src/util.c
index fce4c96..933abf9 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,11 +1,5 @@
 #include "main.h"
 
-/*! \brief Logical to redirect error and warning messages toward stdout (used in SYS/SRC/error.c) */
-Logical MPF_errorStreamIsStdout = MPF_FALSE ;
-
-/* MPF_errorStreamIsStdout sert a renvoyer les messages d'erreur dans stdout */
-#define MPF_errorStream ((MPF_errorStreamIsStdout)?(stdout):(stderr))
-
 /* ================================================================================== */
 /*! \brief Displays an error message with the location of this error in the source code
 
@@ -24,10 +18,10 @@ int MpfError(int line,char *package,char *file,const char *function, int number,
   va_start (args,number) ;
   message = va_arg(args, char *) ;
 
-  fprintf(MPF_errorStream,"[-] ERROR ");
+  fprintf(stderr,"[-] ERROR ");
 
   if (strcmp("-",function))
-    fprintf(MPF_errorStream,"in %30s() ",function) ;
+    fprintf(stderr,"in %30s() ",function) ;
 
   /* Cherche tous les "/src/" dans __FILE__, et si j'en trouve, j'affiche seulement a partir du dernier "src/..." */
   pos=file ;
@@ -37,14 +31,14 @@ int MpfError(int line,char *package,char *file,const char *function, int number,
 
   if (line != -1) {
     if (!package)
-      fprintf(MPF_errorStream,"([%s,%d] : ", pos, line) ;
+      fprintf(stderr,"([%s,%d] : ", pos, line) ;
     else
-      fprintf(MPF_errorStream,"[%s : %s,%d] : ",package,pos,line) ;
+      fprintf(stderr,"[%s : %s,%d] : ",package,pos,line) ;
   }
   if (message)
-    vfprintf(MPF_errorStream, message, args);
-  fprintf(MPF_errorStream,"\n");
-  fflush(MPF_errorStream);
+    vfprintf(stderr, message, args);
+  fprintf(stderr,"\n");
+  fflush(stderr);
 
   va_end(args);
 
@@ -68,10 +62,10 @@ int MpfWarning(int line,char *package,char *file,const char *function,int number
   va_start (args,number) ;
   message = va_arg(args, char *) ;
 
-  fprintf(MPF_errorStream,"[-] WARNING ");
+  fprintf(stderr,"[-] WARNING ");
 
   if (strcmp("-",function))
-    fprintf(MPF_errorStream,"in %30s() ",function) ;
+    fprintf(stderr,"in %30s() ",function) ;
 
   /* Cherche tous les "/src/" dans __FILE__, et si j'en trouve, j'affiche seulement a partir du dernier "src/..." */
   pos=file ;
@@ -81,14 +75,14 @@ int MpfWarning(int line,char *package,char *file,const char *function,int number
 
   if (line != -1) {
     if (!package)
-      fprintf(MPF_errorStream,"([%s,%d] : ", pos, line) ;
+      fprintf(stderr,"([%s,%d] : ", pos, line) ;
     else
-      fprintf(MPF_errorStream,"[%s : %s,%d] : ",package,pos,line) ;
+      fprintf(stderr,"[%s : %s,%d] : ",package,pos,line) ;
   }
   if (message)
-    vfprintf(MPF_errorStream, message, args);
-  fprintf(MPF_errorStream,"\n");
-  fflush(MPF_errorStream);
+    vfprintf(stderr, message, args);
+  fprintf(stderr,"\n");
+  fflush(stderr);
 
   va_end(args);
 
@@ -464,8 +458,4 @@ double time_in_s(Time t) {
 double time_interval_in_seconds(Time t1, Time t2) {
   Time interval = time_interval(t1, t2);
   return time_in_s(interval);
-}
-/* ================================================================================== */
-int hmat_get_sync_exec(void) {
-  return 1;
 }
\ No newline at end of file
-- 
GitLab