1 Star 0 Fork 28

orange-snn/json-c

forked from src-openEuler/json-c 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0053-Fix-compiler-warnings.patch 3.33 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:54 . Package init
From 3003161effc3286b749010ada9182b79dbfe8c57 Mon Sep 17 00:00:00 2001
From: Rubasri Kalidas <[email protected]>
Date: Tue, 18 Dec 2018 11:30:57 -0600
Subject: [PATCH 53/56] Fix compiler warnings
---
linkhash.c | 4 ++++
random_seed.c | 24 ++++++++++++------------
random_seed.h | 2 +-
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/linkhash.c b/linkhash.c
index b1223c4..f324a10 100644
--- a/linkhash.c
+++ b/linkhash.c
@@ -36,6 +36,10 @@ static unsigned long lh_char_hash(const void *k);
static unsigned long lh_perllike_str_hash(const void *k);
static lh_hash_fn *char_hash_fn = lh_char_hash;
+/* comparison functions */
+int lh_char_equal(const void *k1, const void *k2);
+int lh_ptr_equal(const void *k1, const void *k2);
+
int
json_global_set_string_hash(const int h)
{
diff --git a/random_seed.c b/random_seed.c
index 3232777..97d9547 100644
--- a/random_seed.c
+++ b/random_seed.c
@@ -53,7 +53,7 @@ static void do_cpuid(int regs[], int h)
#if HAS_X86_CPUID
-static int has_rdrand()
+static int has_rdrand(void)
{
// CPUID.01H:ECX.RDRAND[bit 30] == 1
int regs[4];
@@ -69,7 +69,7 @@ static int has_rdrand()
#define HAVE_RDRAND 1
-static int get_rdrand_seed()
+static int get_rdrand_seed(void)
{
DEBUG_SEED("get_rdrand_seed");
int _eax;
@@ -91,7 +91,7 @@ static int get_rdrand_seed()
/* get_rdrand_seed - Visual Studio 2012 and above */
-static int get_rdrand_seed()
+static int get_rdrand_seed(void)
{
DEBUG_SEED("get_rdrand_seed");
int r;
@@ -104,7 +104,7 @@ static int get_rdrand_seed()
/* get_rdrand_seed - Visual Studio 2010 and below - x86 only */
-static int get_rdrand_seed()
+static int get_rdrand_seed(void)
{
DEBUG_SEED("get_rdrand_seed");
int _eax;
@@ -136,7 +136,7 @@ retry:
static const char *dev_random_file = "/dev/urandom";
-static int has_dev_urandom()
+static int has_dev_urandom(void)
{
struct stat buf;
if (stat(dev_random_file, &buf)) {
@@ -148,7 +148,7 @@ static int has_dev_urandom()
/* get_dev_random_seed */
-static int get_dev_random_seed()
+static int get_dev_random_seed(void)
{
DEBUG_SEED("get_dev_random_seed");
@@ -184,7 +184,7 @@ static int get_dev_random_seed()
#pragma comment(lib, "advapi32.lib")
#endif
-static int get_cryptgenrandom_seed()
+static int get_cryptgenrandom_seed(void)
{
HCRYPTPROV hProvider = 0;
int r;
@@ -213,7 +213,7 @@ static int get_cryptgenrandom_seed()
#include <time.h>
-static int get_time_seed()
+static int get_time_seed(void)
{
DEBUG_SEED("get_time_seed");
@@ -223,15 +223,15 @@ static int get_time_seed()
/* json_c_get_random_seed */
-int json_c_get_random_seed()
+int json_c_get_random_seed(void)
{
-#if HAVE_RDRAND
+#if defined HAVE_RDRAND && HAVE_RDRAND
if (has_rdrand()) return get_rdrand_seed();
#endif
-#if HAVE_DEV_RANDOM
+#if defined HAVE_DEV_RANDOM && HAVE_DEV_RANDOM
if (has_dev_urandom()) return get_dev_random_seed();
#endif
-#if HAVE_CRYPTGENRANDOM
+#if defined HAVE_CRYPTGENRANDOM && HAVE_CRYPTGENRANDOM
return get_cryptgenrandom_seed();
#endif
return get_time_seed();
diff --git a/random_seed.h b/random_seed.h
index 2f43dad..72ee5f6 100644
--- a/random_seed.h
+++ b/random_seed.h
@@ -20,7 +20,7 @@
extern "C" {
#endif
-extern int json_c_get_random_seed();
+extern int json_c_get_random_seed(void);
#ifdef __cplusplus
}
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/orange-snn/json-c.git
[email protected]:orange-snn/json-c.git
orange-snn
json-c
json-c
master

搜索帮助