[digraphanalysis-cvs] digraphanalysis/src main.c,JBREKER main.h,JBREKER node.c,JBREKER
Status: Planning
Brought to you by:
jbreker
|
From: Jeff B. <jb...@us...> - 2005-04-09 03:26:39
|
Update of /cvsroot/digraphanalysis/digraphanalysis/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7846 Modified Files: Tag: JBREKER main.c main.h node.c Log Message: fix bugs that cropped up when converting to LIST_* macros Index: node.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/Attic/node.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** node.c 4 Apr 2005 03:27:36 -0000 1.1.2.3 --- node.c 9 Apr 2005 03:26:30 -0000 1.1.2.4 *************** *** 110,114 **** strncpy(pgpkey->name, name, strlen(name)); *(pgpkey->name + strlen(name)) = '\0'; ! pgpkey->signatures = list_new(&pgpkey_compare); pgpkey->msd = 0; --- 110,114 ---- strncpy(pgpkey->name, name, strlen(name)); *(pgpkey->name + strlen(name)) = '\0'; ! pgpkey->signatures = list_new(); pgpkey->msd = 0; Index: main.c =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/main.c,v retrieving revision 1.2.2.8 retrieving revision 1.2.2.9 diff -C2 -d -r1.2.2.8 -r1.2.2.9 *** main.c 7 Apr 2005 03:02:47 -0000 1.2.2.8 --- main.c 9 Apr 2005 03:26:30 -0000 1.2.2.9 *************** *** 129,138 **** /* Pull apart the list of keys and seperate them into lists where all the keys can reach one another */ keys2 = list_duplicate(keys1, &pgpkey_compare); ! wots = list_new(&wot_compare); ! while(LIST_EMPTY(keys2)) { ! if(((tmplist1 = list_new(&pgpkey_compare_msd)) == NULL) || ! ((tmplist2 = list_new(&pgpkey_compare_msd)) == NULL) || ! (list_add_object(tmplist1, LIST_FIRST(keys2)->object, &pgpkey_compare) == -1)) return -1; list_remove(keys2, LIST_FIRST(keys2)->object, &pgpkey_compare); --- 129,138 ---- /* Pull apart the list of keys and seperate them into lists where all the keys can reach one another */ keys2 = list_duplicate(keys1, &pgpkey_compare); ! wots = list_new(); ! while(!LIST_EMPTY(keys2)) { ! if(((tmplist1 = list_new()) == NULL) || ! ((tmplist2 = list_new()) == NULL) || ! (list_add_object(tmplist1, LIST_FIRST(keys2)->object, &pgpkey_compare_msd) == -1)) return -1; list_remove(keys2, LIST_FIRST(keys2)->object, &pgpkey_compare); *************** *** 140,144 **** { list_free(tmplist2); ! if((tmplist2 = list_duplicate(tmplist1, &pgpkey_compare)) == NULL) return -1; iter1 = LIST_FIRST(tmplist2); --- 140,144 ---- { list_free(tmplist2); ! if((tmplist2 = list_duplicate(tmplist1, &pgpkey_compare_msd)) == NULL) return -1; iter1 = LIST_FIRST(tmplist2); *************** *** 150,154 **** if(pgpkey_distance(iter2->object, iter1->object) != 0) { ! if(list_add_object(tmplist1, iter2->object, &pgpkey_compare) == -1) return -1; list_remove(keys2, iter2->object, &pgpkey_compare); --- 150,154 ---- if(pgpkey_distance(iter2->object, iter1->object) != 0) { ! if(list_add_object(tmplist1, iter2->object, &pgpkey_compare_msd) == -1) return -1; list_remove(keys2, iter2->object, &pgpkey_compare); *************** *** 159,163 **** } } ! if(list_add_object(wots, tmplist1, &pgpkey_compare) == -1) return -1; list_free(tmplist2); --- 159,163 ---- } } ! if(list_add_object(wots, tmplist1, &wot_compare) == -1) return -1; list_free(tmplist2); *************** *** 197,206 **** free(dir); dir = NULL; ! list_remove(tmplist1, key, &pgpkey_compare); key = NULL; } fprintf(filep, "</table></div>\n"); tmplist1 = iter1->object; ! list_remove(wots, tmplist1, &pgpkey_compare); list_free(tmplist1); tmplist1 = NULL; --- 197,206 ---- free(dir); dir = NULL; ! list_remove(tmplist1, key, &pgpkey_compare_msd); key = NULL; } fprintf(filep, "</table></div>\n"); tmplist1 = iter1->object; ! list_remove(wots, tmplist1, &wot_compare); list_free(tmplist1); tmplist1 = NULL; *************** *** 412,416 **** } ! int wot_compare(void *obj1, void *obj2, int (*compare)(void *, void *)) { struct list_t *wot1 = obj1; --- 412,416 ---- } ! int wot_compare(void *obj1, void *obj2) { struct list_t *wot1 = obj1; *************** *** 422,426 **** if((wot1size = list_size(wot1)) == (wot2size = list_size(wot2))) ! return compare(LIST_FIRST(wot1)->object, LIST_FIRST(wot2)->object); return wot2size - wot1size; --- 422,426 ---- if((wot1size = list_size(wot1)) == (wot2size = list_size(wot2))) ! return pgpkey_compare(LIST_FIRST(wot1)->object, LIST_FIRST(wot2)->object); return wot2size - wot1size; Index: main.h =================================================================== RCS file: /cvsroot/digraphanalysis/digraphanalysis/src/main.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** main.h 4 Apr 2005 03:27:36 -0000 1.1.2.4 --- main.h 9 Apr 2005 03:26:30 -0000 1.1.2.5 *************** *** 31,35 **** void print_list(FILE *, struct list_t *); void usage(void); ! int wot_compare(void *, void *, int (*)(void *, void *)); #endif --- 31,35 ---- void print_list(FILE *, struct list_t *); void usage(void); ! int wot_compare(void *, void *); #endif |