diff --git a/Assembly.cpp b/Assembly.cpp index 43529c0..8ea37b1 100644 --- a/Assembly.cpp +++ b/Assembly.cpp @@ -1644,8 +1644,8 @@ void* Final_overlap_calculate_heap_merge(void* arg) uint8_t c2n[256]; memset(c2n, 4, 256); - c2n['A'] = c2n['a'] = 0; c2n['C'] = c2n['c'] = 1; - c2n['G'] = c2n['g'] = 2; c2n['T'] = c2n['t'] = 3; // build the encoding table + c2n[(uint8_t)'A'] = c2n[(uint8_t)'a'] = 0; c2n[(uint8_t)'C'] = c2n[(uint8_t)'c'] = 1; + c2n[(uint8_t)'G'] = c2n[(uint8_t)'g'] = 2; c2n[(uint8_t)'T'] = c2n[(uint8_t)'t'] = 3; // build the encoding table @@ -1729,7 +1729,7 @@ void Output_PAF() fwrite(Get_NAME(R_INF, Get_qn(sources[i].buffer[j])), 1, Get_NAME_LENGTH(R_INF, Get_qn(sources[i].buffer[j])), output_file); fwrite("\t", 1, 1, output_file); - fprintf(output_file, "%lu\t", Get_READ_LENGTH(R_INF, Get_qn(sources[i].buffer[j]))); + fprintf(output_file, "%lu\t", (unsigned long)Get_READ_LENGTH(R_INF, Get_qn(sources[i].buffer[j]))); fprintf(output_file, "%d\t", Get_qs(sources[i].buffer[j])); fprintf(output_file, "%d\t", Get_qe(sources[i].buffer[j])); if(sources[i].buffer[j].rev) @@ -1743,7 +1743,7 @@ void Output_PAF() fwrite(Get_NAME(R_INF, Get_tn(sources[i].buffer[j])), 1, Get_NAME_LENGTH(R_INF, Get_tn(sources[i].buffer[j])), output_file); fwrite("\t", 1, 1, output_file); - fprintf(output_file, "%lu\t", Get_READ_LENGTH(R_INF, Get_tn(sources[i].buffer[j]))); + fprintf(output_file, "%lu\t", (unsigned long)Get_READ_LENGTH(R_INF, Get_tn(sources[i].buffer[j]))); fprintf(output_file, "%d\t", Get_ts(sources[i].buffer[j])); fprintf(output_file, "%d\t", Get_te(sources[i].buffer[j])); fprintf(output_file, "%d\t", sources[i].buffer[j].ml); diff --git a/Correct.cpp b/Correct.cpp index 22ff237..83d59e5 100644 --- a/Correct.cpp +++ b/Correct.cpp @@ -3141,8 +3141,8 @@ long long type, long long edgeID, Cigar_record* current_cigar, char* self_string else { fprintf(stderr, "error type\n"); + return -1; } - } @@ -3436,14 +3436,14 @@ void print_graph(Graph* DAGCon) if(If_Node_Exist(*currentStartNode)) { - fprintf(stderr, "ID: %lu (%c) (w: %lu)\n", (*currentStartNode).ID, (*currentStartNode).base, (*currentStartNode).weight); + fprintf(stderr, "ID: %lu (%c) (w: %lu)\n", (unsigned long)(*currentStartNode).ID, (*currentStartNode).base, (unsigned long)(*currentStartNode).weight); clear_RSet(&iter_out); Edge* e; fprintf(stderr, "****Out-node: "); while(getOutputEdges(&iter_out, DAGCon, currentStartNode, &e)) { //fprintf(stderr, "%d[%c], ", G_Node(*DAGCon, e->out_node).ID, G_Node(*DAGCon, e->out_node).base); - fprintf(stderr, "%lu(w: %lu), ", G_Node(*DAGCon, e->out_node).ID, e->weight); + fprintf(stderr, "%lu(w: %lu), ", (unsigned long)G_Node(*DAGCon, e->out_node).ID, (unsigned long)e->weight); } fprintf(stderr, "\n"); @@ -3483,14 +3483,14 @@ void debug_DAGCon(Graph* DAGCon) if(Visit(*e_self) == 0) { fprintf(stderr, "Visit(*e_self): %lu, error visit flag: in_node: %lu, out_node: %lu\n", - Visit(*e_self), (*e_self).in_node, (*e_self).out_node); + (unsigned long)Visit(*e_self), (unsigned long)(*e_self).in_node, (unsigned long)(*e_self).out_node); } if(Visit(*e_reverse) == 0) { fprintf(stderr, "Visit(*e_reverse): %lu, error visit flag: in_node: %lu, out_node: %lu\n", - Visit(*e_reverse), (*e_reverse).in_node, (*e_reverse).out_node); + (unsigned long)Visit(*e_reverse), (unsigned long)(*e_reverse).in_node, (unsigned long)(*e_reverse).out_node); } @@ -3518,14 +3518,14 @@ void debug_DAGCon(Graph* DAGCon) if(Visit(*e_self) == 0) { fprintf(stderr, "Visit(*e_self): %lu, error visit flag: in_node: %lu, out_node: %lu\n", - Visit(*e_self), (*e_self).in_node, (*e_self).out_node); + (unsigned long)Visit(*e_self), (unsigned long)(*e_self).in_node, (unsigned long)(*e_self).out_node); } if(Visit(*e_reverse) == 0) { fprintf(stderr, "Visit(*e_reverse): %lu, error visit flag: in_node: %lu, out_node: %lu\n", - Visit(*e_reverse), (*e_reverse).in_node, (*e_reverse).out_node); + (unsigned long)Visit(*e_reverse), (unsigned long)(*e_reverse).in_node, (unsigned long)(*e_reverse).out_node); } @@ -3958,7 +3958,7 @@ void debug_whole_graph(Graph* g) g->g_nodes.list[i].deletion_edges.length!= 1) { fprintf(stderr, "g->g_nodes.list[i].deletion_edges.length: %lu\n", - g->g_nodes.list[i].deletion_edges.length); + (unsigned long)g->g_nodes.list[i].deletion_edges.length); } } @@ -3969,7 +3969,7 @@ void debug_whole_graph(Graph* g) g->g_nodes.list[i].mismatch_edges.length < 1) { fprintf(stderr, "g->s_end_nodeID: %lu, g->g_nodes.list[%lld].mismatch_edges.length: %lu\n", - g->s_end_nodeID, i, g->g_nodes.list[i].mismatch_edges.length); + (unsigned long)g->s_end_nodeID, i, (unsigned long)g->g_nodes.list[i].mismatch_edges.length); } } @@ -5928,7 +5928,7 @@ void print_core_snp(haplotype_evdience_alloc* hap) for (i = 0; i < hap->core_snp; i++) { fprintf(stderr, "core(i): %lu, site: %u, occ_0: %u, occ_1: %u, occ_2: %u, score: %d\n", - i, hap->snp_stat[i].site, hap->snp_stat[i].occ_0, hap->snp_stat[i].occ_1, + (unsigned long)i, hap->snp_stat[i].site, hap->snp_stat[i].occ_0, hap->snp_stat[i].occ_1, hap->snp_stat[i].occ_2, hap->snp_stat[i].score); @@ -5939,7 +5939,7 @@ void print_core_snp(haplotype_evdience_alloc* hap) { if(vector[j] == 0) { - fprintf(stderr, "type: %d, ID: %lu\n", vector[j], j); + fprintf(stderr, "type: %d, ID: %lu\n", vector[j], (unsigned long)j); } } @@ -5948,7 +5948,7 @@ void print_core_snp(haplotype_evdience_alloc* hap) { if(vector[j] == 1) { - fprintf(stderr, "type: %d, ID: %lu\n", vector[j], j); + fprintf(stderr, "type: %d, ID: %lu\n", vector[j], (unsigned long)j); } } @@ -5957,7 +5957,7 @@ void print_core_snp(haplotype_evdience_alloc* hap) { if(vector[j] == 2) { - fprintf(stderr, "type: %d, ID: %lu\n", vector[j], j); + fprintf(stderr, "type: %d, ID: %lu\n", vector[j], (unsigned long)j); } } @@ -7525,4 +7525,4 @@ long long* max_t_pos, long long* max_q_pos, long long* score, long long* droped) putchar('\n'); **/ /**************for ksw2**************/ -} \ No newline at end of file +} diff --git a/Levenshtein_distance.h b/Levenshtein_distance.h index 681d034..5e2a7bf 100644 --- a/Levenshtein_distance.h +++ b/Levenshtein_distance.h @@ -79,10 +79,10 @@ unsigned int* return_err, int* return_p_end, int* return_t_end) int i = 0; Word tmp_Peq_1 = (Word)1; - Peq['A'] = (Word)0; - Peq['T'] = (Word)0; - Peq['G'] = (Word)0; - Peq['C'] = (Word)0; + Peq[(uint8_t)'A'] = (Word)0; + Peq[(uint8_t)'T'] = (Word)0; + Peq[(uint8_t)'G'] = (Word)0; + Peq[(uint8_t)'C'] = (Word)0; Word Peq_A; @@ -97,19 +97,19 @@ unsigned int* return_err, int* return_p_end, int* return_t_end) tmp_Peq_1 = tmp_Peq_1 << 1; } - Peq_A = Peq['A']; - Peq_C = Peq['C']; - Peq_T = Peq['T']; - Peq_G = Peq['G']; + Peq_A = Peq[(uint8_t)'A']; + Peq_C = Peq[(uint8_t)'C']; + Peq_T = Peq[(uint8_t)'T']; + Peq_G = Peq[(uint8_t)'G']; memset(Peq, 0, sizeof(Word)* 256); - Peq['A'] = Peq_A; - Peq['C'] = Peq_C; - Peq['T'] = Peq_T; - Peq['G'] = Peq_G; + Peq[(uint8_t)'A'] = Peq_A; + Peq[(uint8_t)'C'] = Peq_C; + Peq[(uint8_t)'T'] = Peq_T; + Peq[(uint8_t)'G'] = Peq_G; @@ -166,10 +166,10 @@ unsigned int* return_err, int* return_p_end, int* return_t_end) (*return_err) = line_error; } - Peq['A'] = Peq['A'] >> 1; - Peq['C'] = Peq['C'] >> 1; - Peq['G'] = Peq['G'] >> 1; - Peq['T'] = Peq['T'] >> 1; + Peq[(uint8_t)'A'] = Peq[(uint8_t)'A'] >> 1; + Peq[(uint8_t)'C'] = Peq[(uint8_t)'C'] >> 1; + Peq[(uint8_t)'G'] = Peq[(uint8_t)'G'] >> 1; + Peq[(uint8_t)'T'] = Peq[(uint8_t)'T'] >> 1; ++i; @@ -284,10 +284,10 @@ inline int Reserve_Banded_BPM int i = 0; Word tmp_Peq_1 = (Word)1; - Peq['A'] = (Word)0; - Peq['T'] = (Word)0; - Peq['G'] = (Word)0; - Peq['C'] = (Word)0; + Peq[(uint8_t)'A'] = (Word)0; + Peq[(uint8_t)'T'] = (Word)0; + Peq[(uint8_t)'G'] = (Word)0; + Peq[(uint8_t)'C'] = (Word)0; Word Peq_A; @@ -302,21 +302,21 @@ inline int Reserve_Banded_BPM tmp_Peq_1 = tmp_Peq_1 << 1; } - ///Peq['T'] = Peq['T'] | Peq['C']; + ///Peq[(uint8_t)'T'] = Peq[(uint8_t)'T'] | Peq[(uint8_t)'C']; - Peq_A = Peq['A']; - Peq_C = Peq['C']; - Peq_T = Peq['T']; - Peq_G = Peq['G']; + Peq_A = Peq[(uint8_t)'A']; + Peq_C = Peq[(uint8_t)'C']; + Peq_T = Peq[(uint8_t)'T']; + Peq_G = Peq[(uint8_t)'G']; memset(Peq, 0, sizeof(Word)* 256); - Peq['A'] = Peq_A; - Peq['C'] = Peq_C; - Peq['T'] = Peq_T; - Peq['G'] = Peq_G; + Peq[(uint8_t)'A'] = Peq_A; + Peq[(uint8_t)'C'] = Peq_C; + Peq[(uint8_t)'T'] = Peq_T; + Peq[(uint8_t)'G'] = Peq_G; @@ -376,10 +376,10 @@ inline int Reserve_Banded_BPM } - Peq['A'] = Peq['A'] >> 1; - Peq['C'] = Peq['C'] >> 1; - Peq['G'] = Peq['G'] >> 1; - Peq['T'] = Peq['T'] >> 1; + Peq[(uint8_t)'A'] = Peq[(uint8_t)'A'] >> 1; + Peq[(uint8_t)'C'] = Peq[(uint8_t)'C'] >> 1; + Peq[(uint8_t)'G'] = Peq[(uint8_t)'G'] >> 1; + Peq[(uint8_t)'T'] = Peq[(uint8_t)'T'] >> 1; ++i; @@ -539,10 +539,10 @@ inline int Reserve_Banded_BPM_PATH int i = 0; Word tmp_Peq_1 = (Word)1; - Peq['A'] = (Word)0; - Peq['T'] = (Word)0; - Peq['G'] = (Word)0; - Peq['C'] = (Word)0; + Peq[(uint8_t)'A'] = (Word)0; + Peq[(uint8_t)'T'] = (Word)0; + Peq[(uint8_t)'G'] = (Word)0; + Peq[(uint8_t)'C'] = (Word)0; Word Peq_A; @@ -557,21 +557,21 @@ inline int Reserve_Banded_BPM_PATH tmp_Peq_1 = tmp_Peq_1 << 1; } - ///Peq['T'] = Peq['T'] | Peq['C']; + ///Peq[(uint8_t)'T'] = Peq[(uint8_t)'T'] | Peq[(uint8_t)'C']; - Peq_A = Peq['A']; - Peq_C = Peq['C']; - Peq_T = Peq['T']; - Peq_G = Peq['G']; + Peq_A = Peq[(uint8_t)'A']; + Peq_C = Peq[(uint8_t)'C']; + Peq_T = Peq[(uint8_t)'T']; + Peq_G = Peq[(uint8_t)'G']; memset(Peq, 0, sizeof(Word)* 256); - Peq['A'] = Peq_A; - Peq['C'] = Peq_C; - Peq['T'] = Peq_T; - Peq['G'] = Peq_G; + Peq[(uint8_t)'A'] = Peq_A; + Peq[(uint8_t)'C'] = Peq_C; + Peq[(uint8_t)'T'] = Peq_T; + Peq[(uint8_t)'G'] = Peq_G; @@ -634,10 +634,10 @@ inline int Reserve_Banded_BPM_PATH } - Peq['A'] = Peq['A'] >> 1; - Peq['C'] = Peq['C'] >> 1; - Peq['G'] = Peq['G'] >> 1; - Peq['T'] = Peq['T'] >> 1; + Peq[(uint8_t)'A'] = Peq[(uint8_t)'A'] >> 1; + Peq[(uint8_t)'C'] = Peq[(uint8_t)'C'] >> 1; + Peq[(uint8_t)'G'] = Peq[(uint8_t)'G'] >> 1; + Peq[(uint8_t)'T'] = Peq[(uint8_t)'T'] >> 1; ++i; @@ -645,7 +645,7 @@ inline int Reserve_Banded_BPM_PATH Peq[(uint8_t)pattern[i_bd]] = Peq[(uint8_t)pattern[i_bd]] | Mask; - ///Peq['T'] = Peq['T'] | Peq['C']; + ///Peq[(uint8_t)'T'] = Peq[(uint8_t)'T'] | Peq[(uint8_t)'C']; column_start = i << 3; matrix_bit[column_start] = D0; @@ -906,10 +906,10 @@ inline int Reserve_Banded_BPM_4_SSE_only(char *pattern1, char *pattern2, char *p Word_32 tmp_Peq_1 = 1; - memset(Peq['A'], 0, sizeof(Word_32)* 4); - memset(Peq['C'], 0, sizeof(Word_32)* 4); - memset(Peq['G'], 0, sizeof(Word_32)* 4); - memset(Peq['T'], 0, sizeof(Word_32)* 4); + memset(Peq[(uint8_t)'A'], 0, sizeof(Word_32)* 4); + memset(Peq[(uint8_t)'C'], 0, sizeof(Word_32)* 4); + memset(Peq[(uint8_t)'G'], 0, sizeof(Word_32)* 4); + memset(Peq[(uint8_t)'T'], 0, sizeof(Word_32)* 4); for (i = 0; i= 1 && av[i].ol < thres; --i); + for (i = nv - 1; i >= 1 && av[i].ol < thres; --i) {} last_e = i + 1; for (i = i + 1; i < nv; ++i) @@ -7104,7 +7104,7 @@ int load_ma_hit_ts(ma_hit_t_alloc** x, char* read_file_name) long long n_read; long long i, k; int f_flag; - f_flag += fread(&n_read, sizeof(n_read), 1, fp); + f_flag = fread(&n_read, sizeof(n_read), 1, fp); (*x) = (ma_hit_t_alloc*)malloc(sizeof(ma_hit_t_alloc)*n_read); @@ -7396,7 +7396,7 @@ int asg_pop_bubble(asg_t *g, int max_dist) ///fprintf(stderr, "[M::%s] popped %d bubbles and trimmed %d tips\n", __func__, (uint32_t)n_pop, (uint32_t)(n_pop>>32)); if(VERBOSE >= 1) { - fprintf(stderr, "[M::%s] popped %lu bubbles\n", __func__, n_pop); + fprintf(stderr, "[M::%s] popped %lu bubbles\n", __func__, (unsigned long)n_pop); } return n_pop; } diff --git a/Process_Read.cpp b/Process_Read.cpp index cc0a56f..751fb70 100644 --- a/Process_Read.cpp +++ b/Process_Read.cpp @@ -40,8 +40,8 @@ uint8_t seq_nt6_table[256] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }; -char bit_t_seq_table[256][4] = {0}; -char bit_t_seq_table_rc[256][4] = {0}; +char bit_t_seq_table[256][4] = {{0}}; +char bit_t_seq_table_rc[256][4] = {{0}}; char s_H[5] = {'A', 'C', 'G', 'T', 'N'}; char rc_Table[5] = {'T', 'G', 'C', 'A', 'N'}; @@ -950,8 +950,8 @@ void* input_reads_muti_threads(void* arg) destory_R_buffer_block(&tmp_buf); - fprintf(stderr, "Reads #: %lu\n",total_reads); - fprintf(stderr, "Bases #: %lu\n",R_INF.total_reads_bases); + fprintf(stderr, "Reads #: %lu\n", (unsigned long)total_reads); + fprintf(stderr, "Bases #: %lu\n", (unsigned long)R_INF.total_reads_bases); return NULL;