Skip to content

Commit

Permalink
change all #define<TAB> to #define<SPACE>
Browse files Browse the repository at this point in the history
The string '#define' is 7 positions long. For the standard tab
length of 8, that makes #define<TAB>something visually identical
to #define<SPACE>something. This gets annoying when using a
nonstandard tab length, as the two variants were mixed randomly.
This commit fixes it by changing all those tabs to spaces.
  • Loading branch information
McDutchie committed Dec 10, 2024
1 parent b456bc9 commit 3ecc539
Show file tree
Hide file tree
Showing 45 changed files with 184 additions and 184 deletions.
10 changes: 5 additions & 5 deletions src/cmd/ksh93/bltins/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
#include "terminal.h"
#include "edit.h"

#define R_FLAG 1 /* raw mode */
#define R_FLAG 1 /* raw mode */
#if !SHOPT_SCRIPTONLY
#define S_FLAG 2 /* save in history file */
#define S_FLAG 2 /* save in history file */
#endif
#define A_FLAG 4 /* read into array */
#define A_FLAG 4 /* read into array */
#define N_FLAG 8 /* fixed size read at most */
#define NN_FLAG 0x10 /* fixed size read exact */
#define V_FLAG 0x20 /* use default value */
#define C_FLAG 0x40 /* read into compound variable */
#define C_FLAG 0x40 /* read into compound variable */
#define D_FLAG 8 /* must be number of bits for all flags */
#define SS_FLAG 0x80 /* read .csv format file */
#define SS_FLAG 0x80 /* read .csv format file */

struct read_save
{
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/bltins/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# define isasock(f,p) (0)
#endif

#define permission(a,f) (sh_access(a,f)==0)
#define permission(a,f) (sh_access(a,f)==0)
static int test_time(const char*, const char*);
static int test_stat(const char*, struct stat*);
static int test_mode(const char*);
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/ksh93/data/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include "jobs.h"
#include "FEATURE/cmds"
#include "FEATURE/poll"
#define bltin(x) (b_##x)
#define bltin(x) (b_##x)
/* The following is for builtins that do not accept -- options */
#define Bltin(x) (B_##x)
#define Bltin(x) (B_##x)

#ifndef SHOPT_CMDLIB_DIR
# define SHOPT_CMDLIB_DIR SH_CMDLIB_DIR
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/edit/edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static char *erase_eos; /* erase to end of screen */
#define DFLTWINDOW 80 /* default window width */
#define RAWMODE 1
#define ECHOMODE 3
#define SYSERR -1
#define SYSERR -1

static int keytrap(Edit_t *,char*, int, int, int);

Expand Down
10 changes: 5 additions & 5 deletions src/cmd/ksh93/edit/emacs.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ typedef struct _emacs_
Edit_t *ed; /* pointer to edit data */
} Emacs_t;

#define editb (*ep->ed)
#define editb (*ep->ed)
#define eol editb.e_eol
#define cur editb.e_cur
#define hline editb.e_hline
Expand Down Expand Up @@ -1490,10 +1490,10 @@ static void search(Emacs_t* ep,genchar *out,int direction)

