From ae4d3b60c49975c3203bfd0d73a276e286ece9c3 Mon Sep 17 00:00:00 2001
From: Luigi Scarso <luigi.scarso@gmail.com>
Date: Wed, 14 Feb 2018 14:07:54 +0000
Subject: [PATCH] code clean up

---
 source/texk/web2c/luatexdir/font/mapfile.h           |  2 +-
 source/texk/web2c/luatexdir/font/mapfile.w           |  4 ++--
 source/texk/web2c/luatexdir/font/writettf.w          |  6 +++---
 source/texk/web2c/luatexdir/lua/lepdflib.cc          |  2 +-
 .../texk/web2c/luatexdir/luasocket/src/lua_preload.c | 12 ++++++++++++
 source/texk/web2c/luatexdir/luatex.c                 |  2 +-
 source/texk/web2c/luatexdir/luatex_svnversion.h      |  2 +-
 source/texk/web2c/mplibdir/mpmathdecimal.w           |  1 -
 8 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/source/texk/web2c/luatexdir/font/mapfile.h b/source/texk/web2c/luatexdir/font/mapfile.h
index 928a0e919..ad752af74 100644
--- a/source/texk/web2c/luatexdir/font/mapfile.h
+++ b/source/texk/web2c/luatexdir/font/mapfile.h
@@ -110,7 +110,7 @@ void fm_free(void);
 ff_entry *check_ff_exist(char *, boolean);
 void pdfmapfile(int);
 void pdfmapline(int);
-void pdf_init_map_file(char *map_name);
+void pdf_init_map_file(const char *map_name);
 fm_entry *new_fm_entry(void);
 void delete_fm_entry(fm_entry *);
 int avl_do_entry(fm_entry *, int);
diff --git a/source/texk/web2c/luatexdir/font/mapfile.w b/source/texk/web2c/luatexdir/font/mapfile.w
index 9460dac5a..f47c5b504 100644
--- a/source/texk/web2c/luatexdir/font/mapfile.w
+++ b/source/texk/web2c/luatexdir/font/mapfile.w
@@ -613,13 +613,13 @@ void pdfmapline(int t)
     free(s);
 }
 
-void pdf_init_map_file(char *map_name)
+void pdf_init_map_file(const char *map_name)
 {
     assert(mitem == NULL);
     mitem = xtalloc(1, mapitem);
     mitem->mode = FM_DUPIGNORE;
     mitem->type = MAPFILE;
-    mitem->line = map_name;
+    mitem->line = xstrdup(map_name);
 }
 
 /**********************************************************************/
diff --git a/source/texk/web2c/luatexdir/font/writettf.w b/source/texk/web2c/luatexdir/font/writettf.w
index 2a13b8899..4a016cbe4 100644
--- a/source/texk/web2c/luatexdir/font/writettf.w
+++ b/source/texk/web2c/luatexdir/font/writettf.w
@@ -539,10 +539,10 @@ static void ttf_copy_encoding(void)
     int i, *q;
     void **aa;
     char **glyph_names;
-    long *charcodes;
-    static char buf[SMALL_BUF_SIZE];
+    /*long *charcodes;*/
+    /*static char buf[SMALL_BUF_SIZE];*/
     struct avl_traverser t;
-    ttfenc_entry *e = ttfenc_tab;
+    /*ttfenc_entry *e = ttfenc_tab;*/
 
     assert(fd_cur->tx_tree != NULL);    /* this must be set in |create_fontdictionary| */
 
diff --git a/source/texk/web2c/luatexdir/lua/lepdflib.cc b/source/texk/web2c/luatexdir/lua/lepdflib.cc
index 0bc34909f..a16bf3bd4 100644
--- a/source/texk/web2c/luatexdir/lua/lepdflib.cc
+++ b/source/texk/web2c/luatexdir/lua/lepdflib.cc
@@ -1665,7 +1665,7 @@ static int m_Object_initCmd(lua_State * L)
     if (uin->pd != NULL && uin->pd->pc != uin->pc)
         pdfdoc_changed_error(L);
     s = luaL_checkstring(L, 2);
-    *((Object *) uin->d) = Object(objCmd, CHARP_CAST s);
+    *((Object *) uin->d) = Object(objCmd, s);
     return 0;
 }
 
diff --git a/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c b/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c
index b30f9a805..e9433dfdb 100644
--- a/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c
+++ b/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c
@@ -3,6 +3,18 @@
 #include "lua.h"
 #include "lauxlib.h"
 
+int luatex_mbox_lua_open(lua_State*);
+int luatex_headers_lua_open(lua_State*);
+int luatex_socket_lua_open(lua_State*);
+int luatex_ltn12_lua_open(lua_State*);
+int luatex_mime_lua_open(lua_State*);
+int luatex_url_lua_open(lua_State*);
+int luatex_tp_lua_open(lua_State*);
+int luatex_smtp_lua_open(lua_State*);
+int luatex_http_lua_open(lua_State*);
+int luatex_ftp_lua_open(lua_State*);
+
+
 #include "ftp_lua.c"
 #include "headers_lua.c" 
 #include "http_lua.c"
diff --git a/source/texk/web2c/luatexdir/luatex.c b/source/texk/web2c/luatexdir/luatex.c
index 5e9e61b91..1c8694987 100644
--- a/source/texk/web2c/luatexdir/luatex.c
+++ b/source/texk/web2c/luatexdir/luatex.c
@@ -198,7 +198,7 @@ void init_start_time(void) {
             just use its abstract interface.
         */
         char *source_date_epoch = kpse_var_value("SOURCE_DATE_EPOCH");
-        if (source_date_epoch && source_date_epoch != '\0' ) {
+        if (source_date_epoch) {
             errno = 0;
             epoch = strtoull(source_date_epoch, &endptr, 10);
             if (*endptr != '\0' || errno != 0) {
diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h
index 3b575dee5..6aa479105 100644
--- a/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1 +1 @@
-#define luatex_svn_revision 6587
+#define luatex_svn_revision 6602
diff --git a/source/texk/web2c/mplibdir/mpmathdecimal.w b/source/texk/web2c/mplibdir/mpmathdecimal.w
index 6503b8320..c07e6ede8 100644
--- a/source/texk/web2c/mplibdir/mpmathdecimal.w
+++ b/source/texk/web2c/mplibdir/mpmathdecimal.w
@@ -582,7 +582,6 @@ void mp_decimal_set_precision (MP mp) {
 }
 
 void mp_free_decimal_math (MP mp) {
-  int i;
   free_number (((math_data *)mp->math)->three_sixty_deg_t);
   free_number (((math_data *)mp->math)->one_eighty_deg_t);
   free_number (((math_data *)mp->math)->fraction_one_t);
-- 
GitLab