Browse Source

Deleted compilations warnings from qspn-empiric.c

Yann Weber 6 years ago
parent
commit
9fba262274
1 changed files with 25 additions and 24 deletions
  1. 25
    24
      src/qspn-empiric.c

+ 25
- 24
src/qspn-empiric.c View File

@@ -550,9 +550,10 @@ thread_joint(int joint, void *(*start_routine) (void *), void *nopt)
550 550
 	pthread_t thread;
551 551
 	total_threads++;
552 552
 	if (joint && !disable_joint) {
553
-		fprintf(stderr, "%u: Joining the thread...", pthread_self());
553
+		fprintf(stderr, "%u: Joining the thread...",
554
+				(unsigned int)pthread_self());
554 555
 		pthread_create(&thread, NULL, start_routine, (void *) nopt);
555
-		fprintf(stderr, " %u\n", thread);
556
+		fprintf(stderr, " %u\n", (unsigned int)thread);
556 557
 		pthread_join(thread, NULL);
557 558
 	} else {
558 559
 		pthread_create(&thread, NULL, start_routine, (void *) nopt);
@@ -601,7 +602,7 @@ gen_rnd_map(int start_node, int back_link, int back_link_rtt)
601 602
 	if (b) {
602 603
 		r++;
603 604
 		setzero(&rtmp, sizeof(map_rnode));
604
-		rtmp.r_node = (u_int *) & int_map[back_link];
605
+		rtmp.r_node = (int *) & int_map[back_link];
605 606
 		rtmp.rtt.tv_usec = back_link_rtt;
606 607
 		//printf("Node %d -> Adding rnode %d (back link)\n", i, back_link);
607 608
 		rnode_add(&int_map[i], &rtmp);
@@ -621,7 +622,7 @@ gen_rnd_map(int start_node, int back_link, int back_link_rtt)
621 622
 			}
622 623
 
623 624
 		/*the building of the new rnode is here */
624
-		rtmp.r_node = (u_int *) & int_map[rnode_rnd];
625
+		rtmp.r_node = (int *) & int_map[rnode_rnd];
625 626
 		ms_rnd = rand_range(0, (MAXRTT * 1000));
626 627
 		rtmp.rtt.tv_usec = ms_rnd * 1000;
627 628
 		//printf("Node %d -> Adding rnode %d\n", i, rnode_rnd);
@@ -643,7 +644,7 @@ gen_rnd_map(int start_node, int back_link, int back_link_rtt)
643 644
 			if (!c) {
644 645
 				/*We create the back link from rnode_rnd to me (i) */
645 646
 				setzero(&rtmp, sizeof(map_rnode));
646
-				rtmp.r_node = (u_int *) & int_map[i];
647
+				rtmp.r_node = (int *) & int_map[i];
647 648
 				rtmp.rtt.tv_usec = ms_rnd * 1000;
648 649
 				//printf("Node %d -> Adding rnode %d (front link)\n", rnode_rnd,i);
649 650
 				rnode_add(&int_map[rnode_rnd], &rtmp);
@@ -669,7 +670,7 @@ init_q_queue(map_node * map)
669 670
 void
670 671
 free_q_queue(map_node * map)
671 672
 {
672
-	int i, e, x;
673
+	int i;
673 674
 	for (i = 0; i < MAXGROUPNODE; i++) {
674 675
 		xfree(qspn_q[i]);
675 676
 	}
@@ -723,8 +724,8 @@ send_qspn_backpro(void *argv)
723 724
 	int x, dst, pkt, to = qopt->q.to;
724 725
 
725 726
 	usleep(qopt->sleep);
726
-	fprintf(stderr, "%u: qspn_backpro from %d to %d\n", pthread_self(),
727
-			qopt->q.from, to);
727
+	fprintf(stderr, "%u: qspn_backpro from %d to %d\n",
728
+			(unsigned int)pthread_self(), qopt->q.from, to);
728 729
 
729 730
 	/*Now we store the received pkt in our pkt_db */
730 731
 	pkt = store_tracer_pkt(qopt);
@@ -732,7 +733,7 @@ send_qspn_backpro(void *argv)
732 733
 	/*We've arrived... finally */
733 734
 	if (int_map[to].flags & QSPN_STARTER) {
734 735
 		fprintf(stderr, "%u: qspn_backpro: We've arrived... finally\n",
735
-				pthread_self());
736
+				(unsigned int)pthread_self());
736 737
 		return NULL;
737 738
 	}
738 739
 
@@ -777,8 +778,8 @@ send_qspn_reply(void *argv)
777 778
 	int x, dst, pkt, to = qopt->q.to;
778 779
 
779 780
 	usleep(qopt->sleep);
780
-	fprintf(stderr, "%u: qspn_reply from %d to %d\n", pthread_self(),
781
-			qopt->q.from, to);
781
+	fprintf(stderr, "%u: qspn_reply from %d to %d\n",
782
+			(unsigned int)pthread_self(), qopt->q.from, to);
782 783
 
783 784
 	/*Let's store the tracer_pkt first */
784 785
 	pkt = store_tracer_pkt(qopt);
@@ -787,7 +788,8 @@ send_qspn_reply(void *argv)
787 788
 	if (qopt->q.broadcast <= int_map[to].brdcast[qopt->q.from]) {
788 789
 		fprintf(stderr,
789 790
 				"%u: DROPPED old brdcast: q.broadcast: %d, qopt->q.from broadcast: %d\n",
790
-				pthread_self(), qopt->q.broadcast,
791
+				(unsigned int)pthread_self(),
792
+				qopt->q.broadcast,
791 793
 				int_map[to].brdcast[qopt->q.from]);
792 794
 		return NULL;
793 795
 	} else
@@ -835,18 +837,18 @@ send_qspn_open(void *argv)
835 837
 {
836 838
 	struct q_opt *qopt = (struct q_opt *) argv, *nopt;
837 839
 	int x, i = 0, dst, pkt, to = qopt->q.to;
838
-	int re, sub_id = qopt->q.q_sub_id;
840
+	int sub_id = qopt->q.q_sub_id;
839 841
 
840 842
 	usleep(qopt->sleep);
841 843
 	fprintf(stderr, "%u: qspn_open from %d to %d [subid: %d]\n",
842
-			pthread_self(), qopt->q.from, to, sub_id);
844
+			(unsigned int)pthread_self(), qopt->q.from, to, sub_id);
843 845
 
844 846
 	pkt = store_tracer_pkt(qopt);
845 847
 
846 848
 	if (to == sub_id) {
847 849
 		fprintf(stderr,
848 850
 				"%u: qspn_open: We received a qspn_open, but we are the OPENER!!\n",
849
-				pthread_self());
851
+				(unsigned int)pthread_self());
850 852
 		return NULL;
851 853
 	}
852 854
 
@@ -855,7 +857,7 @@ send_qspn_open(void *argv)
855 857
 			&int_map[qopt->q.from]) {
856 858
 			qspn_q[to][x].flags[sub_id] |= QSPN_OPENED;
857 859
 			fprintf(stderr, "%u: node:%d->rnode %d  opened\n",
858
-					pthread_self(), to, x);
860
+					(unsigned int)pthread_self(), to, x);
859 861
 		}
