This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 5f166c09be8b914752b9015374f741c93cb232e2
Author: Stuart Ianna <[email protected]>
AuthorDate: Fri Nov 17 04:35:04 2023 +0000

    testing/sd_stress: Restrict variable and function scope to file only.
    
    Add the static keyword to required function and variable delcaration to 
reduce their scope. Stops namespace pollution in CONFIG_BUILD_FLAT.
---
 testing/sd_stress/sd_stress_main.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/testing/sd_stress/sd_stress_main.c 
b/testing/sd_stress/sd_stress_main.c
index 985d9d656..b65455a66 100644
--- a/testing/sd_stress/sd_stress_main.c
+++ b/testing/sd_stress/sd_stress_main.c
@@ -65,17 +65,17 @@ static const char *TEMPDIR = 
CONFIG_TESTING_SD_STRESS_DEVICE"/stress";
 static const char *TEMPDIR2 = CONFIG_TESTING_SD_STRESS_DEVICE"/moved";
 static const char *TEMPFILE = "tmp";
 
-const size_t max_runs = 10000;
-const size_t min_runs = 1;
-const size_t default_runs = 32;
+static const size_t max_runs = 10000;
+static const size_t min_runs = 1;
+static const size_t default_runs = 32;
 
-const size_t max_bytes = 10000;
-const size_t min_bytes = 1;
-const size_t default_bytes = 4096;
+static const size_t max_bytes = 10000;
+static const size_t min_bytes = 1;
+static const size_t default_bytes = 4096;
 
-const size_t max_files = 999;
-const size_t min_files = 1;
-const size_t default_files = 64;
+static const size_t max_files = 999;
+static const size_t min_files = 1;
+static const size_t default_files = 64;
 
 /****************************************************************************
  * Private Functions
@@ -272,15 +272,15 @@ static bool rename_dir(const char *old_dir, const char 
*new_dir)
   return true;
 }
 
-struct timespec get_abs_time(void)
+static struct timespec get_abs_time(void)
 {
   struct timespec ts;
   clock_gettime(CLOCK_MONOTONIC, &ts);
   return ts;
 }
 
-uint64_t get_time_delta(const struct timespec *start,
-                        const struct timespec *end)
+static uint64_t get_time_delta(const struct timespec *start,
+                               const struct timespec *end)
 {
   uint64_t elapsed;
   elapsed = (((uint64_t)end->tv_sec * NSEC_PER_SEC) + end->tv_nsec);
@@ -288,7 +288,7 @@ uint64_t get_time_delta(const struct timespec *start,
   return elapsed / 1000;
 }
 
-float get_elapsed_time_ms(const struct timespec *start)
+static float get_elapsed_time_ms(const struct timespec *start)
 {
   struct timespec now = get_abs_time();
   return get_time_delta(start, &now) / (float)USEC_PER_MSEC;

Reply via email to