Diff for /libelwix/inc/elwix/atree.h between versions 1.2.20.1 and 1.4.2.1

version 1.2.20.1, 2015/06/25 00:36:47 version 1.4.2.1, 2023/04/19 18:25:52
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004 - 2015Copyright 2004 - 2023
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 649  name##_RB_INSERT(struct name *head, struct type *elm)  Line 649  name##_RB_INSERT(struct name *head, struct type *elm) 
 {                                                                       \  {                                                                       \
         struct type *tmp;                                               \          struct type *tmp;                                               \
         struct type *parent = NULL;                                     \          struct type *parent = NULL;                                     \
        int comp = 0;                                                      \        long comp = 0;                                                      \
         tmp = RB_ROOT(head);                                            \          tmp = RB_ROOT(head);                                            \
         while (tmp) {                                                   \          while (tmp) {                                                   \
                 parent = tmp;                                           \                  parent = tmp;                                           \
Line 679  attr struct type *       \ Line 679  attr struct type *       \
 name##_RB_FIND(struct name *head, struct type *elm)                     \  name##_RB_FIND(struct name *head, struct type *elm)                     \
 {                                                                       \  {                                                                       \
         struct type *tmp = RB_ROOT(head);                               \          struct type *tmp = RB_ROOT(head);                               \
        int comp;                                                  \        long comp;                                                  \
         while (tmp) {                                                   \          while (tmp) {                                                   \
                 comp = cmp(elm, tmp);                                   \                  comp = cmp(elm, tmp);                                   \
                 if (comp < 0)                                           \                  if (comp < 0)                                           \
Line 698  name##_RB_NFIND(struct name *head, struct type *elm)   Line 698  name##_RB_NFIND(struct name *head, struct type *elm)  
 {                                                                       \  {                                                                       \
         struct type *tmp = RB_ROOT(head);                               \          struct type *tmp = RB_ROOT(head);                               \
         struct type *res = NULL;                                        \          struct type *res = NULL;                                        \
        int comp;                                                  \        long comp;                                                  \
         while (tmp) {                                                   \          while (tmp) {                                                   \
                 comp = cmp(elm, tmp);                                   \                  comp = cmp(elm, tmp);                                   \
                 if (comp < 0) {                                         \                  if (comp < 0) {                                         \
Line 958  attr struct type *         \ Line 958  attr struct type *         \
 name##_AVL_FIND(struct name *head, struct type *elm)                                    \  name##_AVL_FIND(struct name *head, struct type *elm)                                    \
 {                                                                                       \  {                                                                                       \
         struct type *t = AVL_ROOT(head);                                                \          struct type *t = AVL_ROOT(head);                                                \
        int comp;                                                                  \        long comp;                                                                  \
                                                                                         \
         while (t) {                                                                     \          while (t) {                                                                     \
                 comp = cmp(t, elm);                                                     \                  comp = cmp(t, elm);                                                     \
                 if (!comp)                                                              \                  if (!comp)                                                              \
Line 977  name##_AVL_NFIND(struct name *head, struct type *elm)  Line 978  name##_AVL_NFIND(struct name *head, struct type *elm) 
 {                                                                                       \  {                                                                                       \
         struct type *t = AVL_ROOT(head);                                                \          struct type *t = AVL_ROOT(head);                                                \
         struct type *res = NULL;                                                        \          struct type *res = NULL;                                                        \
        int comp;                                                                  \        long comp;                                                                  \
                                                                                         \
         while (t) {                                                                     \          while (t) {                                                                     \
                 comp = cmp(t, elm);                                                     \                  comp = cmp(t, elm);                                                     \
                 if (!comp)                                                              \                  if (!comp)                                                              \
Line 997  name##_AVL_NEXT(struct name *head, struct type *elm)   Line 999  name##_AVL_NEXT(struct name *head, struct type *elm)  
 {                                                                                       \  {                                                                                       \
         struct type *t = AVL_ROOT(head);                                                \          struct type *t = AVL_ROOT(head);                                                \
         struct type *res = NULL;                                                        \          struct type *res = NULL;                                                        \
        int comp;                                                                  \        long comp;                                                                  \
                                                                                         \
         while (t) {                                                                     \          while (t) {                                                                     \
                 comp = cmp(t, elm);                                                     \                  comp = cmp(t, elm);                                                     \
                 if (comp < 0) {                                                         \                  if (comp < 0) {                                                         \
Line 1015  name##_AVL_PREV(struct name *head, struct type *elm)   Line 1018  name##_AVL_PREV(struct name *head, struct type *elm)  
 {                                                                                       \  {                                                                                       \
         struct type *t = AVL_ROOT(head);                                                \          struct type *t = AVL_ROOT(head);                                                \
         struct type *res = NULL;                                                        \          struct type *res = NULL;                                                        \
        int comp;                                                                  \        long comp;                                                                  \
                                                                                         \
         while (t) {                                                                     \          while (t) {                                                                     \
                 comp = cmp(t, elm);                                                     \                  comp = cmp(t, elm);                                                     \
                 if (comp > 0) {                                                         \                  if (comp > 0) {                                                         \
Line 1034  name##_AVL_INSERT(struct name *head, struct type *elm) Line 1038  name##_AVL_INSERT(struct name *head, struct type *elm)
         struct type *temp, **pt;                                                        \          struct type *temp, **pt;                                                        \
         struct type **ancestors[AVL_MAX_HEIGHT] = { 0 };                                \          struct type **ancestors[AVL_MAX_HEIGHT] = { 0 };                                \
         register int i;                                                                 \          register int i;                                                                 \
        int comp;                                                                  \        long comp;                                                                  \
                                                                                         \                                                                                          \
         for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT && *pt; i++) {             \          for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT && *pt; i++) {             \
                 temp = *pt;                                                             \                  temp = *pt;                                                             \
Line 1062  name##_AVL_REMOVE(struct name *head, struct type *elm) Line 1066  name##_AVL_REMOVE(struct name *head, struct type *elm)
         struct type *temp, *old, **dp, **pt;                                            \          struct type *temp, *old, **dp, **pt;                                            \
         struct type **ancestors[AVL_MAX_HEIGHT] = { 0 };                                \          struct type **ancestors[AVL_MAX_HEIGHT] = { 0 };                                \
         register int i;                                                                 \          register int i;                                                                 \
        int comp, delcnt;                                                                \        int delcnt;                                                                        \
         long comp;                                                                      \
                                                                                         \                                                                                          \
         for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT; i++) {                    \          for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT; i++) {                    \
                 if (!*pt)                                                               \                  if (!*pt)                                                               \

Removed from v.1.2.20.1  
changed lines
  Added in v.1.4.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>