Skip to content

Commit ee2477b

Browse files
authored
rPackages.CNEr: fix build (#411509)
2 parents 369b86c + 8c30825 commit ee2477b

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

pkgs/development/r-modules/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,10 @@ let
21602160
];
21612161
});
21622162

2163+
CNEr = old.CNEr.overrideAttrs (attrs: {
2164+
patches = [ ./patches/CNEr.patch ];
2165+
});
2166+
21632167
covidsymptom = old.covidsymptom.overrideAttrs (attrs: {
21642168
preConfigure = "rm R/covidsymptomdata.R";
21652169
});
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/src/ucsc/common.c b/src/ucsc/common.c
2+
index a3fc893..e4198d3 100644
3+
--- a/src/ucsc/common.c
4+
+++ b/src/ucsc/common.c
5+
@@ -341,7 +341,7 @@ if (count > 1)
6+
}
7+
}
8+
9+
-void slUniqify(void *pList, int (*compare )(const void *elem1, const void *elem2), void (*free)())
10+
+void slUniqify(void *pList, int (*compare )(const void *elem1, const void *elem2), void (*freeFunc)())
11+
/* Return sorted list with duplicates removed.
12+
* Compare should be same type of function as slSort's compare (taking
13+
* pointers to pointers to elements. Free should take a simple
14+
@@ -356,7 +356,7 @@ while ((el = slPopHead(&oldList)) != NULL)
15+
{
16+
if ((newList == NULL) || (compare(&newList, &el) != 0))
17+
slAddHead(&newList, el);
18+
- else if (free != NULL)
19+
+ else if (freeFunc != NULL)
20+
free(el);
21+
}
22+
slReverse(&newList);
23+
diff --git a/src/ucsc/hash.c b/src/ucsc/hash.c
24+
index 320b360..6ed9c70 100644
25+
--- a/src/ucsc/hash.c
26+
+++ b/src/ucsc/hash.c
27+
@@ -611,7 +611,7 @@ if ((hash = *pHash) != NULL)
28+
}
29+
}
30+
31+
-void hashFreeWithVals(struct hash **pHash, void (freeFunc)())
32+
+void hashFreeWithVals(struct hash **pHash, void (*freeFunc)(void **))
33+
/* Free up hash table and all values associated with it. freeFunc is a
34+
* function to free an entry, should take a pointer to a pointer to an
35+
* entry. */
36+
diff --git a/src/ucsc/hash.h b/src/ucsc/hash.h
37+
index a7fc017..0d06bb9 100644
38+
--- a/src/ucsc/hash.h
39+
+++ b/src/ucsc/hash.h
40+
@@ -244,7 +244,7 @@ void freeHashAndVals(struct hash **pHash);
41+
/* Free up hash table and all values associated with it.
42+
* (Just calls freeMem on each hel->val) */
43+
44+
-void hashFreeWithVals(struct hash **pHash, void (freeFunc)());
45+
+void hashFreeWithVals(struct hash **pHash, void (*freeFunc)(void **));
46+
/* Free up hash table and all values associated with it. freeFunc is a
47+
* function to free an entry, should take a pointer to a pointer to an
48+
* entry. */

0 commit comments

Comments
 (0)