860 862
 
861 863
 		if (!(qspn_q[to][x].flags[sub_id] & QSPN_OPENED))
@@ -866,7 +868,7 @@ send_qspn_open(void *argv)
866 868
 		/*Yai! We've finished the reopening of heaven */
867 869
 		fprintf(stderr,
868 870
 				"%u: Yai! We've finished the reopening of heaven\n",
869
-				pthread_self());
871
+				(unsigned int)pthread_self());
870 872
 		return NULL;
871 873
 	}
872 874
 
@@ -915,15 +917,15 @@ send_qspn_pkt(void *argv)
915 917
 	int x, i = 0, dst, pkt, to = qopt->q.to;
916 918
 
917 919
 	usleep(qopt->sleep);
918
-	fprintf(stderr, "%u: qspn_pkt from %d to %d\n", pthread_self(),
919
-			qopt->q.from, to);
920
+	fprintf(stderr, "%u: qspn_pkt from %d to %d\n",
921
+			(unsigned int)pthread_self(), qopt->q.from, to);
920 922
 
921 923
 	pkt = store_tracer_pkt(qopt);
922 924
 
923 925
 	if (qopt->q.routes > 1 && (int_map[to].flags & QSPN_STARTER)) {
924 926
 		fprintf(stderr,
925 927
 				"%u: qspn_pkt: We received a qspn_pkt, but we are the QSPN_STARTER!!\n",
926
-				pthread_self());
928
+				(unsigned int)pthread_self());
927 929
 		return NULL;
928 930
 	}
929 931
 
@@ -941,7 +943,7 @@ send_qspn_pkt(void *argv)
941 943
 	if (!i && !(int_map[to].flags & QSPN_OPENER)
942 944
 		&& !(int_map[to].flags & QSPN_STARTER)) {
943 945
 		/*W00t I'm an extreme node! */
944
-		fprintf(stderr, "%u: W00t I'm an extreme node!\n", pthread_self());
946
+		fprintf(stderr, "%u: W00t I'm an extreme node!\n", (unsigned int)pthread_self());
945 947
 		int_map[to].flags |= QSPN_OPENER;
946 948
 		for (x = 0; x < int_map[to].links; x++) {
947 949
 			/*if(int_map[to].r_node[x].flags & QSPN_SENT) 
@@ -977,7 +979,7 @@ send_qspn_pkt(void *argv)
977 979
 			gbl_stat.qspn_replies++;
978 980
 			node_stat[to].qspn_replies++;
979 981
 			fprintf(stderr, "%u: Sending a qspn_open to %d\n",
980
-					pthread_self(), dst);
982
+					(unsigned int)pthread_self(), dst);
981 983
 			thread_joint(qopt->join, send_qspn_open, (void *) nopt);
982 984
 			xfree(qopt);
983 985
 			return NULL;
@@ -1063,7 +1065,6 @@ send_qspn_pkt(void *argv)
1063 1065
 			int_map[to].r_node[x].flags |= QSPN_BACKPRO;
1064 1066
 			thread_joint(qopt->join, send_qspn_backpro, (void *) nopt);
1065 1067
 #else
1066
-			0;
1067 1068
 #endif							/*Q_BACKPRO */
1068 1069
 		} else if (!(int_map[to].r_node[x].flags & QSPN_CLOSED)) {
1069 1070
 			gbl_stat.qspn_requests++;
@@ -1163,7 +1164,7 @@ lgl_print_map(map_node * map, char *lgl_mapfile)
1163 1164
 					((void *) map[x].r_node[e].r_node -
1164 1165
 					 (void *) map) / sizeof(map_node);
1165 1166
 				fprintf(lgl, "%d %d\n", node,
1166
-						map[x].r_node[e].rtt.tv_usec);
1167
+						(int)map[x].r_node[e].rtt.tv_usec);
1167 1168
 			}
1168 1169
 		}
1169 1170
 	}

Loading…
Cancel
Save