fix/TD-31542-monitorfw-fix-ci-case

This commit is contained in:
dmchen 2024-08-22 00:54:33 +00:00
parent 00c5a213e8
commit bebf552506
2 changed files with 2 additions and 9 deletions

View File

@ -23,9 +23,9 @@
#define TAOS_ASSERT(i) assert(i);
#else
#define TAOS_ASSERT(i) \
if (i) return 1;
if (!(i)) return 1;
#define TAOS_ASSERT_NULL(i) \
if (i) return NULL;
if (!(i)) return NULL;
#endif // TAOS_TEST
#endif // TAOS_ASSERT_H

View File

@ -35,7 +35,6 @@ taos_linked_list_t *taos_linked_list_new(void) {
int taos_linked_list_purge(taos_linked_list_t *self) {
TAOS_ASSERT(self != NULL);
if (self == NULL) return 1;
taos_linked_list_node_t *node = self->head;
while (node != NULL) {
taos_linked_list_node_t *next = node->next;
@ -88,7 +87,6 @@ void *taos_linked_list_last(taos_linked_list_t *self) {
int taos_linked_list_append(taos_linked_list_t *self, void *item) {
TAOS_ASSERT(self != NULL);
if (self == NULL) return 1;
taos_linked_list_node_t *node = (taos_linked_list_node_t *)taos_malloc(sizeof(taos_linked_list_node_t));
node->item = item;
@ -105,7 +103,6 @@ int taos_linked_list_append(taos_linked_list_t *self, void *item) {
int taos_linked_list_push(taos_linked_list_t *self, void *item) {
TAOS_ASSERT(self != NULL);
if (self == NULL) return 1;
taos_linked_list_node_t *node = (taos_linked_list_node_t *)taos_malloc(sizeof(taos_linked_list_node_t));
node->item = item;
@ -147,7 +144,6 @@ void *taos_linked_list_pop(taos_linked_list_t *self) {
int taos_linked_list_remove(taos_linked_list_t *self, void *item) {
TAOS_ASSERT(self != NULL);
if (self == NULL) return 1;
taos_linked_list_node_t *node;
taos_linked_list_node_t *prev_node = NULL;
#ifdef TAOS_LOG_ENABLE
@ -226,7 +222,6 @@ int taos_linked_list_remove(taos_linked_list_t *self, void *item) {
taos_linked_list_compare_t taos_linked_list_compare(taos_linked_list_t *self, void *item_a, void *item_b) {
TAOS_ASSERT(self != NULL);
if (self == NULL) return 1;
if (self->compare_fn) {
return (*self->compare_fn)(item_a, item_b);
} else {
@ -241,14 +236,12 @@ size_t taos_linked_list_size(taos_linked_list_t *self) {
int taos_linked_list_set_free_fn(taos_linked_list_t *self, taos_linked_list_free_item_fn free_fn) {
TAOS_ASSERT(self != NULL);
if (self == NULL) return 1;
self->free_fn = free_fn;
return 0;
}
int taos_linked_list_set_compare_fn(taos_linked_list_t *self, taos_linked_list_compare_item_fn compare_fn) {
TAOS_ASSERT(self != NULL);
if (self == NULL) return 1;
self->compare_fn = compare_fn;
return 0;
}