fix/TD-31542-monitorfw-fix-ci-case
This commit is contained in:
parent
00c5a213e8
commit
bebf552506
|
@ -23,9 +23,9 @@
|
||||||
#define TAOS_ASSERT(i) assert(i);
|
#define TAOS_ASSERT(i) assert(i);
|
||||||
#else
|
#else
|
||||||
#define TAOS_ASSERT(i) \
|
#define TAOS_ASSERT(i) \
|
||||||
if (i) return 1;
|
if (!(i)) return 1;
|
||||||
#define TAOS_ASSERT_NULL(i) \
|
#define TAOS_ASSERT_NULL(i) \
|
||||||
if (i) return NULL;
|
if (!(i)) return NULL;
|
||||||
#endif // TAOS_TEST
|
#endif // TAOS_TEST
|
||||||
|
|
||||||
#endif // TAOS_ASSERT_H
|
#endif // TAOS_ASSERT_H
|
||||||
|
|
|
@ -35,7 +35,6 @@ taos_linked_list_t *taos_linked_list_new(void) {
|
||||||
|
|
||||||
int taos_linked_list_purge(taos_linked_list_t *self) {
|
int taos_linked_list_purge(taos_linked_list_t *self) {
|
||||||
TAOS_ASSERT(self != NULL);
|
TAOS_ASSERT(self != NULL);
|
||||||
if (self == NULL) return 1;
|
|
||||||
taos_linked_list_node_t *node = self->head;
|
taos_linked_list_node_t *node = self->head;
|
||||||
while (node != NULL) {
|
while (node != NULL) {
|
||||||
taos_linked_list_node_t *next = node->next;
|
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) {
|
int taos_linked_list_append(taos_linked_list_t *self, void *item) {
|
||||||
TAOS_ASSERT(self != NULL);
|
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));
|
taos_linked_list_node_t *node = (taos_linked_list_node_t *)taos_malloc(sizeof(taos_linked_list_node_t));
|
||||||
|
|
||||||
node->item = item;
|
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) {
|
int taos_linked_list_push(taos_linked_list_t *self, void *item) {
|
||||||
TAOS_ASSERT(self != NULL);
|
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));
|
taos_linked_list_node_t *node = (taos_linked_list_node_t *)taos_malloc(sizeof(taos_linked_list_node_t));
|
||||||
|
|
||||||
node->item = item;
|
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) {
|
int taos_linked_list_remove(taos_linked_list_t *self, void *item) {
|
||||||
TAOS_ASSERT(self != NULL);
|
TAOS_ASSERT(self != NULL);
|
||||||
if (self == NULL) return 1;
|
|
||||||
taos_linked_list_node_t *node;
|
taos_linked_list_node_t *node;
|
||||||
taos_linked_list_node_t *prev_node = NULL;
|
taos_linked_list_node_t *prev_node = NULL;
|
||||||
#ifdef TAOS_LOG_ENABLE
|
#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_linked_list_compare_t taos_linked_list_compare(taos_linked_list_t *self, void *item_a, void *item_b) {
|
||||||
TAOS_ASSERT(self != NULL);
|
TAOS_ASSERT(self != NULL);
|
||||||
if (self == NULL) return 1;
|
|
||||||
if (self->compare_fn) {
|
if (self->compare_fn) {
|
||||||
return (*self->compare_fn)(item_a, item_b);
|
return (*self->compare_fn)(item_a, item_b);
|
||||||
} else {
|
} 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) {
|
int taos_linked_list_set_free_fn(taos_linked_list_t *self, taos_linked_list_free_item_fn free_fn) {
|
||||||
TAOS_ASSERT(self != NULL);
|
TAOS_ASSERT(self != NULL);
|
||||||
if (self == NULL) return 1;
|
|
||||||
self->free_fn = free_fn;
|
self->free_fn = free_fn;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int taos_linked_list_set_compare_fn(taos_linked_list_t *self, taos_linked_list_compare_item_fn compare_fn) {
|
int taos_linked_list_set_compare_fn(taos_linked_list_t *self, taos_linked_list_compare_item_fn compare_fn) {
|
||||||
TAOS_ASSERT(self != NULL);
|
TAOS_ASSERT(self != NULL);
|
||||||
if (self == NULL) return 1;
|
|
||||||
self->compare_fn = compare_fn;
|
self->compare_fn = compare_fn;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue