From 2c95f8d72f2cce4db5e93fa752a58ae1873d26b6 Mon Sep 17 00:00:00 2001 From: Canrad <1517807724@qq.com> Date: Wed, 4 Oct 2023 20:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BE=9D=E8=B5=96=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=92=8C=E5=BC=95=E7=94=A8NULL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Test/XContainerTest/queueTest.c | 1 + Src/XDataType/XPair/XPair.c | 2 ++ Src/XDataType/XPair/XPair.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Test/XContainerTest/queueTest.c b/Src/Test/XContainerTest/queueTest.c index edeb0c8..a47ad08 100644 --- a/Src/Test/XContainerTest/queueTest.c +++ b/Src/Test/XContainerTest/queueTest.c @@ -1,4 +1,5 @@ #include"Test.h" +#include"XVector.h" #include"XQueue.h" #include"XPriority_Queue.h" #include"XSort.h" diff --git a/Src/XDataType/XPair/XPair.c b/Src/XDataType/XPair/XPair.c index 962f002..0a90e5e 100644 --- a/Src/XDataType/XPair/XPair.c +++ b/Src/XDataType/XPair/XPair.c @@ -10,6 +10,8 @@ XPair* XPair_init(const size_t firstTypeSize, const size_t keyTypeSize) return NULL; } XPair* this_pair = (XPair*)malloc(sizeof(XPair)); + if (isNULL(isNULLInfo(this_pair, "malloc失败"))) + return NULL; this_pair->firstTypeSize = firstTypeSize; this_pair->keyTypeSize = keyTypeSize; if (isNULL(isNULLInfo(this_pair, "初始化pair结构体失败"))) diff --git a/Src/XDataType/XPair/XPair.h b/Src/XDataType/XPair/XPair.h index 878519d..4075542 100644 --- a/Src/XDataType/XPair/XPair.h +++ b/Src/XDataType/XPair/XPair.h @@ -1,7 +1,7 @@ #ifndef XPAIR_H #define XPAIR_H #include -#include"XVector.h" + typedef struct XPair//pair是将2个数据组合成一组数据,当需要这样的需求时就可以使用pair { void* first;//第一组数据 -- Gitee