aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlijunlong <lijunlong@openresty.com>2023-02-22 09:04:28 +0800
committerlijunlong <lijunlong@openresty.com>2023-02-22 09:17:50 +0800
commit1dff61d9bf390372124c13443e0131a96383f5bc (patch)
treeb40b1f755aba6ec3908931cb7b0f4cba7f9a55d4
parent6f38a95a2d44ad3bd4cc49e14224296239da7412 (diff)
downloadlua-cjson-1dff61d9bf390372124c13443e0131a96383f5bc.tar.gz
lua-cjson-1dff61d9bf390372124c13443e0131a96383f5bc.tar.bz2
lua-cjson-1dff61d9bf390372124c13443e0131a96383f5bc.zip
optimization: add void to functions with no arguments to prevent compiler warning.
-rw-r--r--fpconv.c4
-rw-r--r--fpconv.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/fpconv.c b/fpconv.c
index 3e480ec..0ef7f18 100644
--- a/fpconv.c
+++ b/fpconv.c
@@ -55,7 +55,7 @@ static char locale_decimal_point = '.';
55 * localconv() may not be thread safe (=>crash), and nl_langinfo() is 55 * localconv() may not be thread safe (=>crash), and nl_langinfo() is
56 * not supported on some platforms. Use sprintf() instead - if the 56 * not supported on some platforms. Use sprintf() instead - if the
57 * locale does change, at least Lua CJSON won't crash. */ 57 * locale does change, at least Lua CJSON won't crash. */
58static void fpconv_update_locale() 58static void fpconv_update_locale(void)
59{ 59{
60 char buf[8]; 60 char buf[8];
61 61
@@ -202,7 +202,7 @@ int fpconv_g_fmt(char *str, double num, int precision)
202 return len; 202 return len;
203} 203}
204 204
205void fpconv_init() 205void fpconv_init(void)
206{ 206{
207 fpconv_update_locale(); 207 fpconv_update_locale();
208} 208}
diff --git a/fpconv.h b/fpconv.h
index 7b0d0ee..59e0867 100644
--- a/fpconv.h
+++ b/fpconv.h
@@ -7,12 +7,12 @@
7# define FPCONV_G_FMT_BUFSIZE 32 7# define FPCONV_G_FMT_BUFSIZE 32
8 8
9#ifdef USE_INTERNAL_FPCONV 9#ifdef USE_INTERNAL_FPCONV
10static inline void fpconv_init() 10static inline void fpconv_init(void)
11{ 11{
12 /* Do nothing - not required */ 12 /* Do nothing - not required */
13} 13}
14#else 14#else
15extern void fpconv_init(); 15extern void fpconv_init(void);
16#endif 16#endif
17 17
18extern int fpconv_g_fmt(char*, double, int); 18extern int fpconv_g_fmt(char*, double, int);