mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-10 04:00:34 +02:00
optimization changes; makefile changes to make specifying CFLAGS less annoying; print completions reusably
This commit is contained in:
@@ -42,6 +42,7 @@ PROFILE_FLAGS = @PROFILE_FLAGS@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@
|
||||
STYLE_CFLAGS = @STYLE_CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
|
||||
|
||||
@@ -53,7 +54,7 @@ BASHINCDIR = ${topdir}/include
|
||||
INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib
|
||||
|
||||
CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) ${INCLUDES} $(CPPFLAGS) \
|
||||
$(LOCAL_CFLAGS) $(CFLAGS) ${ADDON_CFLAGS}
|
||||
$(STYLE_CFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) ${ADDON_CFLAGS}
|
||||
|
||||
# Here is a rule for making .o files from .c files that doesn't force
|
||||
# the type of the machine (like -sun3) into the flags.
|
||||
|
||||
@@ -38,6 +38,7 @@ PROFILE_FLAGS = @PROFILE_FLAGS@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@
|
||||
STYLE_CFLAGS = @STYLE_CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
@@ -56,7 +57,7 @@ LIBINTL_H = @LIBINTL_H@
|
||||
INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib $(INTL_INC)
|
||||
|
||||
CCFLAGS = ${PROFILE_FLAGS} ${INCLUDES} $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) \
|
||||
$(CFLAGS) $(MALLOC_CFLAGS) $(CPPFLAGS)
|
||||
$(CFLAGS) $(MALLOC_CFLAGS) $(STYLE_CFLAGS) $(CPPFLAGS)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CCFLAGS) -c $<
|
||||
|
||||
@@ -56,6 +56,7 @@ DEBUG = @DEBUG@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG}
|
||||
STYLE_CFLAGS = @STYLE_CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
@@ -65,7 +66,7 @@ LOCAL_DEFS = @LOCAL_DEFS@
|
||||
INCLUDES = -I. -I$(BUILD_DIR) -I$(topdir) -I$(topdir)/lib
|
||||
|
||||
CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(APP_CFLAGS) $(CPPFLAGS) ${INCLUDES} \
|
||||
$(LOCAL_CFLAGS) $(CFLAGS) ${ADDON_CFLAGS}
|
||||
$(STYLE_CFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) ${ADDON_CFLAGS}
|
||||
|
||||
.c.o:
|
||||
${RM} $@
|
||||
|
||||
+17
-8
@@ -888,25 +888,30 @@ rl_function_of_keyseq_len (const char *keyseq, size_t len, Keymap map, int *type
|
||||
int
|
||||
rl_trim_arg_from_keyseq (const char *keyseq, size_t len, Keymap map)
|
||||
{
|
||||
register int i, parsing_digits;
|
||||
register int i, j, parsing_digits;
|
||||
unsigned char ic;
|
||||
Keymap map0;
|
||||
|
||||
if (map == 0)
|
||||
map = _rl_keymap;
|
||||
map0 = map;
|
||||
|
||||
/* The digits following the initial one (e.g., the binding to digit-argument)
|
||||
or the optional `-' in a binding to digit-argument or universal-argument
|
||||
are not added to rl_executing_keyseq. This is basically everything read by
|
||||
rl_digit_loop. The parsing_digits logic is here in case they ever are. */
|
||||
for (i = parsing_digits = 0; keyseq && i < len; i++)
|
||||
for (i = j = parsing_digits = 0; keyseq && i < len; i++)
|
||||
{
|
||||
ic = keyseq[i];
|
||||
|
||||
if (parsing_digits)
|
||||
{
|
||||
if (_rl_digit_p (ic) == 0)
|
||||
return (i);
|
||||
continue;
|
||||
if (_rl_digit_p (ic))
|
||||
{
|
||||
j = i + 1;
|
||||
continue;
|
||||
}
|
||||
parsing_digits = 0;
|
||||
}
|
||||
|
||||
if (map[ic].type == ISKMAP)
|
||||
@@ -918,13 +923,18 @@ rl_trim_arg_from_keyseq (const char *keyseq, size_t len, Keymap map)
|
||||
}
|
||||
if (map[ic].type == ISFUNC)
|
||||
{
|
||||
#if defined (VI_MODE)
|
||||
if (map[ic].function != rl_digit_argument && map[ic].function != rl_universal_argument && map[ic].function != rl_vi_arg_digit)
|
||||
#else
|
||||
if (map[ic].function != rl_digit_argument && map[ic].function != rl_universal_argument)
|
||||
return -1;
|
||||
#endif
|
||||
return (j);
|
||||
|
||||
/* We don't bother with a keyseq that is only a numeric argument */
|
||||
if (i + 1 == len)
|
||||
return -1;
|
||||
|
||||
map = map0;
|
||||
parsing_digits = 1;
|
||||
|
||||
/* This logic should be identical to rl_digit_loop */
|
||||
@@ -934,13 +944,12 @@ rl_trim_arg_from_keyseq (const char *keyseq, size_t len, Keymap map)
|
||||
{
|
||||
i++;
|
||||
parsing_digits = 2;
|
||||
continue;
|
||||
}
|
||||
if (map[ic].function == rl_digit_argument && ic == '-')
|
||||
{
|
||||
parsing_digits = 2;
|
||||
continue;
|
||||
}
|
||||
j = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -57,6 +57,7 @@ SHELL = @MAKE_SHELL@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG}
|
||||
STYLE_CFLAGS = @STYLE_CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
|
||||
|
||||
@@ -68,7 +69,7 @@ LOCAL_DEFS = @LOCAL_DEFS@
|
||||
INCLUDES = -I. -I../.. -I$(topdir) -I$(topdir)/lib -I$(BASHINCDIR) -I$(srcdir) $(INTL_INC)
|
||||
|
||||
CCFLAGS = ${ADDON_CFLAGS} ${PROFILE_FLAGS} ${INCLUDES} $(DEFS) $(LOCAL_DEFS) \
|
||||
$(LOCAL_CFLAGS) $(CFLAGS) $(CPPFLAGS)
|
||||
$(LOCAL_CFLAGS) $(STYLE_CFLAGS) $(CFLAGS) $(CPPFLAGS)
|
||||
|
||||
GCC_LINT_FLAGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \
|
||||
-Wcast-align -Wstrict-prototypes -Wconversion \
|
||||
|
||||
+4
-6
@@ -47,7 +47,7 @@
|
||||
#define _to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc))
|
||||
|
||||
#if !defined (HANDLE_MULTIBYTE)
|
||||
# define cval(s, i) ((s)[(i)])
|
||||
# define cval(s, i, l) ((s)[(i)])
|
||||
# define iswalnum(c) (isalnum(c))
|
||||
# define TOGGLE(x) (ISUPPER (x) ? tolower ((unsigned char)x) : (TOUPPER (x)))
|
||||
#else
|
||||
@@ -75,18 +75,16 @@ extern char *substring PARAMS((char *, int, int));
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
static wchar_t
|
||||
cval (s, i)
|
||||
cval (s, i, l)
|
||||
char *s;
|
||||
int i;
|
||||
int i, l;
|
||||
{
|
||||
size_t tmp;
|
||||
wchar_t wc;
|
||||
int l;
|
||||
mbstate_t mps;
|
||||
|
||||
if (MB_CUR_MAX == 1 || is_basic (s[i]))
|
||||
return ((wchar_t)s[i]);
|
||||
l = strlen (s);
|
||||
if (i >= (l - 1))
|
||||
return ((wchar_t)s[i]);
|
||||
memset (&mps, 0, sizeof (mbstate_t));
|
||||
@@ -143,7 +141,7 @@ sh_modcase (string, pat, flags)
|
||||
inword = 0;
|
||||
while (start < end)
|
||||
{
|
||||
wc = cval ((char *)string, start);
|
||||
wc = cval ((char *)string, start, end);
|
||||
|
||||
if (iswalnum (wc) == 0)
|
||||
inword = 0;
|
||||
|
||||
@@ -42,6 +42,7 @@ PROFILE_FLAGS = @PROFILE_FLAGS@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@
|
||||
STYLE_CFLAGS = @STYLE_CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@
|
||||
|
||||
@@ -53,7 +54,7 @@ BASHINCDIR = ${topdir}/include
|
||||
INCLUDES = -I. -I../.. -I$(topdir) -I${BASHINCDIR} -I$(topdir)/lib
|
||||
|
||||
CCFLAGS = ${ASAN_CFLAGS} $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) \
|
||||
${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
|
||||
${INCLUDES} $(STYLE_CFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CCFLAGS) $<
|
||||
|
||||
Reference in New Issue
Block a user