Commit 7c2ba9fabbeb7106065245219972decc65f0e0d7

Thomas de Grivel 2022-05-12T11:00:40

static

diff --git a/Makefile b/Makefile
index 161d569..b6f24c1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,6 @@
-
 CFLAGS = -W -Wall -Werror -O0 -DDEBUG -ggdb
 CPPFLAGS = -I/usr/local/include -I/usr/local/lib/erlang24/usr/include
-LDFLAGS = -L/usr/local/lib -L/usr/local/lib/erlang24/usr/lib
+LDFLAGS = -L/usr/local/lib
 
 git_nif = bin/libgit_nif.so
 git_nif_SRC = c_src/git_nif.c
@@ -20,9 +19,6 @@ all: ${PROGS}
 ${git_nif}: ${git_nif_SRC_O}
 	${CC} -fPIC -shared ${LDFLAGS} ${git_nif_SRC_O} ${git_nif_LIBS} -o ${git_nif}
 
-${gitport}: ${gitport_SRC_O}
-	${CC} ${CFLAGS} ${LDFLAGS} ${gitport_SRC_O} ${gitport_LIBS} -o ${gitport}
-
 ${size}: ${size_SRC_O}
 	${CC} ${CFLAGS} ${LDFLAGS} ${size_SRC_O} ${size_LIBS} -o ${size}
 
diff --git a/c_src/git_nif.c b/c_src/git_nif.c
index d2a40a6..7fe07c9 100644
--- a/c_src/git_nif.c
+++ b/c_src/git_nif.c
@@ -1,9 +1,10 @@
-#include <erl_nif.h>
-#include <git2.h>
 #include <stdlib.h>
 #include <string.h>
 
-char * enif_term_to_string (ErlNifEnv *env, const ERL_NIF_TERM term)
+#include <erl_nif.h>
+#include <git2.h>
+
+static char * enif_term_to_string (ErlNifEnv *env, const ERL_NIF_TERM term)
 {
   ErlNifBinary bin;
   unsigned len;
@@ -26,7 +27,7 @@ char * enif_term_to_string (ErlNifEnv *env, const ERL_NIF_TERM term)
   }
 }
 
-ERL_NIF_TERM enif_string_to_term (ErlNifEnv *env, const char *str)
+static ERL_NIF_TERM enif_string_to_term (ErlNifEnv *env, const char *str)
 {
   size_t len = strlen(str);
   ErlNifBinary bin;
@@ -35,7 +36,7 @@ ERL_NIF_TERM enif_string_to_term (ErlNifEnv *env, const char *str)
   return enif_make_binary(env, &bin);
 }
 
-ERL_NIF_TERM push_string (ErlNifEnv *env, const char *str, const ERL_NIF_TERM acc)
+static ERL_NIF_TERM push_string (ErlNifEnv *env, const char *str, const ERL_NIF_TERM acc)
 {
   ERL_NIF_TERM term = enif_string_to_term(env, str);
   return enif_make_list_cell(env, term, acc);
@@ -123,9 +124,9 @@ static ERL_NIF_TERM content_nif (ErlNifEnv *env, int argc,
   return enif_make_atom(env, "error");
 }
 
-ERL_NIF_TERM git_tree_entry_file_map (ErlNifEnv *env,
-                                      const git_tree_entry *entry,
-                                      const char *name)
+static ERL_NIF_TERM git_tree_entry_file_map (ErlNifEnv *env,
+                                             const git_tree_entry *entry,
+                                             const char *name)
 {
   git_object_t type;
   git_filemode_t mode;