Anonymous avatar Anonymous committed 83f8a2d

get rid of warnings, add .hgignore

Comments (0)

Files changed (3)

+syntax regex
+.*~
+^c_src/.*.o
+^.eunit/.*
+^ebin/.*.beam
+^priv/efnv_drv.so
 static ErlDrvData init(ErlDrvPort port, char *cmd);
 static void stop(ErlDrvData handle);
 static void outputv(ErlDrvData handle, ErlIOVec *ev);
-static void send_hash(ErlDrvPort port, unsigned long hash);
 
 static ErlDrvData init(ErlDrvPort port, char *cmd) {
   return (ErlDrvData) port;
   ErlDrvPort port = (ErlDrvPort) handle;
   ErlDrvTermData caller;
   SysIOVec *bin;
-  int i, n, index = 0;
+  int i, index = 0;
   unsigned long hash;
   unsigned long seed;
   //first piece of the iovec is the seed
 
 static int control(ErlDrvData data, unsigned int seed, char *buf, int len, char **rbuf, int rlen) {
   unsigned int hash;
-  int index = 0;
   // printf("length %d\n", len);
   // printf("buf %s\n", buf);
   hash = fnv_hash(buf, len, seed);
   return sizeof(hash);
 }
 
-static void send_hash(ErlDrvPort port, unsigned long hash) {
-  ei_x_buff x;
-  ei_x_new_with_version(&x);
-  ei_x_encode_ulong(&x, hash);
-  driver_output(port, x.buff, x.index);
-  // printf("sent hash %d\n", hash);
-  ei_x_free(&x);
-}
 
 static ErlDrvEntry efnv_driver_entry = {
     NULL,                             /* init */
 hash(Thing) ->
   hash(Thing, ?SEED).
 
-% hash(Thing, Seed) when is_list(Thing) -> %assume io_list
-%   P = get_or_open(),
-%   port_command(P, [term_to_binary(Seed)] ++ Thing),
-%   recv(P);
-
 hash(Thing, Seed) when is_binary(Thing) ->
   P = get_or_open(),
   convert(port_control(P, Seed, Thing));
-  % recv(P);
 
 hash(Thing, Seed) ->
   P = get_or_open(),
   convert(port_control(P, Seed, term_to_binary(Thing))).
-  % recv(P).
 
 %%====================================================================
 %% Internal functions
   Dir = filename:join([filename:dirname(code:which(?MODULE)), "..", "priv"]),
   erl_ddll:load(Dir, "efnv_drv").
 
-recv(P) ->
-  receive
-    {P, {data, Bin}} -> binary_to_term(Bin);
-    V -> V
-  end.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.