static void draw(Emacs_t *ep,Draw_t option)
{
#define NORMAL ' '
#define LOWER '<'
#define BOTH '*'
#define UPPER '>'
#define NORMAL ' '
#define LOWER '<'
#define BOTH '*'
#define UPPER '>'

genchar *sptr; /* Pointer within screen */
genchar nscreen[2*MAXLINE]; /* New entire screen */
Expand Down
38 changes: 19 additions & 19 deletions src/cmd/ksh93/edit/vi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# define NTICKS 5 /* number of ticks for typeahead */
#endif /* FIORDCHK */

#define MAXCHAR MAXLINE-2 /* max char per line */
#define MAXCHAR MAXLINE-2 /* max char per line */

#if SHOPT_MULTIBYTE
# include "lexstates.h"
Expand Down Expand Up @@ -134,7 +134,7 @@ typedef struct _vi_
#define cur_phys editb.e_pcur /* current phys column cursor is at */
#define curhline editb.e_hline /* current history line */
#define first_virt editb.e_fcol /* first allowable column */
#define globals editb.e_globals /* local global variables */
#define globals editb.e_globals /* local global variables */
#define histmin editb.e_hismin
#define histmax editb.e_hismax
#define last_phys editb.e_peol /* last column in physical */
Expand All @@ -151,26 +151,26 @@ typedef struct _vi_
#define usrlnext editb.e_lnext /* user defined next literal */
#define usrkill editb.e_kill /* user defined kill char */
#define virtual editb.e_inbuf /* pointer to virtual image buffer */
#define window editb.e_window /* window buffer */
#define w_size editb.e_wsize /* window size */
#define inmacro editb.e_inmacro /* true when in macro */
#define window editb.e_window /* window buffer */
#define w_size editb.e_wsize /* window size */
#define inmacro editb.e_inmacro /* true when in macro */
#define yankbuf editb.e_killbuf /* yank/delete buffer */


#define ABORT -2 /* user abort */
#define APPEND -10 /* append chars */
#define BAD -1 /* failure flag */
#define BIGVI -15 /* user wants real vi */
#define CONTROL -20 /* control mode */
#define ENTER -25 /* enter flag */
#define GOOD 0 /* success flag */
#define INPUT -30 /* input mode */
#define INSERT -35 /* insert mode */
#define REPLACE -40 /* replace chars */
#define SEARCH -45 /* search flag */
#define TRANSLATE -50 /* translate virt to phys only */

#define INVALID (-1) /* invalid column */
#define ABORT -2 /* user abort */
#define APPEND -10 /* append chars */
#define BAD -1 /* failure flag */
#define BIGVI -15 /* user wants real vi */
#define CONTROL -20 /* control mode */
#define ENTER -25 /* enter flag */
#define GOOD 0 /* success flag */
#define INPUT -30 /* input mode */
#define INSERT -35 /* insert mode */
#define REPLACE -40 /* replace chars */
#define SEARCH -45 /* search flag */
#define TRANSLATE -50 /* translate virt to phys only */

#define INVALID (-1) /* invalid column */

static const char paren_chars[] = "([{)]}"; /* for % command */

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/argnod.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct argnod
#define ARG_RAW 0x1 /* string needs no processing */
#define ARG_MAKE 0x2 /* bit set during argument expansion */
#define ARG_MAC 0x4 /* string needs macro expansion */
#define ARG_EXP 0x8 /* string needs file expansion */
#define ARG_EXP 0x8 /* string needs file expansion */
#define ARG_ASSIGN 0x10 /* argument is an assignment */
#define ARG_QUOTED 0x20 /* word contained quote characters */
#define ARG_MESSAGE 0x40 /* contains international string */
Expand Down
20 changes: 10 additions & 10 deletions src/cmd/ksh93/include/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#define Empty ((char*)(e_sptbnl+3))
#define AltEmpty ((char*)(e_dot+1)) /* alternative pointer to empty string */

#define env_change() (++ast.env_serial)
#define env_change() (++ast.env_serial)

extern char* sh_getenv(const char*);
extern char* sh_setenviron(const char*);
Expand All @@ -70,7 +70,7 @@ extern char* sh_setenviron(const char*);

#include "shtable.h"

#define NIL(type) NULL /* for backward compatibility */
#define NIL(type) NULL /* for backward compatibility */

#define exitset() (sh.savexit=sh.exitval)

Expand Down Expand Up @@ -188,16 +188,16 @@ extern char *sh_getcwd(void);

#define sh_state(x) ( 1<<(x))
#if SHOPT_SCRIPTONLY
#define sh_isstate(x) ( (x)==SH_INTERACTIVE || (x)==SH_HISTORY ? 0 : (sh.st.states&sh_state(x)) )
#define sh_onstate(x) ( (x)==SH_INTERACTIVE || (x)==SH_HISTORY ? 0 : (sh.st.states |= sh_state(x)) )
#define sh_offstate(x) ( (x)==SH_INTERACTIVE || (x)==SH_HISTORY ? 0 : (sh.st.states &= ~sh_state(x)) )
#define sh_isstate(x) ( (x)==SH_INTERACTIVE || (x)==SH_HISTORY ? 0 : (sh.st.states&sh_state(x)) )
#define sh_onstate(x) ( (x)==SH_INTERACTIVE || (x)==SH_HISTORY ? 0 : (sh.st.states |= sh_state(x)) )
#define sh_offstate(x) ( (x)==SH_INTERACTIVE || (x)==SH_HISTORY ? 0 : (sh.st.states &= ~sh_state(x)) )
#else
#define sh_isstate(x) (sh.st.states&sh_state(x))
#define sh_onstate(x) (sh.st.states |= sh_state(x))
#define sh_offstate(x) (sh.st.states &= ~sh_state(x))
#define sh_isstate(x) (sh.st.states&sh_state(x))
#define sh_onstate(x) (sh.st.states |= sh_state(x))
#define sh_offstate(x) (sh.st.states &= ~sh_state(x))
#endif /* SHOPT_SCRIPTONLY */
#define sh_getstate() (sh.st.states)
#define sh_setstate(x) (sh.st.states = (x))
#define sh_getstate() (sh.st.states)
#define sh_setstate(x) (sh.st.states = (x))

#define sh_sigcheck() do { if(sh.trapnote & SH_SIGSET) sh_exit(SH_EXITSIG); } while(0)

Expand Down
30 changes: 15 additions & 15 deletions src/cmd/ksh93/include/edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ typedef struct edit
#define FAST 2
#define SLOW 1
#define ESC cntl('[')
#define UEOF -2 /* user eof char synonym */
#define UINTR -3 /* user intr char synonym */
#define UERASE -4 /* user erase char synonym */
#define UKILL -5 /* user kill char synonym */
#define UWERASE -6 /* user word erase char synonym */
#define ULNEXT -7 /* user next literal char synonym */
#define UEOF -2 /* user eof char synonym */
#define UINTR -3 /* user intr char synonym */
#define UERASE -4 /* user erase char synonym */
#define UKILL -5 /* user kill char synonym */
#define UWERASE -6 /* user word erase char synonym */
#define ULNEXT -7 /* user next literal char synonym */

#if ( 'a' == 97) /* ASCII? */
# define cntl(x) (x&037)
Expand Down Expand Up @@ -186,26 +186,26 @@ extern const char e_runvi[];

/* flags */

#define HIST_EVENT 0x1 /* event designator seen */
#define HIST_EVENT 0x1 /* event designator seen */
#define HIST_QUESTION 0x2 /* question mark event designator */
#define HIST_HASH 0x4 /* hash event designator */
#define HIST_HASH 0x4 /* hash event designator */
#define HIST_WORDDSGN 0x8 /* word designator seen */
#define HIST_QUICKSUBST 0x10 /* quick substitution designator seen */
#define HIST_SUBSTITUTE 0x20 /* for substitution loop */
#define HIST_NEWLINE 0x40 /* newline in squashed white space */
#define HIST_NEWLINE 0x40 /* newline in squashed white space */

/* modifier flags */

#define HIST_PRINT 0x100 /* print new command */
#define HIST_QUOTE 0x200 /* quote resulting history line */
#define HIST_QUOTE_BR 0x400 /* quote every word on space break */
#define HIST_GLOBALSUBST 0x800 /* apply substitution globally */
#define HIST_PRINT 0x100 /* print new command */
#define HIST_QUOTE 0x200 /* quote resulting history line */
#define HIST_QUOTE_BR 0x400 /* quote every word on space break */
#define HIST_GLOBALSUBST 0x800 /* apply substitution globally */

#define HIST_ERROR 0x1000 /* an error occurred */
#define HIST_ERROR 0x1000 /* an error occurred */

/* flags to be returned */

#define HIST_FLAG_RETURN_MASK (HIST_EVENT|HIST_PRINT|HIST_ERROR)
#define HIST_FLAG_RETURN_MASK (HIST_EVENT|HIST_PRINT|HIST_ERROR)

extern void hist_setchars(char *);
extern int hist_expand(const char *, char **);
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/ksh93/include/fcin.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ typedef struct _fcin
#endif
#define fcfile() (_Fcin._fcfile)
#define fcgetc() (*_Fcin.fcptr++ ? (int)_Fcin.fcptr[-1] : fcfill())
#define fcget() ((int)(*_Fcin.fcptr++))
#define fcpeek(n) ((int)_Fcin.fcptr[n])
#define fcseek(n) ((char*)(_Fcin.fcptr+=(n)))
#define fcget() ((int)(*_Fcin.fcptr++))
#define fcpeek(n) ((int)_Fcin.fcptr[n])
#define fcseek(n) ((char*)(_Fcin.fcptr+=(n)))
#define fcfirst() ((char*)_Fcin.fcbuff)
#define fclast() ((char*)_Fcin.fclast)
#define fcleft() (_Fcin.fclast-_Fcin.fcptr)
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/ksh93/include/history.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ typedef struct
extern const char hist_fname[];

extern int _Hist;
#define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
#define hist_max(hp) ((int)((hp)->histind))
#define hist_min(hp) ((_Hist=((int)((hp)->histind-(hp)->histsize)))>=0?_Hist:0)
#define hist_max(hp) ((int)((hp)->histind))
/* these are the history interface routines */
extern int sh_histinit(void);
extern void hist_cancel(History_t*);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/name.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct Ufunction
#define nv_isref(n) (nv_isattr((n),NV_REF|NV_TAGGED|NV_FUNCT)==NV_REF)
#define is_abuiltin(n) (nv_isattr(n,NV_BLTIN|NV_INTEGER)==NV_BLTIN)
#define is_afunction(n) (nv_isattr(n,NV_FUNCTION|NV_REF)==NV_FUNCTION)
#define nv_funtree(n) (((struct Ufunction*)(n)->nvalue)->ptree)
#define nv_funtree(n) (((struct Ufunction*)(n)->nvalue)->ptree)

/* NAMNOD MACROS */
/* ... for attributes */
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/nval.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ struct Namval
/* The following are operations for nv_putsub() */
#define ARRAY_BITS 22
#define ARRAY_ADD (1L<<ARRAY_BITS) /* add subscript if not found */
#define ARRAY_SCAN (2L<<ARRAY_BITS) /* For ${array[@]} */
#define ARRAY_SCAN (2L<<ARRAY_BITS) /* For ${array[@]} */
#define ARRAY_UNDEF (4L<<ARRAY_BITS) /* For ${array} */


Expand Down
30 changes: 15 additions & 15 deletions src/cmd/ksh93/include/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef struct Shell_s Shell_t;
#include <shcmd.h>

/* get pointer to a built-in command's entry function */
#define funptr(n) ((Shbltin_f)(n)->nvalue)
#define funptr(n) ((Shbltin_f)(n)->nvalue)

typedef void (*Shinit_f)(Shell_t*, int);
#ifndef SH_wait_f_defined
Expand All @@ -69,8 +69,8 @@ typedef union Shnode_u Shnode_t;
* See also shell options below. States 0-5 are also used as shell options.
*/
#define SH_NOFORK 0 /* set when fork not necessary */
#define SH_FORKED 7 /* set when process has been forked */
#define SH_PROFILE 8 /* set when processing profiles */
#define SH_FORKED 7 /* set when process has been forked */
#define SH_PROFILE 8 /* set when processing profiles */
#define SH_NOALIAS 9 /* do not expand non-exported aliases */
#define SH_NOTRACK 10 /* set to disable sftrack() function */
#define SH_STOPOK 11 /* set for stopable builtins */
Expand All @@ -79,8 +79,8 @@ typedef union Shnode_u Shnode_t;
#define SH_DEFPATH 14 /* set when using default path */
#define SH_INIT 15 /* set when initializing the shell */
#define SH_TTYWAIT 16 /* waiting for keyboard input */
#define SH_FCOMPLETE 17 /* set for filename completion */
#define SH_PREINIT 18 /* set with SH_INIT before parsing options */
#define SH_FCOMPLETE 17 /* set for filename completion */
#define SH_PREINIT 18 /* set with SH_INIT before parsing options */
#define SH_COMPLETE 19 /* set for command completion */
#define SH_XARG 21 /* set while in xarg (command -x) mode */
#define SH_NOTILDEXP 22 /* set to disable tilde expansion */
Expand All @@ -95,13 +95,13 @@ typedef union Shnode_u Shnode_t;
*/
#define SH_CFLAG 0
#define SH_HISTORY 1 /* used also as a state */
#define SH_ERREXIT 2 /* used also as a state */
#define SH_VERBOSE 3 /* used also as a state */
#define SH_ERREXIT 2 /* used also as a state */
#define SH_VERBOSE 3 /* used also as a state */
#define SH_MONITOR 4 /* used also as a state */
#define SH_INTERACTIVE 5 /* used also as a state */
#define SH_RESTRICTED 6
#define SH_XTRACE 7
#define SH_KEYWORD 8
#define SH_INTERACTIVE 5 /* used also as a state */
#define SH_RESTRICTED 6
#define SH_XTRACE 7
#define SH_KEYWORD 8
#define SH_NOUNSET 9
#define SH_NOGLOB 10
#define SH_ALLEXPORT 11
Expand All @@ -114,10 +114,10 @@ typedef union Shnode_u Shnode_t;
#define SH_VI 17
#define SH_VIRAW 18
#endif
#define SH_TFLAG 19
#define SH_TFLAG 19
#define SH_TRACKALL 20
#define SH_SFLAG 21
#define SH_NOEXEC 22
#define SH_SFLAG 21
#define SH_NOEXEC 22
#if !_BLD_ksh || SHOPT_ESH || SHOPT_VSH
#define SH_NOARROWSRCH 23
#endif
Expand Down Expand Up @@ -486,7 +486,7 @@ extern int sh_exec(const Shnode_t*,int);
* sh_getinterp() is here for compatibility with the documented interface.
*/
extern Shell_t sh;
#define sh_getinterp() (&sh)
#define sh_getinterp() (&sh)

#define chdir(a) sh_chdir(a)
#define fchdir(a) sh_fchdir(a)
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/ksh93/include/shlex.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ typedef struct _shlex_
/* additional parser flag, others in <shell.h> */
#define SH_EMPTY 04
#define SH_NOIO 010
#define SH_ASSIGN 020
#define SH_FUNDEF 040
#define SH_ASSIGN 020
#define SH_FUNDEF 040
#define SH_ARRAY 0100
#define SH_SEMI 0200 /* semicolon after NL ok */

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/shnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define TFOR 11
#define TSELECT (TFOR|COMSCAN)
#define TARITH 12
#define TTIME 13
#define TTIME 13
#define TSETIO 14
#define TFUN 15
#if SHOPT_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern void sh_save_rand_seed(struct rand *, int);

/* The following defines must be kept synchronous with shtab_variables[] in data/variables.c */

#define PATHNOD (sh.bltin_nodes)
#define PATHNOD (sh.bltin_nodes)
#define PS1NOD (sh.bltin_nodes+1)
#define PS2NOD (sh.bltin_nodes+2)
#define IFSNOD (sh.bltin_nodes+3)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/expand.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "io.h"
#include "path.h"

#define argbegin argnxt.cp
#define argbegin argnxt.cp
static const char *sufstr;
static int suflen;
static int scantree(Dt_t*,const char*, struct argnod**);
Expand Down
Loading

0 comments on commit 3ecc539

Please sign in to comment.