[med-svn] [Git][med-team/libbigwig][upstream] New upstream version 0.4.8+dfsg

Steffen Möller (@moeller) gitlab at salsa.debian.org
Fri Aug 22 15:25:57 BST 2025



Steffen Möller pushed to branch upstream at Debian Med / libbigwig


Commits:
ca73cc86 by Steffen Moeller at 2025-08-22T16:00:17+02:00
New upstream version 0.4.8+dfsg
- - - - -


4 changed files:

- bigWig.h
- bwStats.c
- bwValues.c
- bwWrite.c


Changes:

=====================================
bigWig.h
=====================================
@@ -56,7 +56,7 @@ extern "C" {
 /*!
  * The library version number
  */
-#define LIBBIGWIG_VERSION 0.4.7
+#define LIBBIGWIG_VERSION 0.4.8
 
 /*!
  * If 1, then this library was compiled with remote file support.


=====================================
bwStats.c
=====================================
@@ -70,7 +70,7 @@ static struct vals_t *getVals(bigWigFile_t *fp, bwOverlapBlock_t *o, int i, uint
 
     if(sz) {
         compressed = 1;
-        buf = malloc(sz); 
+        buf = malloc(sz);
     }
     sz = 0; //This is now the size of the compressed buffer
 
@@ -96,7 +96,7 @@ static struct vals_t *getVals(bigWigFile_t *fp, bwOverlapBlock_t *o, int i, uint
     }
 
     p = buf;
-    while(((uLongf) ((void*)p-buf)) < sz) {
+    while(((uLongf) ((char*)p - (char*)buf)) < sz) {
         vtid = p[0];
         vstart = p[1];
         vend = p[2];


=====================================
bwValues.c
=====================================
@@ -135,8 +135,7 @@ static bwOverlapBlock_t *overlapsLeaf(bwRTreeNode_t *node, uint32_t tid, uint32_
     if(!o) return NULL;
 
     for(i=0; i<node->nChildren; i++) {
-        if(tid < node->chrIdxStart[i]) break;
-        if(tid > node->chrIdxEnd[i]) continue;
+        if(tid < node->chrIdxStart[i] || tid > node->chrIdxEnd[i]) continue;
 
         /*
           The individual blocks can theoretically span multiple contigs.
@@ -162,7 +161,6 @@ static bwOverlapBlock_t *overlapsLeaf(bwRTreeNode_t *node, uint32_t tid, uint32_
         if(!o->size) goto error;
 
         for(i=0; i<node->nChildren; i++) {
-            if(tid < node->chrIdxStart[i]) break;
             if(tid < node->chrIdxStart[i] || tid > node->chrIdxEnd[i]) continue;
             if(node->chrIdxStart[i] != node->chrIdxEnd[i]) {
                 if(tid == node->chrIdxStart[i]) {
@@ -524,15 +522,15 @@ bbOverlappingEntries_t *bbGetOverlappingEntriesCore(bigWigFile_t *fp, bwOverlapB
             tmp = o->size[i]; //TODO: Is this correct? Do non-gzipped bigBeds exist?
         }
 
-        bufEnd = buf + tmp;
+        bufEnd = (char*)buf + tmp;
         while(buf < bufEnd) {
             entryTid = ((uint32_t*)buf)[0];
             start = ((uint32_t*)buf)[1];
             end = ((uint32_t*)buf)[2];
-            buf += 12;
+            buf = (char*)buf + 12;
             str = (char*)buf;
             slen = strlen(str) + 1;
-            buf += slen;
+            buf = (char*)buf + slen;
 
             if(entryTid < tid) continue;
             if(entryTid > tid) break;
@@ -543,7 +541,7 @@ bbOverlappingEntries_t *bbGetOverlappingEntriesCore(bigWigFile_t *fp, bwOverlapB
             if(!pushBBIntervals(output, start, end, str, withString)) goto error;
         }
 
-        buf = bufEnd - tmp; //reset the buffer pointer
+        buf = (char*)bufEnd - tmp; //reset the buffer pointer
     }
 
     if(compressed && buf) free(buf);
@@ -552,7 +550,7 @@ bbOverlappingEntries_t *bbGetOverlappingEntriesCore(bigWigFile_t *fp, bwOverlapB
 
 error:
     fprintf(stderr, "[bbGetOverlappingEntriesCore] Got an error\n");
-    buf = bufEnd - tmp;
+    buf = (char*)bufEnd - tmp;
     if(output) bbDestroyOverlappingEntries(output);
     if(compressed && buf) free(buf);
     if(compBuf) free(compBuf);


=====================================
bwWrite.c
=====================================
@@ -317,12 +317,12 @@ static int flushBuffer(bigWigFile_t *fp) {
     if(!wb->ltype) return 0;
 
     //Fill in the header
-    if(!memcpy(wb->p, &(wb->tid), sizeof(uint32_t))) return 1;
-    if(!memcpy(wb->p+4, &(wb->start), sizeof(uint32_t))) return 2;
-    if(!memcpy(wb->p+8, &(wb->end), sizeof(uint32_t))) return 3;
-    if(!memcpy(wb->p+12, &(wb->step), sizeof(uint32_t))) return 4;
-    if(!memcpy(wb->p+16, &(wb->span), sizeof(uint32_t))) return 5;
-    if(!memcpy(wb->p+20, &(wb->ltype), sizeof(uint8_t))) return 6;
+    if(!memcpy((char*)wb->p, &(wb->tid), sizeof(uint32_t))) return 1;
+    if(!memcpy((char*)wb->p+4, &(wb->start), sizeof(uint32_t))) return 2;
+    if(!memcpy((char*)wb->p+8, &(wb->end), sizeof(uint32_t))) return 3;
+    if(!memcpy((char*)wb->p+12, &(wb->step), sizeof(uint32_t))) return 4;
+    if(!memcpy((char*)wb->p+16, &(wb->span), sizeof(uint32_t))) return 5;
+    if(!memcpy((char*)wb->p+20, &(wb->ltype), sizeof(uint8_t))) return 6;
     //1 byte padding
     //Determine the number of items
     switch(wb->ltype) {
@@ -338,7 +338,7 @@ static int flushBuffer(bigWigFile_t *fp) {
     default:
         return 7;
     }
-    if(!memcpy(wb->p+22, &nItems, sizeof(uint16_t))) return 8;
+    if(!memcpy((char*)wb->p+22, &nItems, sizeof(uint16_t))) return 8;
 
     if(sz) {
         //compress
@@ -399,9 +399,9 @@ int bwAddIntervals(bigWigFile_t *fp, const char* const* chrom, const uint32_t *s
         wb->span = 0;
         wb->step = 0;
     }
-    if(!memcpy(wb->p+wb->l, start, sizeof(uint32_t))) return 7;
-    if(!memcpy(wb->p+wb->l+4, end, sizeof(uint32_t))) return 8;
-    if(!memcpy(wb->p+wb->l+8, values, sizeof(float))) return 9;
+    if(!memcpy((char*)wb->p+wb->l, start, sizeof(uint32_t))) return 7;
+    if(!memcpy((char*)wb->p+wb->l+4, end, sizeof(uint32_t))) return 8;
+    if(!memcpy((char*)wb->p+wb->l+8, values, sizeof(float))) return 9;
     updateStats(fp, end[0]-start[0], values[0]);
     wb->l += 12;
 
@@ -420,9 +420,9 @@ int bwAddIntervals(bigWigFile_t *fp, const char* const* chrom, const uint32_t *s
             flushBuffer(fp);
             wb->start = start[i];
         }
-        if(!memcpy(wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 11;
-        if(!memcpy(wb->p+wb->l+4, &(end[i]), sizeof(uint32_t))) return 12;
-        if(!memcpy(wb->p+wb->l+8, &(values[i]), sizeof(float))) return 13;
+        if(!memcpy((char*)wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 11;
+        if(!memcpy((char*)wb->p+wb->l+4, &(end[i]), sizeof(uint32_t))) return 12;
+        if(!memcpy((char*)wb->p+wb->l+8, &(values[i]), sizeof(float))) return 13;
         updateStats(fp, end[i]-start[i], values[i]);
         wb->l += 12;
     }
@@ -447,9 +447,9 @@ int bwAppendIntervals(bigWigFile_t *fp, const uint32_t *start, const uint32_t *e
             flushBuffer(fp);
             wb->start = start[i];
         }
-        if(!memcpy(wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 4;
-        if(!memcpy(wb->p+wb->l+4, &(end[i]), sizeof(uint32_t))) return 5;
-        if(!memcpy(wb->p+wb->l+8, &(values[i]), sizeof(float))) return 6;
+        if(!memcpy((char*)wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 4;
+        if(!memcpy((char*)wb->p+wb->l+4, &(end[i]), sizeof(uint32_t))) return 5;
+        if(!memcpy((char*)wb->p+wb->l+8, &(values[i]), sizeof(float))) return 6;
         updateStats(fp, end[i]-start[i], values[i]);
         wb->l += 12;
     }
@@ -482,8 +482,8 @@ int bwAddIntervalSpans(bigWigFile_t *fp, const char *chrom, const uint32_t *star
             flushBuffer(fp);
             wb->start = start[i];
         }
-        if(!memcpy(wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 5;
-        if(!memcpy(wb->p+wb->l+4, &(values[i]), sizeof(float))) return 6;
+        if(!memcpy((char*)wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 5;
+        if(!memcpy((char*)wb->p+wb->l+4, &(values[i]), sizeof(float))) return 6;
         updateStats(fp, span, values[i]);
         wb->l += 8;
     }
@@ -506,8 +506,8 @@ int bwAppendIntervalSpans(bigWigFile_t *fp, const uint32_t *start, const float *
             flushBuffer(fp);
             wb->start = start[i];
         }
-        if(!memcpy(wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 4;
-        if(!memcpy(wb->p+wb->l+4, &(values[i]), sizeof(float))) return 5;
+        if(!memcpy((char*)wb->p+wb->l, &(start[i]), sizeof(uint32_t))) return 4;
+        if(!memcpy((char*)wb->p+wb->l+4, &(values[i]), sizeof(float))) return 5;
         updateStats(fp, wb->span, values[i]);
         wb->l += 8;
     }
@@ -540,7 +540,7 @@ int bwAddIntervalSpanSteps(bigWigFile_t *fp, const char *chrom, uint32_t start,
             flushBuffer(fp);
             wb->start = wb->end;
         }
-        if(!memcpy(wb->p+wb->l, &(values[i]), sizeof(float))) return 5;
+        if(!memcpy((char*)wb->p+wb->l, &(values[i]), sizeof(float))) return 5;
         updateStats(fp, wb->span, values[i]);
         wb->l += 4;
     }
@@ -563,7 +563,7 @@ int bwAppendIntervalSpanSteps(bigWigFile_t *fp, const float *values, uint32_t n)
             flushBuffer(fp);
             wb->start = wb->end;
         }
-        if(!memcpy(wb->p+wb->l, &(values[i]), sizeof(float))) return 4;
+        if(!memcpy((char*)wb->p+wb->l, &(values[i]), sizeof(float))) return 4;
         updateStats(fp, wb->span, values[i]);
         wb->l += 4;
     }
@@ -754,7 +754,7 @@ int writeIndex(bigWigFile_t *fp) {
     }
     if(!root) return 4;
     fp->idx->root = root;
-    
+
     ll = fp->writeBuffer->firstIndexNode;
     while(ll) {
         p = ll->next;
@@ -994,8 +994,8 @@ int addIntervalValue(bigWigFile_t *fp, uint64_t *nEntries, double *sum, double *
             newBuffer->p = calloc(itemsPerSlot, 32);
             if(!newBuffer->p) goto error;
             newBuffer->m = itemsPerSlot*32;
-            memcpy(newBuffer->p, buffer->p+buffer->l-32, 4);
-            memcpy(newBuffer->p+4, buffer->p+buffer->l-28, 4);
+            memcpy(newBuffer->p, (unsigned char*)buffer->p+buffer->l-32, 4);
+            memcpy((unsigned char*)newBuffer->p+4, (unsigned char*)buffer->p + buffer->l-28, 4);
             ((uint32_t*) newBuffer->p)[2] = ((uint32_t*) newBuffer->p)[1] + zoom;
             *sum = *sumsq = 0.0;
             rv = updateInterval(fp, newBuffer, sum, sumsq, zoom, tid, start, end, value);
@@ -1122,7 +1122,7 @@ int writeZoomLevels(bigWigFile_t *fp) {
         while(ll) {
             p = ll->next;
             free(ll);
-            ll=p; 
+            ll=p;
         }
 
 



View it on GitLab: https://salsa.debian.org/med-team/libbigwig/-/commit/ca73cc867f0b9e9f623f1c63f0f682634a74e9a2

-- 
View it on GitLab: https://salsa.debian.org/med-team/libbigwig/-/commit/ca73cc867f0b9e9f623f1c63f0f682634a74e9a2
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250822/1a35604d/attachment-0001.htm>


More information about the debian-med-commit mailing list