From d25a5e1ec6cd4d6169497682b117b82036bb1c0e Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Tue, 8 Oct 2024 10:43:46 +0200 Subject: [PATCH] Mark zp_time_since_epoch and zp_get_time_since_epoch as internal (#717) --- include/zenoh-pico/system/platform_common.h | 4 ++-- src/api/api.c | 4 ++-- src/system/arduino/esp32/system.c | 2 +- src/system/arduino/opencr/system.c | 2 +- src/system/emscripten/system.c | 2 +- src/system/espidf/system.c | 2 +- src/system/flipper/system.c | 2 +- src/system/freertos_plus_tcp/system.c | 2 +- src/system/mbed/system.cpp | 2 +- src/system/unix/system.c | 2 +- src/system/windows/system.c | 2 +- src/system/zephyr/system.c | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/zenoh-pico/system/platform_common.h b/include/zenoh-pico/system/platform_common.h index 225162e70..60d85c4e6 100644 --- a/include/zenoh-pico/system/platform_common.h +++ b/include/zenoh-pico/system/platform_common.h @@ -449,9 +449,9 @@ unsigned long z_time_elapsed_s(z_time_t *time); typedef struct { uint32_t secs; uint32_t nanos; -} zp_time_since_epoch; +} _z_time_since_epoch; -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t); +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t); #ifdef __cplusplus } #endif diff --git a/src/api/api.c b/src/api/api.c index 3501e44d1..ae036fdd7 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -381,8 +381,8 @@ z_result_t z_bytes_writer_append(z_loaned_bytes_writer_t *writer, z_moved_bytes_ z_result_t z_timestamp_new(z_timestamp_t *ts, const z_loaned_session_t *zs) { *ts = _z_timestamp_null(); - zp_time_since_epoch t; - _Z_RETURN_IF_ERR(zp_get_time_since_epoch(&t)); + _z_time_since_epoch t; + _Z_RETURN_IF_ERR(_z_get_time_since_epoch(&t)); ts->time = _z_timestamp_ntp64_from_time(t.secs, t.nanos); ts->id = _Z_RC_IN_VAL(zs)->_local_zid; return _Z_RES_OK; diff --git a/src/system/arduino/esp32/system.c b/src/system/arduino/esp32/system.c index 3bd178ee7..2a6a257e6 100644 --- a/src/system/arduino/esp32/system.c +++ b/src/system/arduino/esp32/system.c @@ -217,7 +217,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) { return elapsed; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { z_time_t now; gettimeofday(&now, NULL); t->secs = now.tv_sec; diff --git a/src/system/arduino/opencr/system.c b/src/system/arduino/opencr/system.c index 1acd5cef9..e6ea10fce 100644 --- a/src/system/arduino/opencr/system.c +++ b/src/system/arduino/opencr/system.c @@ -199,7 +199,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) { return elapsed; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { z_time_t now; gettimeofday(&now, NULL); t->secs = now.tv_sec; diff --git a/src/system/emscripten/system.c b/src/system/emscripten/system.c index 6e184939f..9bfa8f7d6 100644 --- a/src/system/emscripten/system.c +++ b/src/system/emscripten/system.c @@ -136,7 +136,7 @@ unsigned long z_time_elapsed_ms(z_time_t *time) { unsigned long z_time_elapsed_s(z_time_t *time) { return z_time_elapsed_ms(time) * 1000; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { double date = emscripten_date_now(); t->secs = (uint32_t)(date / 1000); t->nanos = (uint32_t)((date - t->secs * 1000) * 1000000); diff --git a/src/system/espidf/system.c b/src/system/espidf/system.c index 7c03bcb7a..b66bb94c2 100644 --- a/src/system/espidf/system.c +++ b/src/system/espidf/system.c @@ -241,7 +241,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) { return elapsed; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { z_time_t now; gettimeofday(&now, NULL); t->secs = now.tv_sec; diff --git a/src/system/flipper/system.c b/src/system/flipper/system.c index 0c481db07..3d27aaeb1 100644 --- a/src/system/flipper/system.c +++ b/src/system/flipper/system.c @@ -298,4 +298,4 @@ struct tm* localtime(const time_t* timep) { return &t; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch* t) { return -1; } +z_result_t _z_get_time_since_epoch(_z_time_since_epoch* t) { return -1; } diff --git a/src/system/freertos_plus_tcp/system.c b/src/system/freertos_plus_tcp/system.c index 8d31e5d55..0876240fe 100644 --- a/src/system/freertos_plus_tcp/system.c +++ b/src/system/freertos_plus_tcp/system.c @@ -209,4 +209,4 @@ unsigned long z_time_elapsed_ms(z_time_t *time) { unsigned long z_time_elapsed_s(z_time_t *time) { return z_time_elapsed_ms(time) / 1000; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { return -1; } +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { return -1; } diff --git a/src/system/mbed/system.cpp b/src/system/mbed/system.cpp index 30c63b98d..e127d3518 100644 --- a/src/system/mbed/system.cpp +++ b/src/system/mbed/system.cpp @@ -194,7 +194,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) { return elapsed; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { z_time_t now; gettimeofday(&now, NULL); t->secs = now.tv_sec; diff --git a/src/system/unix/system.c b/src/system/unix/system.c index 6399b9f31..beb78ceef 100644 --- a/src/system/unix/system.c +++ b/src/system/unix/system.c @@ -236,7 +236,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) { return elapsed; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { z_time_t now; gettimeofday(&now, NULL); t->secs = (uint32_t)now.tv_sec; diff --git a/src/system/windows/system.c b/src/system/windows/system.c index df2100c01..51acd4146 100644 --- a/src/system/windows/system.c +++ b/src/system/windows/system.c @@ -270,7 +270,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) { return elapsed; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { z_time_t now; ftime(&now); t->secs = (uint32_t)now.time; diff --git a/src/system/zephyr/system.c b/src/system/zephyr/system.c index 0a4d5db11..c76e26a02 100644 --- a/src/system/zephyr/system.c +++ b/src/system/zephyr/system.c @@ -226,7 +226,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) { return elapsed; } -z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { +z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { z_time_t now; gettimeofday(&now, NULL); t->secs = now.tv_sec;