]> git-server-git.apps.pok.os.sepia.ceph.com Git - jerasure.git/commitdiff
make galois_init_default_field(int w) extern
authorLoic Dachary <loic@dachary.org>
Tue, 8 Apr 2014 22:05:18 +0000 (00:05 +0200)
committerLoic Dachary <loic@dachary.org>
Tue, 8 Apr 2014 22:05:18 +0000 (00:05 +0200)
So that the application can initialize gfp_array and gfp_is_composite
instead of relying on initialization happening implicitly when the
multiply or xor functions are called. The init function can be called
once when the application guarantees thread safety. And the multiply and
xor functions can be called from multiple threads without risking races.

Signed-off-by: Loic Dachary <loic@dachary.org>
include/galois.h
src/galois.c

index 4a2715e58877fd0ef517b85dae3acf412da1ac4b..9d815ab509bc524abbbfd25a4b6bb7092bbf2ed7 100644 (file)
@@ -46,6 +46,7 @@
 extern "C" {
 #endif
 
+extern void galois_init_default_field(int w);
 extern void galois_change_technique(gf_t *gf, int w);
 
 extern int galois_single_multiply(int a, int b, int w);
index 398a64944f797d33909e313225195a1ce3d75f67..5d4282e0b3274fdc6743d6f4388a6c2387bae151 100644 (file)
@@ -168,7 +168,7 @@ gf_t* galois_init_composite_field(int w,
   return gfp;
 }
 
-static void galois_init_default_field(int w)
+void galois_init_default_field(int w)
 {
   if (w <= 0 || w > 32) {
     fprintf(stderr, "ERROR -- cannot init default Galois field for w=%d\n", w);