]> Cypherpunks repositories - gostls13.git/commitdiff
all: clean up C function prototypes
authorAnthony Martin <ality@pbrane.org>
Tue, 26 Feb 2013 17:51:33 +0000 (09:51 -0800)
committerAnthony Martin <ality@pbrane.org>
Tue, 26 Feb 2013 17:51:33 +0000 (09:51 -0800)
R=minux.ma, rsc, akumar, bradfitz
CC=golang-dev
https://golang.org/cl/7313070

15 files changed:
src/cmd/dist/windows.c
src/cmd/ld/dwarf.c
src/cmd/prof/main.c
src/lib9/main.c
src/lib9/utf/rune.c
src/lib9/windows.c
src/libmach/sym.c
src/pkg/runtime/cgo/gcc_freebsd_arm.c
src/pkg/runtime/cgo/gcc_linux_arm.c
src/pkg/runtime/cgo/gcc_netbsd_arm.c
src/pkg/runtime/cpuprof.c
src/pkg/runtime/race0.c
src/pkg/runtime/signal_freebsd_arm.c
src/pkg/runtime/signal_linux_arm.c
src/pkg/runtime/vdso_linux_amd64.c

index 385a60577fdccad05488df199565b919f7cb92fe..7bcda4508f414eeabbab16bf485d1ccb3b505706 100644 (file)
@@ -852,7 +852,8 @@ xprintf(char *fmt, ...)
 }
 
 void
