Skip to content

Commit

Permalink
Code style cleanups in elks/
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruchon committed Mar 9, 2020
1 parent d2464b5 commit ce98a14
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion elks/arch/i86/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int do_signal(void)
signr = 1;
mask = (sigset_t)1;
while (currentp->signal) {
while(!(currentp->signal & mask)) {
while (!(currentp->signal & mask)) {
signr++;
mask <<= 1;
}
Expand Down
2 changes: 1 addition & 1 deletion elks/arch/i86/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void mm_stat(seg_t start, seg_t end)

#ifndef CONFIG_ARCH_SIBO

if(pi == (char *) 0x40) {
if (pi == (char *) 0x40) {
printk("PC/%cT class machine, %s CPU\n%uK base RAM",
arch_cpu > 5 ? 'A' : 'X', proc_name, setupw(0x2a));
cp = proc_name;
Expand Down
8 changes: 4 additions & 4 deletions elks/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ static int lastumap;

#ifdef DEBUG_FREE_BH_COUNT
static int nr_free_bh = NR_BUFFERS;
#define DCR_COUNT(bh) if(!(--bh->b_count))nr_free_bh++
#define INR_COUNT(bh) if(!(bh->b_count++))nr_free_bh--
#define CLR_COUNT(bh) if(bh->b_count)nr_free_bh++
#define SET_COUNT(bh) if(--nr_free_bh < 0) { \
#define DCR_COUNT(bh) if (!(--bh->b_count))nr_free_bh++
#define INR_COUNT(bh) if (!(bh->b_count++))nr_free_bh--
#define CLR_COUNT(bh) if (bh->b_count)nr_free_bh++
#define SET_COUNT(bh) if (--nr_free_bh < 0) { \
printk("VFS: get_free_buffer: bad free buffer head count.\n"); \
nr_free_bh = 0; \
}
Expand Down
8 changes: 4 additions & 4 deletions elks/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ static struct wait_queue inode_wait;

#ifdef DEBUG_FREE_INODES_COUNT
static int nr_free_inodes = NR_INODE;
#define DCR_COUNT(i) if(!(--i->i_count))nr_free_inodes++
#define INR_COUNT(i) if(!(i->i_count++))nr_free_inodes--
#define CLR_COUNT(i) if(i->i_count)nr_free_inodes++
#define SET_COUNT(i) if(--nr_free_inodes < 0) { \
#define DCR_COUNT(i) if (!(--i->i_count)) nr_free_inodes++
#define INR_COUNT(i) if (!(i->i_count++)) nr_free_inodes--
#define CLR_COUNT(i) if (i->i_count) nr_free_inodes++
#define SET_COUNT(i) if (--nr_free_inodes < 0) { \
printk("VFS: get_empty_inode: bad free inode count.\n"); \
nr_free_inodes = 0; \
}
Expand Down
2 changes: 1 addition & 1 deletion elks/fs/msdos/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ unicode_to_ascii(char *ascii, unsigned char *uni)
{
char *op = ascii;

while(*uni && *uni!=0xff){
while (*uni && *uni!=0xff){
*op++ = *uni;
uni += 2;
}
Expand Down
2 changes: 1 addition & 1 deletion elks/fs/msdos/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct super_block *msdos_read_super(register struct super_block *s, char *data,
MSDOS_SB(s)->cluster_size = b->cluster_size;
MSDOS_SB(s)->fats = b->fats;
MSDOS_SB(s)->fat_start = b->reserved;
if(!b->fat_length && b->fat32_length){
if (!b->fat_length && b->fat32_length){
fat32 = 1;
MSDOS_SB(s)->fat_length = (unsigned short)b->fat32_length;
MSDOS_SB(s)->root_cluster = b->root_cluster;
Expand Down
2 changes: 1 addition & 1 deletion elks/fs/msdos/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static int msdos_find_long(struct inode *dir, const char *name, int len,
if ((len == entry_len) && compare(entry_name, msdos_name, len))
return 0;
}
} while(res != 0);
} while (res != 0);
if (*bh)
unmap_brelse(*bh);
*bh = NULL;
Expand Down
2 changes: 1 addition & 1 deletion elks/include/linuxmt/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern unsigned char __ctype[];

#define __CT(c) (__ctype[1+(unsigned char)c])

/* Note the '!!' is a cast to 'bool' and even BCC deletes it in an if() */
/* Note the '!!' is a cast to 'bool' and even BCC deletes it in an if () */
#define isalnum(c) (!!(__CT(c)&(__CT_u|__CT_l|__CT_d)))
#define isalpha(c) (!!(__CT(c)&(__CT_u|__CT_l)))
#define isascii(c) (!((c)&~0x7F))
Expand Down
2 changes: 1 addition & 1 deletion elks/tools/mfs/writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void cmd_ln(struct minix_fs_dat *fs,int argc,char **argv) {
}

static int ftype(const char *strtype) {
switch(strtype[0]) {
switch (strtype[0]) {
case 'c': return S_IFCHR;
case 'b': return S_IFBLK;
//case 'd': return S_IFDIR;
Expand Down
22 changes: 11 additions & 11 deletions elks/tools/objdump86/objdump86.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int main(int argc, char ** argv)
multiple_files = 0;
for (ar = 1; ar < argc; ar++)
{
if (argv[ar][0] == '-') switch(argv[ar][1])
if (argv[ar][0] == '-') switch (argv[ar][1])
{
case 's': display_mode = 1; break;
case 'n': display_mode = 2; break;
Expand Down Expand Up @@ -362,7 +362,7 @@ void do_module(char *fname, char *archive)
fseek(ifd, 0L, 0);
fetch_aout_hdr();

switch(display_mode)
switch (display_mode)
{
case 0: dump_aout(); break;
case 1: size_aout(); break;
Expand All @@ -374,7 +374,7 @@ void do_module(char *fname, char *archive)
fseek(ifd, 0L, 0);
fetch_v7_hdr();

switch(display_mode)
switch (display_mode)
{
case 0: dump_v7(); break;
case 1: size_v7(); break;
Expand All @@ -392,7 +392,7 @@ void do_module(char *fname, char *archive)

int error(char *str)
{
switch( display_mode)
switch (display_mode)
{
case 1: fprintf(stderr, "size: %s: %s\n", ifname, str); break;
case 2: fprintf(stderr, "nm: %s: %s\n", ifname, str); break;
Expand Down Expand Up @@ -556,7 +556,7 @@ int disp_syms(void)
printf(" ");
else
printf("%08lx ", offset);
switch(symtype)
switch (symtype)
{
case 0x004F: putchar('U'); break;
case 0x0000: putchar('t'); break;
Expand Down Expand Up @@ -605,9 +605,9 @@ static char * relstr[] = {"ERR", "DB", "DW", "DD"};

if (ch == 0) break;

switch( ch & 0xC0)
switch (ch & 0xC0)
{
case 0x00: switch(ch & 0xF0)
case 0x00: switch (ch & 0xF0)
{
case 0x00: /* Relocator size */
printf("RELSZ %d\n", relsize= (ch & 0xF));
Expand Down Expand Up @@ -670,7 +670,7 @@ break_break:;

long get_sized(int sz)
{
switch(sz)
switch (sz)
{
case 0: return 0;
case 1: return get_byte();
Expand Down Expand Up @@ -897,7 +897,7 @@ void nm_aout(void)
printf(" ");
else
printf("%08lx ", n_value);
switch(n_sclass)
switch (n_sclass)
{
case 0x01: printf("a "); break;
case 0x12: printf("T "); break;
Expand All @@ -912,14 +912,14 @@ void nm_aout(void)
}

printf("n_sclass=");
switch(n_sclass >> 3)
switch (n_sclass >> 3)
{
case 0: printf("C_NULL,"); break;
case 2: printf("C_EXT,"); break;
case 3: printf("C_STAT,"); break;
default: printf("%04o,", n_sclass & 0xF8);
}
switch(n_sclass & 7)
switch (n_sclass & 7)
{
case 0: printf("N_UNDF "); break;
case 1: printf("N_ABS "); break;
Expand Down

0 comments on commit ce98a14

Please sign in to comment.