From 59a3fae0780bc9cea48bf0150b230b96c79d8d48 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 25 Feb 2018 00:00:57 -0500 Subject: Attempt to fix some compiler warnings and errors recently introduced. --- src/Makefile | 4 ++-- src/termkey.patch | 3 ++- src/textadept.c | 16 ++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index 383a36f1..5e117964 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,7 +6,7 @@ ifeq (win, $(findstring win, $(MAKECMDGOALS))) # Cross-compile for Win32. CROSS = i686-w64-mingw32- CFLAGS = -mms-bitfields -Os - CXXFLAGS = -mms-bitfields -static-libgcc -static-libstdc++ -Os -std=g++0x + CXXFLAGS = -mms-bitfields -static-libgcc -static-libstdc++ -Os -std=gnu++0x LUA_CFLAGS = -DLUA_BUILD_AS_DLL -DLUA_LIB LDFLAGS = -Wl,--retain-symbols-file -Wl,lua.sym ifeq (, $(findstring curses, $(MAKECMDGOALS))) @@ -417,7 +417,7 @@ endif scintilla_tgz = scintilla373.tgz tre_zip = cdce45e8dd7a3b36954022b4a4d3570e1ac5a4f8.zip -scinterm_zip = a0a536a4fe7e.zip +scinterm_zip = 46e218082338.zip scintillua_zip = 53fb84d4d0ac.zip lua_tgz = lua-5.3.4.tar.gz lpeg_tgz = lpeg-1.0.0.tar.gz diff --git a/src/termkey.patch b/src/termkey.patch index 1a831637..fd97e2e5 100644 --- a/src/termkey.patch +++ b/src/termkey.patch @@ -155,7 +155,7 @@ diff -r 49c8684413c0 termkey-internal.h diff -r 49c8684413c0 termkey.c --- a/termkey.c Tue Dec 23 10:36:54 2014 -0500 +++ b/termkey.c Tue Dec 23 13:31:50 2014 -0500 -@@ -3,8 +3,12 @@ +@@ -3,8 +3,13 @@ #include #include @@ -164,6 +164,7 @@ diff -r 49c8684413c0 termkey.c #include +#else +#define ssize_t int ++#define strcasecmp _stricmp +#endif #include diff --git a/src/textadept.c b/src/textadept.c index 3be679b1..00c080a8 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -189,7 +189,7 @@ static int *match_case = &find_options[0], *whole_word = &find_options[1], static char *button_labels[4], *option_labels[4]; typedef char * ListStore; static ListStore find_store[10], repl_store[10]; -#define max(a, b) (((a) > (b)) ? (a) : (b)) +#define max_(a, b) (((a) > (b)) ? (a) : (b)) #define bind(k, d) (bindCDKObject(vENTRY, find_entry, k, entry_keypress, d), \ bindCDKObject(vENTRY, replace_entry, k, entry_keypress, d)) #define toggled(find_option) *find_option @@ -439,11 +439,11 @@ static int lfind_focus(lua_State *L) { if (findbox) return 0; // already active wresize(scintilla_get_window(focused_view), LINES - 4, COLS); findbox = initCDKScreen(newwin(2, 0, LINES - 3, 0)), eraseCDKScreen(findbox); - int b_width = max(strlen(button_labels[0]), strlen(button_labels[1])) + - max(strlen(button_labels[2]), strlen(button_labels[3])) + 3; - int o_width = max(strlen(option_labels[0]), strlen(option_labels[1])) + - max(strlen(option_labels[2]), strlen(option_labels[3])) + 3; - int l_width = max(strlen(flabel), strlen(rlabel)); + int b_width = max_(strlen(button_labels[0]), strlen(button_labels[1])) + + max_(strlen(button_labels[2]), strlen(button_labels[3])) + 3; + int o_width = max_(strlen(option_labels[0]), strlen(option_labels[1])) + + max_(strlen(option_labels[2]), strlen(option_labels[3])) + 3; + int l_width = max_(strlen(flabel), strlen(rlabel)); int e_width = COLS - o_width - b_width - l_width - 1; find_entry = newCDKEntry(findbox, l_width - strlen(flabel), TOP, NULL, flabel, A_NORMAL, '_', vMIXED, e_width, 0, 64, FALSE, FALSE); @@ -1692,14 +1692,14 @@ static void remove_views_from_pane(Pane *pane) { */ static void pane_resize(Pane *pane, int rows, int cols, int y, int x) { if (pane->type == VSPLIT) { - int ssize = pane->split_size * cols / max(pane->cols, 1); + int ssize = pane->split_size * cols / max_(pane->cols, 1); if (ssize < 1 || ssize >= cols - 1) ssize = (ssize < 1) ? 1 : cols - 2; pane->split_size = ssize; pane_resize(pane->child1, rows, ssize, y, x); pane_resize(pane->child2, rows, cols - ssize - 1, y, x + ssize + 1); wresize(pane->win, rows, 1), mvwin(pane->win, y, x + ssize); // split bar } else if (pane->type == HSPLIT) { - int ssize = pane->split_size * rows / max(pane->rows, 1); + int ssize = pane->split_size * rows / max_(pane->rows, 1); if (ssize < 1 || ssize >= rows - 1) ssize = (ssize < 1) ? 1 : rows - 2; pane->split_size = ssize; pane_resize(pane->child1, ssize, cols, y, x); -- cgit v1.2.3