Revert some changes to work around ORCA/C issues that have been addressed.

Most of these are trailing commas in enums. There are also a couple preprocessor bug workarounds that are no longer necessary.

As of this version, ORCA/C 2.2.0 B2 or later should be used to compile hush.
This commit is contained in:
Stephen Heumann 2017-12-31 16:27:45 -06:00
parent 99224d3946
commit d610c572f2
10 changed files with 20 additions and 20 deletions

View File

@ -37,7 +37,7 @@ that expect a Bourne-type shell in that location).
Building
--------
To build it, you also need ORCA/C 2.1.x and plenty of memory (8MB is enough).
To build it, you also need ORCA/C 2.2.x and plenty of memory (8MB is enough).
You also need to have a copy of the ltermcap library from GNO 2.0.4 installed
as `/usr/lib/libtermcap.204` (the GNO 2.0.6 version is broken and won't work).
Run `make` or (if the source files don't have correct filetypes) `make build`.

View File

@ -73,7 +73,7 @@ int echo_main(int argc UNUSED_PARAM, char **argv)
#if !ENABLE_FEATURE_FANCY_ECHO
enum {
eflag = '\\',
nflag = 1 /* 1 -- print '\n' */
nflag = 1, /* 1 -- print '\n' */
};
argv++;

View File

@ -382,7 +382,7 @@ enum {
ACTION_DEPTHFIRST = (1 << 3),
/*ACTION_REVERSE = (1 << 4), - unused */
ACTION_QUIET = (1 << 5),
ACTION_DANGLING_OK = (1 << 6)
ACTION_DANGLING_OK = (1 << 6),
};
typedef uint8_t recurse_flags_t;
extern int recursive_action(const char *fileName, unsigned flags,
@ -684,7 +684,7 @@ void fputc_printable(int ch, FILE *file) FAST_FUNC;
* Buffer must hold at least four characters. */
enum {
VISIBLE_ENDLINE = 1 << 0,
VISIBLE_SHOW_TABS = 1 << 1
VISIBLE_SHOW_TABS = 1 << 1,
};
void visible(unsigned ch, char *buf, int flags) FAST_FUNC;
@ -974,7 +974,7 @@ enum {
DAEMON_DEVNULL_STDIO = 2,
DAEMON_CLOSE_EXTRA_FDS = 4,
DAEMON_ONLY_SANITIZE = 8, /* internal use */
DAEMON_DOUBLE_FORK = 16 /* double fork to avoid controlling tty */
DAEMON_DOUBLE_FORK = 16, /* double fork to avoid controlling tty */
};
#if BB_MMU
# define fork_or_rexec(argv) xfork()
@ -1435,7 +1435,7 @@ enum {
USERNAME_COMPLETION = 4 * ENABLE_FEATURE_USERNAME_COMPLETION,
VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI,
WITH_PATH_LOOKUP = 0x10,
FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION
FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION,
};
line_input_t *new_line_input_t(int flags) FAST_FUNC;
/* So far static: void free_line_input_t(line_input_t *n) FAST_FUNC; */

View File

@ -44,9 +44,6 @@
# define __const const
#endif
/* used by unit test machinery to run registration functions before calling main() */
#define INIT_FUNC __attribute__ ((constructor))
#define UNUSED_PARAM __attribute__ ((__unused__))
#define NORETURN __attribute__ ((__noreturn__))
/* "The malloc attribute is used to tell the compiler that a function
@ -84,6 +81,9 @@
# define UNUSED_PARAM_RESULT
#endif
/* used by unit test machinery to run registration functions before calling main() */
#define INIT_FUNC __attribute__ ((constructor))
/* -fwhole-program makes all symbols local. The attribute externally_visible
* forces a symbol global. */
#if __GNUC_PREREQ(4,1)

View File

@ -15,7 +15,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
enum {
UNICODE_UNKNOWN = 0,
UNICODE_OFF = 1,
UNICODE_ON = 2
UNICODE_ON = 2,
};
#define unicode_bidi_isrtl(wc) 0
@ -56,7 +56,7 @@ size_t FAST_FUNC unicode_strlen(const char *string);
/* Width on terminal */
size_t FAST_FUNC unicode_strwidth(const char *string);
enum {
UNI_FLAG_PAD = (1 << 0)
UNI_FLAG_PAD = (1 << 0),
};
//UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src);
//UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags);

View File

@ -312,7 +312,7 @@ const char *opt_complementary;
enum {
PARAM_STRING,
PARAM_LIST,
PARAM_INT
PARAM_INT,
};
typedef struct {

View File

@ -845,7 +845,7 @@ static NOINLINE unsigned complete_username(const char *ud)
enum {
FIND_EXE_ONLY = 0,
FIND_DIR_ONLY = 1,
FIND_FILE_ONLY = 2
FIND_FILE_ONLY = 2,
};
#ifndef __GNO__

View File

@ -466,7 +466,7 @@ enum {
EXP_FLAG_GLOB = 0x2,
/* Protect newly added chars against globbing
* by prepending \ to *, ?, [, \ */
EXP_FLAG_ESC_GLOB_CHARS = 0x1
EXP_FLAG_ESC_GLOB_CHARS = 0x1,
};
enum {
MAYBE_ASSIGNMENT = 0,
@ -546,7 +546,7 @@ typedef enum redir_type {
/* otherwise, rd_fd is redirected to rd_dup */
HEREDOC_SKIPTABS = 1,
HEREDOC_QUOTED = 2
HEREDOC_QUOTED = 2,
} redir_type;
@ -619,7 +619,7 @@ typedef enum pipe_style {
PIPE_SEQ = 1,
PIPE_AND = 2,
PIPE_OR = 3,
PIPE_BG = 4
PIPE_BG = 4,
} pipe_style;
/* Is there anything in this pipe at all? */
#define IS_NULL_PIPE(pi) \
@ -678,7 +678,7 @@ struct variable {
enum {
BC_BREAK = 1,
BC_CONTINUE = 2
BC_CONTINUE = 2,
};
#if ENABLE_HUSH_FUNCTIONS
@ -7937,7 +7937,7 @@ static int run_list(struct pipe *pi)
}
}
last_followup = pi->followup;
IF_HAS_KEYWORDS(last_rword = rword); /* ; outside to avoid ORCA/C bug */
IF_HAS_KEYWORDS(last_rword = rword;)
#if ENABLE_HUSH_IF
if (cond_code) {
if (rword == RES_THEN) {

View File

@ -11,7 +11,7 @@ enum {
SCAN_MOVE_FROM_LEFT = (1 << 0),
SCAN_MOVE_FROM_RIGHT = (1 << 1),
SCAN_MATCH_LEFT_HALF = (1 << 2),
SCAN_MATCH_RIGHT_HALF = (1 << 3)
SCAN_MATCH_RIGHT_HALF = (1 << 3),
};
char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags);

View File

@ -48,7 +48,7 @@ next_random(random_t *rnd)
enum {
a = 2,
b = 7,
c = 3
c = 3,
};
uint32_t t;