Project

General

Profile

Enhancement #750 » 0024-sanitize-pragma-ignore-passing-argument-X-of-.-with-.patch

Loïc Gomez, 2022-01-10 20:48

View differences:

src/irc.c
1104 1104
		const char *key)
1105 1105
{
1106 1106
	struct chan_info *ci;
1107
// TODO resolve this issue from array_get
1108
// passing argument X of .... with different width due to prototype
1109
#pragma GCC diagnostic push
1110
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
1107 1111
	if (!ischannel(*chan))
1108 1112
		return;
1113
#pragma GCC diagnostic pop
1109 1114

  
1110 1115
	ci = hash_get(&LINK(ircs)->chan_infos, chan);
1111 1116
	if (!ci) {
......
1290 1295
		return;
1291 1296
	}
1292 1297

  
1298
// TODO resolve this issue from array_get
1299
// passing argument X of .... with different width due to prototype
1300
#pragma GCC diagnostic push
1301
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
1293 1302
	if (ischannel(*irc_line_elem(line, 1)) || LINK(src) != LINK(dest)) {
1294 1303
		assert(!line->origin);
1295 1304
		line->origin = LINK(src)->l_server->nick;
......
1299 1308
		free(str);
1300 1309
		return;
1301 1310
	}
1311
#pragma GCC diagnostic pop
1302 1312

  
1303 1313
	/* LINK(src) == LINK(dest) */
1304 1314
	size_t len = strlen(irc_line_elem(line, 2)) + 6;
......
1508 1518
		long int ovmask = 0;
1509 1519
		/* some ircds (e.g. unreal) may display several flags for the
1510 1520
                   same nick */
1521
// TODO resolve this issue from array_get
1522
// passing argument X of .... with different width due to prototype
1523
#pragma GCC diagnostic push
1524
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
1511 1525
		while ((index = bip_get_index(server->prefixes, *names))) {
1512 1526
			ovmask |= 1 << index;
1513 1527
			names++;
1514 1528
		}
1529
#pragma GCC diagnostic pop
1515 1530
		eon = names;
1516 1531
		while (*eon && *eon != ' ')
1517 1532
			eon++;
......
1681 1696
		else if (*mode == '+')
1682 1697
			add = 1;
1683 1698
		else {
1699
// TODO resolve this issue from array_get
1700
// passing argument X of .... with different width due to prototype
1701
#pragma GCC diagnostic push
1702
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
1684 1703
			if (add) {
1685 1704
				mode_add_letter_uniq(server, *mode);
1686 1705
			} else {
1687 1706
				mode_remove_letter(server, *mode);
1688 1707
			}
1708
#pragma GCC diagnostic pop
1689 1709
		}
1690 1710
	}
1691 1711
}
......
1715 1735
		return OK_COPY;
1716 1736
	}
1717 1737

  
1738
// TODO resolve this issue from array_get
1739
// passing argument X of .... with different width due to prototype
1740
#pragma GCC diagnostic push
1741
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
1718 1742
	if (!ischannel(irc_line_elem(line, 1)[0]))
1719 1743
		return ERR_PROTOCOL;
1744
#pragma GCC diagnostic pop
1720 1745

  
1721 1746
	/* channel mode change */
1722 1747
	channel = hash_get(&server->channels, irc_line_elem(line, 1));
......
1785 1810
	long int ovmask;
1786 1811
	int index;
