From: Jim Meyering <[email protected]>

* test/evsbench.c: Declare functions/vars static.
* test/evsverify.c: Likewise.
* test/testcpg2.c: Likewise.
* test/testcpg.c: Likewise.
* test/logsysbench.c: Likewise.
* test/cpgbench.c: Likewise.
* exec/sync.c: Likewise.
---
 exec/sync.c        |    3 ++-
 test/cpgbench.c    |   28 ++++++++++++++--------------
 test/evsbench.c    |   24 ++++++++++++------------
 test/evsverify.c   |   18 +++++++++---------
 test/logsysbench.c |   10 +++++-----
 test/testcpg.c     |   12 ++++++------
 test/testcpg2.c    |    4 ++--
 7 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/exec/sync.c b/exec/sync.c
index 51b3086..8a9dd9a 100644
--- a/exec/sync.c
+++ b/exec/sync.c
@@ -318,7 +318,8 @@ void sync_primary_callback_fn (

 static struct memb_ring_id deliver_ring_id;

-void sync_endian_convert (struct req_exec_sync_barrier_start 
*req_exec_sync_barrier_start)
+static void sync_endian_convert (struct req_exec_sync_barrier_start
+                                *req_exec_sync_barrier_start)
 {
        totemip_copy_endian_convert(&req_exec_sync_barrier_start->ring_id.rep,
                &req_exec_sync_barrier_start->ring_id.rep);
diff --git a/test/cpgbench.c b/test/cpgbench.c
index 0d3ca37..23f15d7 100644
--- a/test/cpgbench.c
+++ b/test/cpgbench.c
@@ -1,13 +1,13 @@
 #include <assert.h>
 /*
- * Copyright (c) 2006 Red Hat, Inc.
+ * Copyright (c) 2006, 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
  * Author: Steven Dake ([email protected])
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -67,9 +67,9 @@
     } while (0)
 #endif

-int alarm_notice;
+static int alarm_notice;

-void cpg_bm_confchg_fn (
+static void cpg_bm_confchg_fn (
        cpg_handle_t handle,
        struct cpg_name *group_name,
        struct cpg_address *member_list, int member_list_entries,
@@ -78,9 +78,9 @@ void cpg_bm_confchg_fn (
 {
 }

-unsigned int write_count;
+static unsigned int write_count;

-void cpg_bm_deliver_fn (
+static void cpg_bm_deliver_fn (
         cpg_handle_t handle,
         struct cpg_name *group_name,
         uint32_t nodeid,
@@ -91,14 +91,14 @@ void cpg_bm_deliver_fn (
        write_count++;
 }

-cpg_callbacks_t callbacks = {
+static cpg_callbacks_t callbacks = {
        .cpg_deliver_fn         = cpg_bm_deliver_fn,
        .cpg_confchg_fn         = cpg_bm_confchg_fn
 };

-char data[500000];
+static char data[500000];

-void cpg_benchmark (
+static void cpg_benchmark (
        cpg_handle_t handle,
        int write_size)
 {
@@ -138,15 +138,15 @@ retry:

        printf ("%5d messages received ", write_count);
        printf ("%5d bytes per write ", write_size);
-       printf ("%7.3f Seconds runtime ", 
+       printf ("%7.3f Seconds runtime ",
                (tv_elapsed.tv_sec + (tv_elapsed.tv_usec / 1000000.0)));
        printf ("%9.3f TP/s ",
                ((float)write_count) /  (tv_elapsed.tv_sec + 
(tv_elapsed.tv_usec / 1000000.0)));
-       printf ("%7.3f MB/s.\n", 
+       printf ("%7.3f MB/s.\n",
                ((float)write_count) * ((float)write_size) /  
((tv_elapsed.tv_sec + (tv_elapsed.tv_usec / 1000000.0)) * 1000000.0));
 }

-void sigalrm_handler (int num)
+static void sigalrm_handler (int num)
 {
        alarm_notice = 1;
 }
@@ -161,7 +161,7 @@ int main (void) {
        unsigned int size;
        int i;
        unsigned int res;
-       
+
        size = 1000;
        signal (SIGALRM, sigalrm_handler);
        res = cpg_initialize (&handle, &callbacks);
@@ -169,7 +169,7 @@ int main (void) {
                printf ("cpg_initialize failed with result %d\n", res);
                exit (1);
        }
-       
+
        res = cpg_join (handle, &group_name);
        if (res != CS_OK) {
                printf ("cpg_join failed with result %d\n", res);
diff --git a/test/evsbench.c b/test/evsbench.c
index 9618777..24ec8e0 100644
--- a/test/evsbench.c
+++ b/test/evsbench.c
@@ -7,7 +7,7 @@
  * Author: Steven Dake ([email protected])
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -68,7 +68,7 @@

 volatile static int alarm_notice = 0;

-void evs_deliver_fn (
+static void evs_deliver_fn (
        unsigned int nodeid,
        void *msg,
        int msg_len)
@@ -77,7 +77,7 @@ void evs_deliver_fn (
   printf ("Delivering message %s\n", m);
 }

-void evs_confchg_fn (
+static void evs_confchg_fn (
        unsigned int *member_list, int member_list_entries,
        unsigned int *left_list, int left_list_entries,
        unsigned int *joined_list, int joined_list_entries)
@@ -100,7 +100,7 @@ void evs_confchg_fn (
        }
 }

-evs_callbacks_t callbacks = {
+static evs_callbacks_t callbacks = {
        evs_deliver_fn,
        evs_confchg_fn
 };
@@ -111,14 +111,14 @@ struct evs_group groups[3] = {
        { "key3" }
 };

-char buffer[200000];
+static char buffer[200000];

-struct iovec iov = {
+static struct iovec iov = {
        .iov_base = buffer,
        .iov_len = sizeof (buffer)
 };

-void evs_benchmark (evs_handle_t handle,
+static void evs_benchmark (evs_handle_t handle,
        int write_size)
 {
        struct timeval tv1, tv2, tv_elapsed;
@@ -146,23 +146,23 @@ void evs_benchmark (evs_handle_t handle,

        printf ("%5d Writes ", write_count);
        printf ("%5d bytes per write ", write_size);
-       printf ("%7.3f Seconds runtime ", 
+       printf ("%7.3f Seconds runtime ",
                (tv_elapsed.tv_sec + (tv_elapsed.tv_usec / 1000000.0)));
        printf ("%9.3f TP/s ",
                ((float)write_count) /  (tv_elapsed.tv_sec + 
(tv_elapsed.tv_usec / 1000000.0)));
-       printf ("%7.3f MB/s.\n", 
+       printf ("%7.3f MB/s.\n",
                ((float)write_count) * ((float)write_size) /  
((tv_elapsed.tv_sec + (tv_elapsed.tv_usec / 1000000.0)) * 1000000.0));

        alarm_notice = 0;
 }

-void sigalrm_handler (int num)
+static void sigalrm_handler (int num)
 {
        alarm_notice = 1;
 }

-void sigintr_handler (int num) __attribute__((__noreturn__));
-void sigintr_handler (int num)
+static void sigintr_handler (int num) __attribute__((__noreturn__));
+static void sigintr_handler (int num)
 {
        exit (1);
 }
diff --git a/test/evsverify.c b/test/evsverify.c
index 17101b1..67d60a0 100644
--- a/test/evsverify.c
+++ b/test/evsverify.c
@@ -7,7 +7,7 @@
  * Author: Steven Dake ([email protected])
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -53,8 +53,8 @@ struct my_msg {
        unsigned char buffer[0];
 };

-int deliveries = 0;
-void evs_deliver_fn (
+static int deliveries = 0;
+static void evs_deliver_fn (
        unsigned int nodeid,
        void *m,
        int msg_len)
@@ -80,7 +80,7 @@ printf ("\n");
        deliveries++;
 }

-void evs_confchg_fn (
+static void evs_confchg_fn (
        unsigned int *member_list, int member_list_entries,
        unsigned int *left_list, int left_list_entries,
        unsigned int *joined_list, int joined_list_entries)
@@ -103,7 +103,7 @@ void evs_confchg_fn (
        }
 }

-evs_callbacks_t callbacks = {
+static evs_callbacks_t callbacks = {
        evs_deliver_fn,
        evs_confchg_fn
 };
@@ -114,9 +114,9 @@ struct evs_group groups[3] = {
        { "key3" }
 };

-struct my_msg msg;
+static struct my_msg msg;

-unsigned char buffer[200000];
+static unsigned char buffer[200000];
 int main (void)
 {
        evs_handle_t handle;
@@ -135,7 +135,7 @@ int main (void)
                printf ("Couldn't initialize EVS service %d\n", result);
                exit (0);
        }
-       
+
        result = evs_membership_get (handle, &local_nodeid,
                member_list, &member_list_entries);
        printf ("Current membership from evs_membership_get entries %d\n",
@@ -180,7 +180,7 @@ try_again_one:
        }

        evs_fd_get (handle, &fd);
-       
+
        evs_finalize (handle);

        return (0);
diff --git a/test/logsysbench.c b/test/logsysbench.c
index c58a9b8..97454a9 100644
--- a/test/logsysbench.c
+++ b/test/logsysbench.c
@@ -6,7 +6,7 @@
  * Author: Steven Dake ([email protected])
  *
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
@@ -54,7 +54,7 @@ LOGSYS_DECLARE_NOSUBSYS(LOG_LEVEL_INFO);
 #define LOGREC_ARGS_CHECKPOINT_CREATE 2
 #define ITERATIONS 1000000

-struct timeval tv1, tv2, tv_elapsed;
+static struct timeval tv1, tv2, tv_elapsed;

 #define timersub(a, b, result)                                 \
 do {                                                           \
@@ -66,11 +66,11 @@ do {                                                        
        \
        }                                                       \
 } while (0)

-void bm_start (void)
+static void bm_start (void)
 {
         gettimeofday (&tv1, NULL);
 }
-void bm_finish (const char *operation)
+static void bm_finish (const char *operation)
 {
         gettimeofday (&tv2, NULL);
         timersub (&tv2, &tv1, &tv_elapsed);
@@ -84,7 +84,7 @@ void bm_finish (const char *operation)
                 ((float)ITERATIONS) /  (tv_elapsed.tv_sec + 
(tv_elapsed.tv_usec / 1000000.0)));
 }

-char buffer[256];
+static char buffer[256];
 int main (void)
 {
        int i;
diff --git a/test/testcpg.c b/test/testcpg.c
index a7d5ec5..2ab68c9 100644
--- a/test/testcpg.c
+++ b/test/testcpg.c
@@ -53,7 +53,7 @@
 static int quit = 0;
 static int show_ip = 0;

-void print_cpgname (struct cpg_name *name)
+static void print_cpgname (struct cpg_name *name)
 {
        int i;

@@ -62,7 +62,7 @@ void print_cpgname (struct cpg_name *name)
        }
 }

-void DeliverCallback (
+static void DeliverCallback (
        cpg_handle_t handle,
        struct cpg_name *groupName,
        uint32_t nodeid,
@@ -81,7 +81,7 @@ void DeliverCallback (
        }
 }

-void ConfchgCallback (
+static void ConfchgCallback (
        cpg_handle_t handle,
        struct cpg_name *groupName,
        struct cpg_address *member_list, int member_list_entries,
@@ -143,13 +143,13 @@ void ConfchgCallback (
        }
 }

-cpg_callbacks_t callbacks = {
+static cpg_callbacks_t callbacks = {
        .cpg_deliver_fn =            DeliverCallback,
        .cpg_confchg_fn =            ConfchgCallback,
 };

-void sigintr_handler (int signum) __attribute__((__noreturn__));
-void sigintr_handler (int signum) {
+static void sigintr_handler (int signum) __attribute__((__noreturn__));
+static void sigintr_handler (int signum) {
        exit (0);
 }
 static struct cpg_name group_name;
diff --git a/test/testcpg2.c b/test/testcpg2.c
index 94dfb39..ee0336f 100644
--- a/test/testcpg2.c
+++ b/test/testcpg2.c
@@ -43,7 +43,7 @@
 #include <corosync/corotypes.h>
 #include <corosync/cpg.h>

-void deliver(
+static void deliver(
        cpg_handle_t handle,
        struct cpg_name *group_name,
        uint32_t nodeid,
@@ -54,7 +54,7 @@ void deliver(
     printf("self delivered nodeid: %x\n", nodeid);
 }

-void confch(
+static void confch(
        cpg_handle_t handle,
        struct cpg_name *group_name,
        struct cpg_address *member_list, int member_list_entries,
-- 
1.6.2.rc1.285.gc5f54

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to