-errprintf(char *fmt, ...) {
+errprintf(char *fmt, ...)
+{
        va_list arg;
        char *p;
        DWORD n, w;
index bb5199fc155da0e720301c8dc1a2895b62c3fa80..d6a357e4982c5abf45be3db62e7988dd2d97d3ec 100644 (file)
@@ -1936,7 +1936,8 @@ writeinfo(void)
  *  because we need die->offs and infoo/infosize;
  */
 static int
-ispubname(DWDie *die) {
+ispubname(DWDie *die)
+{
        DWAttr *a;
 
        switch(die->abbrev) {
@@ -1949,7 +1950,8 @@ ispubname(DWDie *die) {
 }
 
 static int
-ispubtype(DWDie *die) {
+ispubtype(DWDie *die)
+{
        return die->abbrev >= DW_ABRV_NULLTYPE;
 }
 
index 7a1d419611d07a1767c067713a5da4f36b0a4281..6c591ba180b78c2e488e472b4dd7b212c5038e82 100644 (file)
@@ -172,7 +172,8 @@ amd64_uregPC(void)
 }
 
 uvlong
-amd64_uregSP(void) {
+amd64_uregSP(void)
+{
        return ureg_amd64.sp;
 }
 
index f1bde9c95f396d4bc2ce2a55ad49d86bcddd490c..816494af03a4eb9ced44ca2e4056f012a5d839a7 100644 (file)
@@ -30,7 +30,9 @@ THE SOFTWARE.
 #ifdef WIN32
 #include <windows.h>
 
-static void crashhandler(int sig) {
+static void
+crashhandler(int sig)
+{
        USED(sig);
        fprint(2, "%s: internal fatal error.\n", argv0);
        exit(1);
index 676f27bba61713c799e294c5845226c7827d9c01..818771cfd967d8b0c05d779e573b7c6a78c0218b 100644 (file)
@@ -247,7 +247,8 @@ bad:
 }
 
 int
-isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed) {
+isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed)
+{
        *consumed = charntorune(rune, str, length);
        return *rune != Runeerror || *consumed == 3;
 }
index 90753bb8d2b9933cf590f57f13502b843ec0f1fe..d8ee402a2c59b408824116b26af678cd431ded1f 100644 (file)
@@ -5,22 +5,26 @@
 #include <u.h>
 #include <libc.h>
 
-int fork()
+int
+fork(void)
 {
        return -1;
 }
 
-int p9rfork(int flags)
+int
+p9rfork(int flags)
 {
        return -1;
 }
 
-Waitmsg *p9wait()
+Waitmsg*
+p9wait(void)
 {
        return 0;
 }
 
-int p9waitpid()
+int
+p9waitpid(void)
 {
        return -1;
 }
index bb758addb580477e1785b5b20633a09beec45ff6..3ac020b428260b392ae0a277506642e7bc578693 100644 (file)
@@ -591,7 +591,8 @@ lookup(char *fn, char *var, Symbol *s)
  * strcmp, but allow '_' to match center dot (rune 00b7 == bytes c2 b7)
  */
 int
-cdotstrcmp(char *sym, char *user) {
+cdotstrcmp(char *sym, char *user)
+{
        for (;;) {
                while (*sym == *user) {
                        if (*sym++ == '\0')
index 70f4b571e05ee7bd0fb4349aff8b3d7bb7ee1d76..3240af652d92603ea342dacc15083974851d4ceb 100644 (file)
@@ -18,7 +18,10 @@ static void *threadentry(void*);
 void __aeabi_read_tp(void) __attribute__((naked));
 void cgo_tls_set_gm(void) __attribute__((naked));
 void cgo_tls_get_gm(void) __attribute__((naked));
-void __aeabi_read_tp(void) {
+
+void
+__aeabi_read_tp(void)
+{
        // read @ 0xffff1000
        __asm__ __volatile__ (
                "ldr r0, =0xffff1000\n\t"
@@ -26,8 +29,11 @@ void __aeabi_read_tp(void) {
                "mov pc, lr\n\t"
        );
 }
+
 // g (R10) at 8(TP), m (R9) at 12(TP)
-void cgo_tls_get_gm(void) {
+void
+cgo_tls_get_gm(void)
+{
        __asm__ __volatile__ (
                "push {lr}\n\t"
                "bl __aeabi_read_tp\n\t"
@@ -36,7 +42,10 @@ void cgo_tls_get_gm(void) {
                "pop {pc}\n\t"
        );
 }
-void cgo_tls_set_gm(void) {
+
+void
+cgo_tls_set_gm(void)
+{
        __asm__ __volatile__ (
                "push {lr}\n\t"
                "bl __aeabi_read_tp\n\t"
@@ -45,6 +54,7 @@ void cgo_tls_set_gm(void) {
                "pop {pc}\n\t"
        );
 }
+
 // both cgo_tls_{get,set}_gm can be called from runtime
 void (*cgo_load_gm)(void) = cgo_tls_get_gm;
 void (*cgo_save_gm)(void) = cgo_tls_set_gm;
index 8af96cec69b1bccc8d27acc57723405c772373da..b1436b3ce9a4878d4eb7ad46f1d2f277755cc506 100644 (file)
@@ -18,7 +18,10 @@ static void *threadentry(void*);
 void __aeabi_read_tp(void) __attribute__((naked));
 void cgo_tls_set_gm(void) __attribute__((naked));
 void cgo_tls_get_gm(void) __attribute__((naked));
-void __aeabi_read_tp(void) {
+
+void
+__aeabi_read_tp(void)
+{
        // b __kuser_get_tls @ 0xffff0fe0
        __asm__ __volatile__ (
                "mvn r0, #0xf000\n\t"
@@ -26,8 +29,11 @@ void __aeabi_read_tp(void) {
                "nop\n\tnop\n\t"
        );
 }
+
 // g (R10) at 8(TP), m (R9) at 12(TP)
-void cgo_tls_get_gm(void) {
+void
+cgo_tls_get_gm(void)
+{
        __asm__ __volatile__ (
                "push {lr}\n\t"
                "bl __aeabi_read_tp\n\t"
@@ -36,7 +42,10 @@ void cgo_tls_get_gm(void) {
                "pop {pc}\n\t"
        );
 }
-void cgo_tls_set_gm(void) {
+
+void
+cgo_tls_set_gm(void)
+{
        __asm__ __volatile__ (
                "push {lr}\n\t"
                "bl __aeabi_read_tp\n\t"
@@ -45,6 +54,7 @@ void cgo_tls_set_gm(void) {
                "pop {pc}\n\t"
        );
 }
+
 // both cgo_tls_{get,set}_gm can be called from runtime
 void (*cgo_load_gm)(void) = cgo_tls_get_gm;
 void (*cgo_save_gm)(void) = cgo_tls_set_gm;
index 0adcac6e2ffe1b58b68e958b1188a93d5c663dd2..1c156bdca79dc31c2c7f376292935d7304f7af59 100644 (file)
@@ -20,7 +20,10 @@ static void *threadentry(void*);
 void __aeabi_read_tp(void) __attribute__((naked));
 void cgo_tls_set_gm(void) __attribute__((naked));
 void cgo_tls_get_gm(void) __attribute__((naked));
-void __aeabi_read_tp(void) {
+
+void
+__aeabi_read_tp(void)
+{
        // this function is only allowed to clobber r0
        __asm__ __volatile__ (
                "mrc p15, 0, r0, c13, c0, 3\n\t"
@@ -32,8 +35,11 @@ void __aeabi_read_tp(void) {
                "mov pc, lr\n\t"
        );
 }
+
 // g (R10) at 8(TP), m (R9) at 12(TP)
-void cgo_tls_get_gm(void) {
+void
+cgo_tls_get_gm(void)
+{
        __asm__ __volatile__ (
                "push {lr}\n\t"
                "bl __aeabi_read_tp\n\t"
@@ -42,7 +48,10 @@ void cgo_tls_get_gm(void) {
                "pop {pc}\n\t"
        );
 }
-void cgo_tls_set_gm(void) {
+
+void
+cgo_tls_set_gm(void)
+{
        __asm__ __volatile__ (
                "push {lr}\n\t"
                "bl __aeabi_read_tp\n\t"
@@ -51,6 +60,7 @@ void cgo_tls_set_gm(void) {
                "pop {pc}\n\t"
        );
 }
+
 // both cgo_tls_{get,set}_gm can be called from runtime
 void (*cgo_load_gm)(void) = cgo_tls_get_gm;
 void (*cgo_save_gm)(void) = cgo_tls_set_gm;
index dbbf5554fc0a7ea678dc930a7267450b0cd4e8fb..9a0606a225aaf33ecd97cd171ebffed9af7309d1 100644 (file)
@@ -115,7 +115,9 @@ static uintptr eod[3] = {0, 1, 0};
 // LostProfileData is a no-op function used in profiles
 // to mark the number of profiling stack traces that were
 // discarded due to slow data writers.
-static void LostProfileData(void) {
+static void
+LostProfileData(void)
+{
 }
 
 // SetCPUProfileRate sets the CPU profiling rate.
index f91c12757f3f7708aeedc9dc95bda3ce0434aad6..1c5f05a7e1839960cd79d7cfc39d8339eaeee1ab 100644 (file)
@@ -128,6 +128,6 @@ runtime·racegostart(void *pc)
 }
 
 void
-runtime·racegoend()
+runtime·racegoend(void)
 {
 }
index 2a0e9ac913282c924edd69407d5ee86d6a6cfbdf..50c3221bb4031f70e8776b78acb080e742d7231e 100644 (file)
@@ -184,7 +184,8 @@ runtime·checkgoarm(void)
 
 #pragma textflag 7
 int64
-runtime·cputicks() {
+runtime·cputicks(void)
+{
        // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
        // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
        // TODO: need more entropy to better seed fastrand1.
index b5a137c3691d551c9204b75b75c09deaff63dbc4..c26caa7cdb3283c53e7ff2d02d3137deeeebce3a 100644 (file)
@@ -232,7 +232,8 @@ runtime·setup_auxv(int32 argc, void *argv_list)
 
 #pragma textflag 7
 int64
-runtime·cputicks() {
+runtime·cputicks(void)
+{
        // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
        // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
        // runtime·randomNumber provides better seeding of fastrand1.
index b125c8b05109486b8c26e0d4f409435fd96dc00f..ab68c23c34c786160916dd002377abe0e8cccafa 100644 (file)
@@ -170,7 +170,9 @@ static symbol_key sym_keys[] = {
        { (byte*)"__vdso_clock_gettime", &runtime·__vdso_clock_gettime_sym },
 };
 
-static void vdso_init_from_sysinfo_ehdr(struct vdso_info *vdso_info, Elf64_Ehdr* hdr) {
+static void
+vdso_init_from_sysinfo_ehdr(struct vdso_info *vdso_info, Elf64_Ehdr* hdr)
+{
        uint64 i;
        bool found_vaddr = false;
 
@@ -237,7 +239,9 @@ static void vdso_init_from_sysinfo_ehdr(struct vdso_info *vdso_info, Elf64_Ehdr*
        vdso_info->valid = true;
 }
 
-static int32 vdso_find_version(struct vdso_info *vdso_info, version_key* ver) {
+static int32
+vdso_find_version(struct vdso_info *vdso_info, version_key* ver)
+{
        if(vdso_info->valid == false) {
                return 0;
        }
@@ -259,7 +263,9 @@ static int32 vdso_find_version(struct vdso_info *vdso_info, version_key* ver) {
        return 0;
 }
 
-static void vdso_parse_symbols(struct vdso_info *vdso_info, int32 version) {
+static void
+vdso_parse_symbols(struct vdso_info *vdso_info, int32 version)
+{
        int32 i, j;
 
        if(vdso_info->valid == false)