1787 1812

  
1813
// TODO resolve this issue from array_get
1814
// passing argument X of .... with different width due to prototype
1815
#pragma GCC diagnostic push
1816
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
1788 1817
	if (*mode == 'k') {
1789 1818
		if (add) {
1790 1819
			channel->key = bip_strdup(
......
1808 1837
			ovmask &= ~(1 << index);
1809 1838
		hash_insert(&channel->ovmasks, nick, (void *)ovmask);
1810 1839
	}
1840
#pragma GCC diagnostic pop
1811 1841
	return OK_COPY;
1812 1842
}
1813 1843

  
src/log.c
554 554
void log_privmsg(log_t *logdata, const char *ircmask, const char *destination,
555 555
		const char *message)
556 556
{
557
// TODO resolve this issue from array_get
558
// passing argument X of .... with different width due to prototype
559
#pragma GCC diagnostic push
560
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
557 561
	if (!ischannel(*destination)) {
558 562
		char *nick = nick_from_ircmask(ircmask);
559 563
		do_log_privmsg(logdata, nick, 0, ircmask, message);
......
561 565
	} else {
562 566
		do_log_privmsg(logdata, destination, 0, ircmask, message);
563 567
	}
568
#pragma GCC diagnostic pop
564 569
}
565 570

  
566 571
void log_cli_privmsg(log_t *logdata, const char *ircmask,
......
574 579
{
575 580
	if (!ircmask)
576 581
		ircmask = P_IRCMASK;
582
// TODO resolve this issue from array_get
583
// passing argument X of .... with different width due to prototype
584
#pragma GCC diagnostic push
585
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
577 586
	if (!ischannel(*destination)) {
578 587
		char *nick = nick_from_ircmask(ircmask);
579 588
		do_log_privmsg(logdata, nick, 0, ircmask, message);
......
581 590
	} else {
582 591
		do_log_privmsg(logdata, destination, 0, ircmask, message);
583 592
	}
593
#pragma GCC diagnostic pop
584 594
}
585 595

  
586 596
void log_cli_notice(log_t *logdata, const char *ircmask,
......
731 741
	for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi);
732 742
			hash_it_next(&hi)) {
733 743
		store = hash_it_item(&hi);
744
// TODO resolve this issue from array_get
745
// passing argument X of .... with different width due to prototype
746
#pragma GCC diagnostic push
747
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
734 748
		if (ischannel(*hash_it_key(&hi)))
735 749
			log_reset(store);
736 750
		else
737 751
			list_add_last(&drop, bip_strdup(hash_it_key(&hi)));
752
#pragma GCC diagnostic pop
738 753
	}
739 754

  
740 755
	char *name;
......
751 766
	store = hash_get(&log->logfgs, storename);
752 767
	if (store) {
753 768
		log_reset(store);
769
// TODO resolve this issue from array_get
770
// passing argument X of .... with different width due to prototype
771
#pragma GCC diagnostic push
772
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
754 773
		if (!ischannel(*storename))
755 774
			log_drop(log, storename);
775
#pragma GCC diagnostic pop
756 776
	}
757 777
}
758 778

  
......
925 945
		return _log_wrap(dest, buf);
926 946
	p++;
927 947

  
948
// TODO resolve this issue from array_get
949
// passing argument X of .... with different width due to prototype
950
#pragma GCC diagnostic push
951
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
928 952
	if (out && !ischannel(*dest)) {
929 953
		son = storename;
930 954
		lon = strlen(storename);
931 955
	}
956
#pragma GCC diagnostic pop
932 957

  
933 958
	som = p;
934 959
	lom = strlen(p);
......
962 987
		strcpy(p, "ACTION ");
963 988
		p += strlen("ACTION ");
964 989
	}
990
// TODO resolve this issue from array_get
991
// passing argument X of .... with different width due to prototype
992
#pragma GCC diagnostic push
993
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
965 994
	if (out && !ischannel(*dest)) {
966 995
		strcpy(p, PMSG_ARROW);
967 996
		p += strlen(PMSG_ARROW);
968 997
	}
998
#pragma GCC diagnostic pop
969 999
	if (logdata->user->backlog_timestamp != BLTSNone) {
970 1000
		memcpy(p, sots, lots);
971 1001
		p += lots;
......
1385 1415
	const char *dest;
1386 1416

  
1387 1417
	ret = NULL;
1418
// TODO resolve this issue from array_get
1419
// passing argument X of .... with different width due to prototype
1420
#pragma GCC diagnostic push
1421
#pragma GCC diagnostic ignored "-Wtraditional-conversion"
1388 1422
	if (ischannel(*bl))
1389 1423
		dest = bl;
1390 1424
	else
1391 1425
		dest = cli_nick;
1426
#pragma GCC diagnostic pop
1392 1427

  
1393 1428
	if (log_has_backlog(log, bl) || hours) {
1394 1429
		if (hours == 0)
1395
- 
(24-24/24)