libbladeRF: gcc-14 fixes

fix build for gcc-14

> host/utilities/bladeRF-fsk/c/src/fir_filter.c:227:28:
error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
227 | outbuf = calloc(sizeof(struct complex_sample), chunk_size);

https://cache.nixos.org/log/hsg1v3cl1hk9ca77rgkng6n6dabz1bi3-libbladeRF-2.5.0.drv

+31
+26
pkgs/by-name/li/libbladeRF/gcc-14-calloc-fixes.diff
··· 1 + diff --git a/host/utilities/bladeRF-fsk/c/src/fir_filter.c b/host/utilities/bladeRF-fsk/c/src/fir_filter.c 2 + index 59f34f0..7def697 100644 3 + --- a/host/utilities/bladeRF-fsk/c/src/fir_filter.c 4 + +++ b/host/utilities/bladeRF-fsk/c/src/fir_filter.c 5 + @@ -213,18 +213,18 @@ int main(int argc, char *argv[]) 6 + return EXIT_FAILURE; 7 + } 8 + 9 + - inbuf = calloc(2*sizeof(int16_t), chunk_size); 10 + + inbuf = calloc(chunk_size, 2*sizeof(int16_t)); 11 + if (!inbuf) { 12 + perror("calloc"); 13 + goto out; 14 + } 15 + - tempbuf = calloc(2*sizeof(int16_t), chunk_size); 16 + + tempbuf = calloc(chunk_size, 2*sizeof(int16_t)); 17 + if (!tempbuf) { 18 + perror("calloc"); 19 + goto out; 20 + } 21 + 22 + - outbuf = calloc(sizeof(struct complex_sample), chunk_size); 23 + + outbuf = calloc(chunk_size, sizeof(struct complex_sample)); 24 + if (!outbuf) { 25 + perror("calloc"); 26 + goto out;
+5
pkgs/by-name/li/libbladeRF/package.nix
··· 13 13 fetchSubmodules = true; 14 14 }; 15 15 16 + patches = [ 17 + # https://github.com/Nuand/bladeRF/issues/994 18 + ./gcc-14-calloc-fixes.diff 19 + ]; 20 + 16 21 nativeBuildInputs = [ cmake pkg-config git doxygen help2man ]; 17 22 # ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208 18 23 buildInputs = [ tecla libusb1 ]