--- libelwix/inc/elwix/atree.h 2013/01/17 10:05:35 1.1 +++ libelwix/inc/elwix/atree.h 2023/04/19 18:25:52 1.4.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: atree.h,v 1.1 2013/01/17 10:05:35 misho Exp $ +* $Id: atree.h,v 1.4.2.1 2023/04/19 18:25:52 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 +Copyright 2004 - 2023 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -649,7 +649,7 @@ name##_RB_INSERT(struct name *head, struct type *elm) { \ struct type *tmp; \ struct type *parent = NULL; \ - int comp = 0; \ + long comp = 0; \ tmp = RB_ROOT(head); \ while (tmp) { \ parent = tmp; \ @@ -679,7 +679,7 @@ attr struct type * \ name##_RB_FIND(struct name *head, struct type *elm) \ { \ struct type *tmp = RB_ROOT(head); \ - int comp; \ + long comp; \ while (tmp) { \ comp = cmp(elm, tmp); \ if (comp < 0) \ @@ -698,7 +698,7 @@ name##_RB_NFIND(struct name *head, struct type *elm) { \ struct type *tmp = RB_ROOT(head); \ struct type *res = NULL; \ - int comp; \ + long comp; \ while (tmp) { \ comp = cmp(elm, tmp); \ if (comp < 0) { \ @@ -958,7 +958,8 @@ attr struct type * \ name##_AVL_FIND(struct name *head, struct type *elm) \ { \ struct type *t = AVL_ROOT(head); \ - int comp; \ + long comp; \ + \ while (t) { \ comp = cmp(t, elm); \ if (!comp) \ @@ -977,7 +978,8 @@ name##_AVL_NFIND(struct name *head, struct type *elm) { \ struct type *t = AVL_ROOT(head); \ struct type *res = NULL; \ - int comp; \ + long comp; \ + \ while (t) { \ comp = cmp(t, elm); \ if (!comp) \ @@ -997,7 +999,8 @@ name##_AVL_NEXT(struct name *head, struct type *elm) { \ struct type *t = AVL_ROOT(head); \ struct type *res = NULL; \ - int comp; \ + long comp; \ + \ while (t) { \ comp = cmp(t, elm); \ if (comp < 0) { \ @@ -1015,7 +1018,8 @@ name##_AVL_PREV(struct name *head, struct type *elm) { \ struct type *t = AVL_ROOT(head); \ struct type *res = NULL; \ - int comp; \ + long comp; \ + \ while (t) { \ comp = cmp(t, elm); \ if (comp > 0) { \ @@ -1034,7 +1038,7 @@ name##_AVL_INSERT(struct name *head, struct type *elm) struct type *temp, **pt; \ struct type **ancestors[AVL_MAX_HEIGHT] = { 0 }; \ register int i; \ - int comp; \ + long comp; \ \ for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT && *pt; i++) { \ temp = *pt; \ @@ -1062,7 +1066,8 @@ name##_AVL_REMOVE(struct name *head, struct type *elm) struct type *temp, *old, **dp, **pt; \ struct type **ancestors[AVL_MAX_HEIGHT] = { 0 }; \ register int i; \ - int comp, delcnt; \ + int delcnt; \ + long comp; \ \ for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT; i++) { \ if (!*pt) \