Skip to content

Commit 8953e94

Browse files
committed
Silence compiler warnings.
1 parent 0dae1bb commit 8953e94

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

io_lib/cram_codecs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ static uint8_t zigzag8 (int8_t x) { return (x << 1) ^ (x >> 7); }
11871187
static uint16_t zigzag16(int16_t x) { return (x << 1) ^ (x >> 15); }
11881188
static uint32_t zigzag32(int32_t x) { return (x << 1) ^ (x >> 31); }
11891189

1190-
static int8_t unzigzag8 (uint8_t x) { return (x >> 1) ^ -(x & 1); }
1190+
//static int8_t unzigzag8 (uint8_t x) { return (x >> 1) ^ -(x & 1); }
11911191
static int16_t unzigzag16(uint16_t x) { return (x >> 1) ^ -(x & 1); }
11921192
static int32_t unzigzag32(uint32_t x) { return (x >> 1) ^ -(x & 1); }
11931193

io_lib/crc32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "io_lib/os.h"
2020

2121
#ifdef HAVE_LIBDEFLATE
22+
#include <libdeflate.h>
2223
uint32_t iolib_crc32(uint32_t previousCrc32, unsigned char *buf, unsigned int len) {
2324
return libdeflate_crc32(previousCrc32, buf, len);
2425
}

io_lib/open_trace_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ mFILE *find_file_url(char *file, char *url) {
491491
int pid;
492492
int maxlen = 8190 - strlen(file);
493493
char *fname = tempnam(NULL, NULL);
494-
int status;
494+
int status = 0;
495495

496496
/* Expand %s for the trace name */
497497
for (cp = buf; *url && cp - buf < maxlen; url++) {

io_lib/string_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ char *string_ndup(string_alloc_t *a_str, char *instr, size_t len) {
148148

149149
if (NULL == str) return NULL;
150150

151-
strncpy(str, instr, len);
151+
memcpy(str, instr, len);
152152
str[len] = 0;
153153

154154
return str;

progs/cram_filter.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,14 @@ int index_start(cram_fd *fd, char *fn, int container) {
745745
return -1;
746746
}
747747

748-
strtol(cp, &cp, 10);
749-
strtol(cp, &cp, 10);
750-
strtol(cp, &cp, 10);
748+
long dummy = 0;
749+
dummy |= strtol(cp, &cp, 10);
750+
dummy |= strtol(cp, &cp, 10);
751+
dummy |= strtol(cp, &cp, 10);
752+
if (dummy == LONG_MIN || dummy == LONG_MAX) {
753+
free(buf);
754+
return -1;
755+
}
751756
if (cram_seek(fd, strtoll(cp, &cp, 10), SEEK_SET) != 0) {
752757
free(buf);
753758
return -1;

progs/srf_dump_all.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ void dump_destination_mode(char mode) {
846846
* Returns the successfully opened file or NULL.
847847
*/
848848
FILE *fopen_slx(char *dir, char *type, int lane, int tile) {
849-
char fn[1024];
849+
char fn[2048];
850850
FILE *fp;
851851

852852
sprintf(fn, "%s/s_%d_%04d_%s.txt", dir, lane, tile, type);
@@ -948,7 +948,7 @@ int process_srf_to_solexa_files(char *ar_name, char chunk_mode, int num_reads_on
948948
* Returns the successfully opened file or NULL.
949949
*/
950950
FILE *fopen_text(char *dir, int lane, int tile) {
951-
char fn[1024];
951+
char fn[2048];
952952
FILE *fp;
953953

954954
sprintf(fn, "%s/s_%d_%04d_dump.txt", dir, lane, tile);

0 commit comments

Comments
 (0)