aboutsummaryrefslogtreecommitdiffstats
path: root/sample
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:37 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:37 -0700
commit34c6099d7e25993e92557646b2dab6a9df20fe02 (patch)
treeae72e0ac833705771c3183c1c523469e2083a02f /sample
parent9ee338c78a77e2ca48a479c7a41c4843b616d588 (diff)
downloadsyslinux-34c6099d7e25993e92557646b2dab6a9df20fe02.tar.gz
Run Nindent on sample/hello2.c
Automatically reformat sample/hello2.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'sample')
-rw-r--r--sample/hello2.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/sample/hello2.c b/sample/hello2.c
index 1308a31b..e8920112 100644
--- a/sample/hello2.c
+++ b/sample/hello2.c
@@ -25,36 +25,34 @@
static inline void memset(void *buf, int ch, unsigned int len)
{
- asm volatile("cld; rep; stosb"
- : "+D" (buf), "+c" (len) : "a" (ch) : "memory");
+ asm volatile ("cld; rep; stosb":"+D" (buf), "+c"(len):"a"(ch):"memory");
}
static void strcpy(char *dst, const char *src)
{
- while ( *src )
- *dst++ = *src++;
+ while (*src)
+ *dst++ = *src++;
- *dst = '\0';
+ *dst = '\0';
}
static void writemsg(const char *msg)
{
- com32sys_t inreg;
+ com32sys_t inreg;
- memset(&inreg, 0, sizeof inreg);
+ memset(&inreg, 0, sizeof inreg);
- strcpy(__com32.cs_bounce, msg);
- inreg.eax.w[0] = 0x0002; /* Write string */
- inreg.ebx.w[0] = OFFS(__com32.cs_bounce);
- inreg.es = SEG(__com32.cs_bounce);
- __com32.cs_intcall(0x22, &inreg, NULL);
+ strcpy(__com32.cs_bounce, msg);
+ inreg.eax.w[0] = 0x0002; /* Write string */
+ inreg.ebx.w[0] = OFFS(__com32.cs_bounce);
+ inreg.es = SEG(__com32.cs_bounce);
+ __com32.cs_intcall(0x22, &inreg, NULL);
};
int __start(void)
{
- writemsg("Hello, World!\r\n"
- "cmdline = ");
- writemsg(__com32.cs_cmdline);
- writemsg("\r\n");
- return 0;
+ writemsg("Hello, World!\r\n" "cmdline = ");
+ writemsg(__com32.cs_cmdline);
+ writemsg("\r\n");
+ return 0;
}