aboutsummaryrefslogtreecommitdiffstats
path: root/dos
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-05-03 17:32:15 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-05-03 17:32:15 -0700
commit28eecd8965aedbd75727fb0797a2e7033d5c54ee (patch)
tree1cac9ffc5f7fe7fd82d59b4accd7b8cf85762f74 /dos
parentf8c463722022008c8412a69f90576d2bf38818ed (diff)
downloadsyslinux-devel-28eecd8965aedbd75727fb0797a2e7033d5c54ee.tar.gz
syslinux-devel-28eecd8965aedbd75727fb0797a2e7033d5c54ee.tar.xz
syslinux-devel-28eecd8965aedbd75727fb0797a2e7033d5c54ee.zip
Across-the-board stealth whitespace cleanup
Diffstat (limited to 'dos')
-rw-r--r--dos/Makefile3
-rw-r--r--dos/__divdi3.c2
-rw-r--r--dos/__udivmoddi4.c2
-rw-r--r--dos/argv.c7
-rw-r--r--dos/atou.c1
-rw-r--r--dos/conio.c2
-rw-r--r--dos/crt0.S6
-rw-r--r--dos/malloc.c8
-rw-r--r--dos/perror.c1
-rw-r--r--dos/printf.c45
-rw-r--r--dos/skipatou.c2
-rw-r--r--dos/stdio.h1
-rw-r--r--dos/syslinux.c23
13 files changed, 47 insertions, 56 deletions
diff --git a/dos/Makefile b/dos/Makefile
index 7da22fe6..57edfcd0 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -55,6 +55,3 @@ syslinux.com: syslinux.elf
$(CC) $(CFLAGS) -D__ASSEMBLY__ -S -o $@ $<
-include .*.d
-
-
-
diff --git a/dos/__divdi3.c b/dos/__divdi3.c
index be13caed..3641396f 100644
--- a/dos/__divdi3.c
+++ b/dos/__divdi3.c
@@ -20,7 +20,7 @@ int64_t __divdi3(int64_t num, int64_t den)
den = -den;
minus ^= 1;
}
-
+
v = __udivmoddi4(num, den, NULL);
if ( minus )
v = -v;
diff --git a/dos/__udivmoddi4.c b/dos/__udivmoddi4.c
index 57b20e23..8e7661f5 100644
--- a/dos/__udivmoddi4.c
+++ b/dos/__udivmoddi4.c
@@ -3,7 +3,7 @@
uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
{
uint64_t quot = 0, qbit = 1;
-
+
if ( den == 0 ) {
asm volatile("int $0");
return 0; /* If trap returns... */
diff --git a/dos/argv.c b/dos/argv.c
index 4c835896..98216e77 100644
--- a/dos/argv.c
+++ b/dos/argv.c
@@ -1,6 +1,6 @@
#ident "$Id$"
/* ----------------------------------------------------------------------- *
- *
+ *
* Copyright 2004 H. Peter Anvin - All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person
@@ -11,10 +11,10 @@
* sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following
* conditions:
- *
+ *
* The above copyright notice and this permission notice shall
* be included in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -91,4 +91,3 @@ int __parse_argv(char ***argv, const char *str)
return argc;
}
-
diff --git a/dos/atou.c b/dos/atou.c
index 6d65106b..27663704 100644
--- a/dos/atou.c
+++ b/dos/atou.c
@@ -7,4 +7,3 @@ unsigned int atou(const char *s)
i = i*10 + (*s++ - '0');
return i;
}
-
diff --git a/dos/conio.c b/dos/conio.c
index e4cf3ed2..a5527bc9 100644
--- a/dos/conio.c
+++ b/dos/conio.c
@@ -1,6 +1,6 @@
#ident "$Id$"
/* ----------------------------------------------------------------------- *
- *
+ *
* Copyright 2001-2004 H. Peter Anvin - All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
diff --git a/dos/crt0.S b/dos/crt0.S
index af8b8ba6..62ab80ff 100644
--- a/dos/crt0.S
+++ b/dos/crt0.S
@@ -3,14 +3,14 @@
#ifndef REGPARM
# error "This file assumes -mregparm=3 -DREGPARM=3"
#endif
-
+
.section ".init","ax"
.globl _start
.type _start,@function
_start:
# Align the stack and make sure the high half is zero
andl $0xfff8,%esp
-
+
# Clear the .bss
cld
xorl %eax,%eax
@@ -39,7 +39,7 @@ _start:
calll main
# Here %eax is the exit code, fall through into exit
-
+
.size _start,.-_start
.globl exit
diff --git a/dos/malloc.c b/dos/malloc.c
index 499d551a..052b0a5a 100644
--- a/dos/malloc.c
+++ b/dos/malloc.c
@@ -42,7 +42,7 @@ void __init_memory_arena(void)
fp = (struct free_arena_header *)start;
fp->a.type = ARENA_TYPE_FREE;
fp->a.size = total_space - __stack_size;
-
+
/* Insert into chains */
fp->a.next = fp->a.prev = &__malloc_head;
fp->next_free = fp->prev_free = &__malloc_head;
@@ -56,7 +56,7 @@ static void *__malloc_from_block(struct free_arena_header *fp, size_t size)
struct free_arena_header *nfp, *na;
fsize = fp->a.size;
-
+
/* We need the 2* to account for the larger requirements of a free block */
if ( fsize >= size+2*sizeof(struct arena_header) ) {
/* Bigger block than required -- split block */
@@ -73,7 +73,7 @@ static void *__malloc_from_block(struct free_arena_header *fp, size_t size)
nfp->a.next = na;
na->a.prev = nfp;
fp->a.next = nfp;
-
+
/* Replace current block on free chain */
nfp->next_free = fp->next_free;
nfp->prev_free = fp->prev_free;
@@ -87,7 +87,7 @@ static void *__malloc_from_block(struct free_arena_header *fp, size_t size)
fp->next_free->prev_free = fp->prev_free;
fp->prev_free->next_free = fp->next_free;
}
-
+
return (void *)(&fp->a + 1);
}
diff --git a/dos/perror.c b/dos/perror.c
index ff8d5f2b..e6e82874 100644
--- a/dos/perror.c
+++ b/dos/perror.c
@@ -5,4 +5,3 @@ void perror(const char *msg)
{
printf("%s: error %s\n", msg, errno);
}
-
diff --git a/dos/printf.c b/dos/printf.c
index bea400de..99b389f6 100644
--- a/dos/printf.c
+++ b/dos/printf.c
@@ -45,7 +45,7 @@ static char * number(char * str, long num, int base, int size, int precision
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
int i;
-
+
if (type & LARGE)
digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (type & LEFT)
@@ -116,20 +116,20 @@ int vsprintf(char *buf, const char *fmt, va_list args)
int i, base;
char * str;
const char *s;
-
+
int flags; /* flags to number() */
-
+
int field_width; /* width of output field */
int precision; /* min. # of digits for integers; max
number of chars for from string */
int qualifier; /* 'h', 'l', or 'L' for integer fields */
-
+
for (str=buf ; *fmt ; ++fmt) {
if (*fmt != '%') {
*str++ = *fmt;
continue;
}
-
+
/* process flags */
flags = 0;
repeat:
@@ -141,7 +141,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
case '#': flags |= SPECIAL; goto repeat;
case '0': flags |= ZEROPAD; goto repeat;
}
-
+
/* get field width */
field_width = -1;
if (isdigit(*fmt))
@@ -155,11 +155,11 @@ int vsprintf(char *buf, const char *fmt, va_list args)
flags |= LEFT;
}
}
-
+
/* get the precision */
precision = -1;
if (*fmt == '.') {
- ++fmt;
+ ++fmt;
if (isdigit(*fmt))
precision = skip_atou(&fmt);
else if (*fmt == '*') {
@@ -170,17 +170,17 @@ int vsprintf(char *buf, const char *fmt, va_list args)
if (precision < 0)
precision = 0;
}
-
+
/* get the conversion qualifier */
qualifier = -1;
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
qualifier = *fmt;
++fmt;
}
-
+
/* default base */
base = 10;
-
+
switch (*fmt) {
case 'c':
if (!(flags & LEFT))
@@ -190,11 +190,11 @@ int vsprintf(char *buf, const char *fmt, va_list args)
while (--field_width > 0)
*str++ = ' ';
continue;
-
+
case 's':
s = va_arg(args, char *);
len = strnlen(s, precision);
-
+
if (!(flags & LEFT))
while (len < field_width--)
*str++ = ' ';
@@ -203,7 +203,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
while (len < field_width--)
*str++ = ' ';
continue;
-
+
case 'p':
if (field_width == -1) {
field_width = 2*sizeof(void *);
@@ -213,8 +213,8 @@ int vsprintf(char *buf, const char *fmt, va_list args)
(unsigned long) va_arg(args, void *), 16,
field_width, precision, flags);
continue;
-
-
+
+
case 'n':
if (qualifier == 'l') {
long * ip = va_arg(args, long *);
@@ -224,28 +224,28 @@ int vsprintf(char *buf, const char *fmt, va_list args)
*ip = (str - buf);
}
continue;
-
+
case '%':
*str++ = '%';
continue;
-
+
/* integer number formats - set up the flags and "break" */
case 'o':
base = 8;
break;
-
+
case 'X':
flags |= LARGE;
case 'x':
base = 16;
break;
-
+
case 'd':
case 'i':
flags |= SIGN;
case 'u':
break;
-
+
default:
*str++ = '%';
if (*fmt)
@@ -274,7 +274,7 @@ int sprintf(char * buf, const char *fmt, ...)
{
va_list args;
int i;
-
+
va_start(args, fmt);
i=vsprintf(buf,fmt,args);
va_end(args);
@@ -295,4 +295,3 @@ int printf(const char *fmt, ...)
return printed;
}
-
diff --git a/dos/skipatou.c b/dos/skipatou.c
index 4c663f66..f71c5342 100644
--- a/dos/skipatou.c
+++ b/dos/skipatou.c
@@ -3,7 +3,7 @@
unsigned int skip_atou(const char **s)
{
int i=0;
-
+
while (isdigit(**s))
i = i*10 + *((*s)++) - '0';
return i;
diff --git a/dos/stdio.h b/dos/stdio.h
index ffc9b3f3..97988c24 100644
--- a/dos/stdio.h
+++ b/dos/stdio.h
@@ -19,4 +19,3 @@ int printf(const char *fmt, ...);
#define fprintf(x, y, ...) printf(y, ## __VA_ARGS__)
#endif /* STDIO_H */
-
diff --git a/dos/syslinux.c b/dos/syslinux.c
index 000b68c3..bd76518e 100644
--- a/dos/syslinux.c
+++ b/dos/syslinux.c
@@ -1,6 +1,6 @@
#ident "$Id$"
/* ----------------------------------------------------------------------- *
- *
+ *
* Copyright 1998-2004 H. Peter Anvin - All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
@@ -155,7 +155,7 @@ void read_device(int drive, const void *buf, size_t nsecs, unsigned int sector)
if ( err )
die("sector read error");
-}
+}
/* Both traditional DOS and FAT32 DOS return this structure, but
FAT32 return a lot more data, so make sure we have plenty of space */
@@ -187,7 +187,7 @@ uint32_t get_partition_offset(int drive)
struct deviceparams dp;
dp.specfunc = 1; /* Get current information */
-
+
rv = 0x440d;
asm volatile("int $0x21 ; setc %0"
: "=abcdm" (err), "+a" (rv)
@@ -195,7 +195,7 @@ uint32_t get_partition_offset(int drive)
if ( !err )
return dp.hiddensecs;
-
+
rv = 0x440d;
asm volatile("int $0x21 ; setc %0"
: "=abcdm" (err), "+a" (rv)
@@ -249,7 +249,7 @@ void write_mbr(int drive, const void *buf)
asm volatile("int $0x21 ; setc %0"
: "=abcdm" (err), "+a" (rv)
: "c" (0x4841), "d" (&mbr), "b" (drive));
-
+
if ( err )
die("mbr write error");
}
@@ -276,7 +276,7 @@ void read_mbr(int drive, const void *buf)
asm volatile("int $0x21 ; setc %0"
: "=abcdm" (err), "+a" (rv)
: "c" (0x4861), "d" (&mbr), "b" (drive));
-
+
if ( err )
die("mbr read error");
}
@@ -412,12 +412,12 @@ static void adjust_mbr(int device, int writembr, int set_active)
memcpy(sectbuf, syslinux_mbr, syslinux_mbr_len);
*(uint16_t *)(sectbuf+510) = 0xaa55;
}
-
+
if ( set_active ) {
uint32_t offset = get_partition_offset(device);
struct mbr_entry *me = (struct mbr_entry *)(sectbuf+446);
int found = 0;
-
+
for ( i = 0 ; i < 4 ; i++ ) {
if ( me->startlba == offset ) {
me->active = 0x80;
@@ -434,7 +434,7 @@ static void adjust_mbr(int device, int writembr, int set_active)
die("multiple aliased partitions found");
}
}
-
+
write_mbr(device, sectbuf);
}
@@ -460,7 +460,7 @@ int main(int argc, char *argv[])
dprintf("argv[%d] = %p = \"%s\"\n", i, argv[i], argv[i]);
(void)argc; /* Unused */
-
+
get_dos_version();
for ( argp = argv+1 ; *argp ; argp++ ) {
@@ -523,7 +523,7 @@ int main(int argc, char *argv[])
putchar('\n');
exit(1);
}
-
+
ldlinux_name[0] = dev_fd | 0x40;
set_attributes(ldlinux_name, 0);
@@ -591,4 +591,3 @@ int main(int argc, char *argv[])
return 0;
}
-